fix: accidentally skipped peer dependencies

ref #2919
This commit is contained in:
Zoltan Kochan
2020-10-15 00:34:45 +03:00
parent e8dcc42d56
commit c6eaf01c9e
3 changed files with 6 additions and 10 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/resolve-dependencies": patch
---
Resolved peer dependencies should always be included.

View File

@@ -404,12 +404,6 @@ requires a peer of ${peerName}@${peerVersionRange} but version ${resolved.versio
})
}
if (resolved.depth === ctx.currentDepth + 1) {
// if the resolved package is a regular dependency of the package
// then there is no need to link it in
continue
}
if (resolved?.nodeId) resolvedPeers[peerName] = resolved.nodeId
}
return { resolvedPeers, missingPeers }

View File

@@ -121,10 +121,7 @@ test('when a package is referenced twice in the dependencies graph and one of th
name: 'bar',
depPath: 'bar/1.0.0',
version: '1.0.0',
peerDependencies: {
foo: '1.0.0',
qar: '1.0.0',
} as Record<string, string>,
peerDependencies: {} as Record<string, string>,
}
const zooPkg = {
name: 'zoo',