Skip to content
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

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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
Copy link
Member

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.

return dp.refToRelative(ref, pkgName)
})
.filter((nodeId) => nodeId !== null) as string[]
Expand Down
@@ -0,0 +1,7 @@
{
"name": "reinstall-peer-deps",
"version": "1.0.0",
"devDependencies": {
"eslint-config-standard": "17.0.0"
Copy link
Member Author

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.

Copy link
Member

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.

}
}