-
Notifications
You must be signed in to change notification settings - Fork 238
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
[RRFC] --save-peer flag #95
Comments
To clarify (since the starting state of the version range isn’t clear above), unlike save-prod/save-dev, which replace the version range, save-peer should add to it by default (it’s fine if something like |
Notes from the OpenRFC call:
|
We discussed this a bit more in the last OpenRFC call and decided to close this issue since |
Specifically: the implementation as it currently stands in npm v7 is that If we want a different behavior for |
That seems problematic given that the different behavior is the only desired “save peer” functionality, and means it will be delayed until v8. Why will this be added in v7 when there’s already this issue roughly describing the actual need? |
Well, v7 isn't finished yet (and even once it is "released", it'll be in beta for a few months at least), so there's plenty of time to change it. But if we want to change it, now's the time, and that change is what needs an RFC. (Depending on what that change looks like, it might not even need a breaking change, but that'd TBD of course.) This isn't the first time someone's requested I'm just saying that "keep the current save semantics for |
This was brought up by @ljharb during one of our conversations and I'm putting up this RRFC in order to collect early comments and see if anyone can expand upon it and submit a proper RFC in the future.
Essentially the idea here is that it would be nice for the cli to have a more robust or advanced support to saving peer deps ranges from the cli rather than manually handling the
package.json
file.npm install react@16.2 --save-peer # would yield a "react": "16.0 || 16.2" in package.json as result
This type of support can be handy within a
workspaces/monorepo
setup allowing users to easily manage ranges for peer deps of multiple packages at once./cc @npm/cli-team
The text was updated successfully, but these errors were encountered: