Add more metadata to package.json for node scrapers created via the site
At a minimum, the required keys 'name' and 'version' should be added.
Excuse my ignorance :) What's the reason for this?
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
Cool, thanks, that makes sense.
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?
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 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.
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.
Oh good question. If you can find where it's being inserted there's probably a way to parse variables to the template.
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.