morph icon indicating copy to clipboard operation
morph copied to clipboard

Add more metadata to package.json for node scrapers created via the site

Open drzax opened this issue 10 years ago • 9 comments

At a minimum, the required keys 'name' and 'version' should be added.

drzax avatar Aug 12 '15 01:08 drzax

Excuse my ignorance :) What's the reason for this?

henare avatar Aug 12 '15 02:08 henare

I'll grant you that there's probably no technical reason this is necessary. It's basically to conform with the specification: https://docs.npmjs.com/files/package.json

On Wed, Aug 12, 2015 at 12:08 PM, Henare Degan [email protected] wrote:

Excuse my ignorance :) What's the reason for this?

Reply to this email directly or view it on GitHub: https://github.com/openaustralia/morph/issues/890#issuecomment-130136126

drzax avatar Aug 12 '15 02:08 drzax

Cool, thanks, that makes sense.

henare avatar Aug 12 '15 02:08 henare

This looks like the template file in question https://github.com/openaustralia/morph/blob/master/default_files/nodejs/template/package.json

@simon would you care to drop in here what the values should be?

equivalentideas avatar Mar 23 '17 04:03 equivalentideas

I'm happy to submit a pull request. What data does can I use in the template and what format should the placeholders take?

drzax avatar Mar 24 '17 01:03 drzax

@drzax Sounds like you're the expert on this one ;-) Whatever would be helpful to users, and if there's a common best practice / convention that sounds good.

equivalentideas avatar Mar 24 '17 01:03 equivalentideas

Does the template get run through something which replaces tokens though? e.g. It would Ideally include something like:

{
  "name": "${scraper-slug}",
  "description": "${scraper-description}",
  "author": "${github-user} <${github-email}>"
...etc
}

But I don't know what data is available in the template.

drzax avatar Mar 24 '17 01:03 drzax

Oh good question. If you can find where it's being inserted there's probably a way to parse variables to the template.

equivalentideas avatar Mar 24 '17 01:03 equivalentideas

I suspect if any templating of default files were to happen it would happen here: https://github.com/openaustralia/morph/blob/master/lib/morph/language.rb#L102

So it doesn't appear that there is any and I don't think that's something I have the Ruby knowledge to change.

drzax avatar Mar 24 '17 09:03 drzax