diff --git a/.changeset/yellow-rules-learn.md b/.changeset/yellow-rules-learn.md new file mode 100644 index 0000000000..979b639e25 --- /dev/null +++ b/.changeset/yellow-rules-learn.md @@ -0,0 +1,6 @@ +--- +"@pnpm/core": patch +"pnpm": patch +--- + +`peerDependencyRules` should work when both `overrides` and `packageExtensions` are present as well. diff --git a/packages/core/src/install/index.ts b/packages/core/src/install/index.ts index 662a6d0ed9..71253e7cef 100644 --- a/packages/core/src/install/index.ts +++ b/packages/core/src/install/index.ts @@ -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 }