mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 02:29:48 -04:00
9
.changeset/moody-geckos-bathe.md
Normal file
9
.changeset/moody-geckos-bathe.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
"@pnpm/package-requester": patch
|
||||
"@pnpm/filter-lockfile": patch
|
||||
"@pnpm/headless": patch
|
||||
"@pnpm/deps.graph-builder": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
The `engines.pnpm` field in the `package.json` files of dependencies should be ignored [#7965](https://github.com/pnpm/pnpm/issues/7965).
|
||||
1
deps/graph-builder/src/lockfileToDepGraph.ts
vendored
1
deps/graph-builder/src/lockfileToDepGraph.ts
vendored
@@ -120,7 +120,6 @@ export async function lockfileToDepGraph (
|
||||
lockfileDir: opts.lockfileDir,
|
||||
nodeVersion: opts.nodeVersion,
|
||||
optional: pkgSnapshot.optional === true,
|
||||
pnpmVersion: opts.pnpmVersion,
|
||||
supportedArchitectures: opts.supportedArchitectures,
|
||||
}) === false
|
||||
) {
|
||||
|
||||
@@ -168,7 +168,6 @@ function pkgAllDeps (
|
||||
lockfileDir: opts.lockfileDir,
|
||||
nodeVersion: opts.currentEngine.nodeVersion,
|
||||
optional: pkgSnapshot.optional === true,
|
||||
pnpmVersion: opts.currentEngine.pnpmVersion,
|
||||
supportedArchitectures: opts.supportedArchitectures,
|
||||
}) !== false
|
||||
if (!installable) {
|
||||
|
||||
@@ -161,7 +161,7 @@ test('skip optional dependency that does not support the current Node version',
|
||||
expect(reportedTimes).toBe(1)
|
||||
})
|
||||
|
||||
test('skip optional dependency that does not support the current pnpm version', async () => {
|
||||
test('do not skip optional dependency that does not support the current pnpm version', async () => {
|
||||
const project = prepareEmpty()
|
||||
const reporter = sinon.spy()
|
||||
|
||||
@@ -175,7 +175,7 @@ test('skip optional dependency that does not support the current pnpm version',
|
||||
pnpmVersion: '4.0.0',
|
||||
}))
|
||||
|
||||
project.hasNot('@pnpm.e2e/for-legacy-pnpm')
|
||||
project.has('@pnpm.e2e/for-legacy-pnpm')
|
||||
project.storeHas('@pnpm.e2e/for-legacy-pnpm', '1.0.0')
|
||||
|
||||
const logMatcher = sinon.match({
|
||||
@@ -187,7 +187,7 @@ test('skip optional dependency that does not support the current pnpm version',
|
||||
reason: 'unsupported_engine',
|
||||
})
|
||||
const reportedTimes = reporter.withArgs(logMatcher).callCount
|
||||
expect(reportedTimes).toBe(1)
|
||||
expect(reportedTimes).toBe(0)
|
||||
})
|
||||
|
||||
test('don\'t skip optional dependency that does not support the current OS when forcing', async () => {
|
||||
|
||||
@@ -185,7 +185,6 @@ async function fetchDeps (
|
||||
lockfileDir: opts.lockfileDir,
|
||||
nodeVersion: opts.nodeVersion,
|
||||
optional: pkgSnapshot.optional === true,
|
||||
pnpmVersion: opts.pnpmVersion,
|
||||
supportedArchitectures: opts.supportedArchitectures,
|
||||
}) === false
|
||||
) {
|
||||
|
||||
@@ -235,7 +235,6 @@ async function resolveAndFetch (
|
||||
lockfileDir: options.lockfileDir,
|
||||
nodeVersion: ctx.nodeVersion,
|
||||
optional: wantedDependency.optional === true,
|
||||
pnpmVersion: ctx.pnpmVersion,
|
||||
supportedArchitectures: options.supportedArchitectures,
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user