-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for specifying --access, aligning better with default publish behavior #81
Add support for specifying --access, aligning better with default publish behavior #81
Conversation
I think it makes sense for release-plan to have the same behavior as normal npm/pnpm here. That means that scoped packages that publish using release-plan would use publishConfig.access to specify that they should be published using This has a few upsides:
The TL;DR is that this PR removes the hardcoded However, this would be a breaking change, because many existing I personally think that But the vast majority of existing
|
as it turns out, it's only a breaking change for packages that haven't yet published any version at all, because once you publish a public scoped package, npm knows that it's public, and keeps going with that. Relying on default behavior protects us nicely here |
"--tag=best-tag", | ||
], | ||
"released": Map {}, | ||
} | ||
`); | ||
}); | ||
|
||
it('adds dry-run if passed by options', async function () { |
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.
🙌
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.
thank you!!!
Can I just say, this is a great PR 😍 It's also fantastic to take a weekend off and come back to a whole loop being closed! Great work everyone! 🎉 |
Closes #80
Changes:
--dry-run
flag so it is passed topnpm publish
to get more useful feedback.--access=public
argument and instead allow users to pass the--access
flag withpublic
orrestricted
set.Previously, running
pnpm release-plan publish
would force any package to publish as public, even if the access was set to restricted in the package.json.This change better matches the default behavior of
pnpm publish
and allows scoped packages to avoid being switched to public accidentally.With this change, the expected behaviors are:
--access
flag will respect the publishConfig access set inpackage.json
--access
flag will override the publishConfig access set inpackage.json
--access
flag and no publishConfig access set inpackage.json
"By default, scoped packages are published with private visibility." [source]
"By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a scope in the name, combined with a scope-configured registry (see package.json)." [source]
Important
Item 3 here could use extra consideration because I think it could cause a breaking change for folks who do not set the access in their package.json or publish command.