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
Fix: install peerDeps which is not optional on headless install #5243
Fix: install peerDeps which is not optional on headless install #5243
Conversation
💖 Thanks for opening this pull request! 💖 |
"name": "reinstall-peer-deps", | ||
"version": "1.0.0", | ||
"devDependencies": { | ||
"eslint-config-standard": "17.0.0" |
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 have confidence about how to write dependencies for the test, so if there is a better way, I would be happy if you point it out.
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.
We use custom packages stored in https://github.com/pnpm/registry-mock for e2e. Those packages are small and faster to install, so tests are fast.
@@ -162,7 +162,7 @@ function pkgAllDeps ( | |||
...(opts.include.optionalDependencies ? pkgSnapshot.optionalDependencies : {}), | |||
}) | |||
.map(([pkgName, ref]) => { | |||
if (pkgSnapshot.peerDependencies?.[pkgName]) return null | |||
if (pkgSnapshot.peerDependenciesMeta?.[pkgName]?.optional) return null |
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 honestly don't remember why this if statement is needed here. Maybe it should be removed.
Congrats on merging your first pull request! 🎉🎉🎉 |
Fixes: #5213
I investigated #5213, and I found headless install, which is the faster installation way with lock file, skips to install peerDependencies. This is caused by this change. I looked up the change and infered that the change seems to be applied to skip to install optional dependencies but peerDependencies is also skipped. I think the ideal behavior is to skip only peerDependencies which is optional, so I fixed so.