Don't attempt to npm publish if package flagged as private in package.json #64
|
|
We still "publish" these modules (we install them from the tag produced by npm version) so need all the other aspects of |
|
I think this makes sense. However, you should use Also, it should very clearly state that the publish step was skipped, and why.
Is it possible to publish private packages on npm if they are namespaced and you have a paid account? If so we may need to add extra logic for that. |
Reading the docs (https://docs.npmjs.com/files/package.json#private) it doesn't look like it. The purpose of |
|
Yeah, this makes sense then. If As stated - use |
Not really sure how to accomplish this with Listr - are you able to point me in the right direction? I tried resolving the 'publish' task's promise to the message, I tried exec'ing an |
Skippable Tasks #15
|
@jamestalmage yes that's exactly what I need, thanks for raising those issues! In the meantime I've addressed all your other feedback - hopefully this can go ahead without the official skip warning? |
| @@ -116,7 +114,14 @@ module.exports = (input, opts) => { | ||
| }, | ||
| { | ||
| title: 'Publishing package', | ||
| - task: () => exec('npm', ['publish'].concat(opts.tag ? ['--tag', opts.tag] : [])) | ||
| + task: () => readPkgUp() |
|
sindresorhus
I would use |
Sure, just open an issue with the remaining work so we don't forget. |
|
Looks great. Could you add a note to the readme about the behavior? This might be useful for other people to, but I don't think they would realize it's possible without some kind of indication. |
|
Skipping tasks is hopefully not too far away (SamVerschueren/listr#17), happy to hold out for that - this isn't super urgent for us. |
1 check passed
We can follow up once that lands. Great work. Thanks! |
|
Excellent work on this @unkillbob :) Cheers. |
Fixes #65
We have a bunch of packages that are installed out of private git repos and attempting to use
npfails at the second last step asnpm publishexits with an error when thepackage.jsonspecifiesprivate: true.This pull request makes the change to simply skip the publish step if the package is flagged as private. I wasn't sure whether you'd want this mentioned in the readme or not - let me know if I should update it.
npis really awesome and exactly what we needed, I hope we can get this small change in to adapt it for our use case!