-
Notifications
You must be signed in to change notification settings - Fork 604
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
[rush] Don't install peerDependencies if the autoInstallPeers setting isn't true #4845
base: main
Are you sure you want to change the base?
Conversation
common/changes/@microsoft/rush/dmyers-4843_2024-07-22-18-37.json
Outdated
Show resolved
Hide resolved
What about optional peer dependencies? Is that case missing here? |
Co-authored-by: Ian Clanton-Thuon <[email protected]>
@iclanton Good question. I looked at how PackageJsonEditor organizes dependencies, and it looks like it doesn't distinguish between normal According to the PNPM docs, So, I think an appropriate fix would be to add a further conditional to ensure that optionalPeers never get added to the I'll take a look at that tomorrow, thanks. |
Update: Having looked at it, it appears that |
@davemyersworld - did you get a chance to address the optional peers issue? |
@iclanton Thanks for checking in. For reasons unrelated to this PR, the project I was working became blocked, so my effort on this PR did as well. |
Summary
Fixes #4843
When a rush monorepo is configured to use
pnpm
withuseWorkspaces:false
, andautoInstallPeers:false
(the default), peerDependencies of monorepo packages are incorrectly installed.Details
I fixed the problem by testing for this exact case.
I'm not sure if other package managers should be considered as well (thus far, I have not).
How it was tested
By running
testrush update
such that the code in this PR executed against my repro-repository and confirming noreact-router
in thenode_modules
directoryImpacted documentation
none