-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Allow explicit private publish to prevent public publish prompt #497
Allow explicit private publish to prevent public publish prompt #497
Conversation
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.
I don't know whether setting publishConfig.access
will prevent the prompt or not. So will keep silent for it and hope we can handle every prompt friendly in future.
About runPublish
,
- Glad to see replacing
options.publish && !pkg.private
withrunPublish
as I commented. - But would not like extract it as
shouldRunPublish
. The name is not consistent withrunTests
,runCleanup
. Considering we have no sufficient tests and the redundant logic is short, I prefer the conservative way.
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.
LGTM 👍🏻 Thanks for working on this @kylemh!
@chinesedfan Have you tested this locally and can verify this works for you? (I haven't tested this out myself, but will hopefully get to it sometime in the next few days.) |
@itaisteinherz I didn't have an end-to-end package to test. Here are how I tested,
|
FWIW, I exported my own fork of this PR and am using it in a repository already. I know y'all ensure everything's perfect with PRs, but I needed it immediately 😂 |
Merging as this is ready IMO. Thanks again for working on this @kylemh 🙏🏻 |
Thanks! @itaisteinherz FWIW, I'm a little afraid of the wording with |
I agree it's a bit confusing, but it's also the terminology npm uses. In this case, I think adding a note to the readme would help avoid any confusion. If you're up for doing that and creating another PR, that would be great 😉 |
Fixes #496
This will enable private, Org-scoped packages to easily publish new versions of a package as part of a CI/CD process by preventing the prompt of publically publishing a package when
publishConfig.access
is explicitly set to'restricted'
inpackage.json
.Also "booleanified"
runPublish
->shouldRunPublish
and reduced the number of times the same boolean is re-defined.