mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-28 02:53:15 -04:00
6
.changeset/gold-cars-protect.md
Normal file
6
.changeset/gold-cars-protect.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/resolve-dependencies": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Fixed an issue where optional dependencies were not linked into the dependent's node_modules [#7943](https://github.com/pnpm/pnpm/issues/7943).
|
||||
@@ -689,3 +689,12 @@ test('optional dependency is hardlinked to the store if it does not require a bu
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
// Covers https://github.com/pnpm/pnpm/issues/7943
|
||||
test('complex scenario with same optional dependencies appearing in many places of the dependency graph', async () => {
|
||||
prepareEmpty()
|
||||
await addDependenciesToPackage({}, ['@storybook/addon-essentials@7.6.17', 'storybook@7.6.17', 'vite@5.2.8'], testDefaults())
|
||||
|
||||
expect(fs.readdirSync('node_modules/.pnpm/esbuild@0.18.20/node_modules/@esbuild').length).toEqual(1)
|
||||
expect(fs.readdirSync('node_modules/.pnpm/esbuild@0.20.2/node_modules/@esbuild').length).toEqual(1)
|
||||
})
|
||||
|
||||
@@ -277,7 +277,7 @@ function buildTree (
|
||||
}
|
||||
const childNodeId = createNodeId(parentNodeId, child.depPath)
|
||||
childrenNodeIds[child.alias] = childNodeId
|
||||
installable = installable && !ctx.skipped.has(child.depPath)
|
||||
installable = installable || !ctx.skipped.has(child.depPath)
|
||||
ctx.dependenciesTree.set(childNodeId, {
|
||||
children: () => buildTree(ctx,
|
||||
childNodeId,
|
||||
|
||||
Reference in New Issue
Block a user