mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
fix: the add command should not fail, when blockExoticSubdeps is true (#10327)
close #10324
This commit is contained in:
6
.changeset/dirty-cases-scream.md
Normal file
6
.changeset/dirty-cases-scream.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/resolve-dependencies": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't fail on `pnpm add`, when `blockExoticSubdeps` is set to `true` [#10324](https://github.com/pnpm/pnpm/issues/10324).
|
||||
BIN
__fixtures__/with-git-protocol-dep/cache/metadata-v1.3/localhost+7769/is-number.v8
vendored
Normal file
BIN
__fixtures__/with-git-protocol-dep/cache/metadata-v1.3/localhost+7769/is-number.v8
vendored
Normal file
Binary file not shown.
@@ -1390,7 +1390,8 @@ async function resolveDependency (
|
||||
if (
|
||||
ctx.blockExoticSubdeps &&
|
||||
options.currentDepth > 0 &&
|
||||
!isNonExoticDep(pkgResponse.body.resolvedVia)
|
||||
pkgResponse.body.resolvedVia != null && // This is already coming from the lockfile, we skip the check in this case for now. Should be fixed later.
|
||||
isExoticDep(pkgResponse.body.resolvedVia)
|
||||
) {
|
||||
const error = new PnpmError(
|
||||
'EXOTIC_SUBDEP',
|
||||
@@ -1807,6 +1808,6 @@ const NON_EXOTIC_RESOLVED_VIA = new Set([
|
||||
'workspace',
|
||||
])
|
||||
|
||||
function isNonExoticDep (resolvedVia: string | undefined): boolean {
|
||||
return resolvedVia != null && NON_EXOTIC_RESOLVED_VIA.has(resolvedVia)
|
||||
function isExoticDep (resolvedVia: string): boolean {
|
||||
return !NON_EXOTIC_RESOLVED_VIA.has(resolvedVia)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user