-
Notifications
You must be signed in to change notification settings - Fork 23
add npm-template-copy bin #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f3ca7b7 to
8c4ee51
Compare
8c4ee51 to
e0391af
Compare
nlf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes are all clearly functional. i do want to push back (albeit lightly) on adding the template-copy script to everything though, it feels like overkill to me.
another approach that literally just came into my head, maybe npm-template-check can accept a --fix or --repair option or something and that can serve the place of this new bin? then reapplying the templates could be npm run postlint -- --fix and we don't need to add a new script to make it easily reachable. thoughts?
|
|
||
| config.paths.push(root) | ||
|
|
||
| config.force = process.argv.indexOf('--force') !== -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total nit, but process.argv.includes('--force') is shorter and more clear (i think)
| scripts: { | ||
| lint: `eslint '**/*.js'`, | ||
| postlint: 'npm-template-check', | ||
| 'template-copy': 'npm-template-copy --force', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to add this script to everything? are we re-applying templates enough that it's necessary?
|
|
||
| const patchPackage = async (path, root, config) => { | ||
| const pkg = await PackageJson.load(path) | ||
| config = config || {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another total nit, but this might be more readable if the function definition just sets a default (assuming we're not passing an explicit falsey value anywhere that this is working around, anyway)
Packages using template-oss can now manually invoke copying template files, regardless of template-oss matching.
npm run template-copy