fix: peerDependencyRules when other rules are also present (#4255)

This commit is contained in:
Zoltan Kochan
2022-01-19 11:48:19 +02:00
committed by GitHub
parent 57af1b1b5e
commit 08d781b806
2 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/core": patch
"pnpm": patch
---
`peerDependencyRules` should work when both `overrides` and `packageExtensions` are present as well.

View File

@@ -515,7 +515,9 @@ export function createReadPackageHook (
if (hooks.length === 0) {
return readPackageHook
}
const readPackageAndExtend = hooks.length === 1 ? hooks[0] : pipeWith(async (f, res) => f(await res), [hooks[0], hooks[1]]) as ReadPackageHook
const readPackageAndExtend = hooks.length === 1
? hooks[0]
: pipeWith(async (f, res) => f(await res), hooks as any) as ReadPackageHook // eslint-disable-line @typescript-eslint/no-explicit-any
if (readPackageHook != null) {
return (async (manifest: ProjectManifest, dir?: string) => readPackageAndExtend(await readPackageHook(manifest, dir), dir)) as ReadPackageHook
}