-
Notifications
You must be signed in to change notification settings - Fork 352
update peer dependencies on upgrade and retry #874
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
raineorshine
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.
Thanks for the additional contribution and excellent explanation! Makes perfect sense. I'd love to add your description to a markdown file that documents for users how the --peer feature works.
I just have a few requests for some simplifications and conforming to a more functional programming paradigm. Thanks and let me know if you have any questions!
|
Thank you! Published in |
|
@raineorshine : Are you interested in a functionality for Example 1:Example 2:Background: I've made a PR for I could move that code from |
|
Looks nice!
|
Yes.
Oh, sorry. The section "Ignored updates" is a special thing of |
|
Yes, I like it! |
This is a follow-up of #869 and improves the situation, where updated packages have different peer dependencies. Here is an example:
The package
ncu-test-peer-updateis published with two versions:1.0.0has peer dependency"ncu-test-return-version": "1.0.x"1.1.0has peer dependency"ncu-test-return-version": "1.1.x"Our test app has the following dependencies:
Before (i.e. with
ncuversion 11.5.1)A call of
ncu --peerwill propose the following updates:There is not update suggestion for
ncu-test-return-versionto1.1.0, since the installed version ofncu-test-peer-updaterequires version1.0.x. This means, I would have to runnpm installafterwards and then againncu --peerto get all updates.After (i.e. with this PR)
Now,
ncuwill get the new peer dependencies from the registry and check again for updates. I.e., the resulting update suggestion will contain all compatible updates.Without
--peeroptionJust as comparison: without using the
--peeroption,ncuwill suggest incompatible updates in both cases (with and without this PR):