feat!: resolution-mode is lowest-direct by default (#6047)

This commit is contained in:
Zoltan Kochan
2023-02-07 05:12:11 +02:00
committed by GitHub
parent 8e35c21d11
commit 113f0ae266
5 changed files with 11 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
---
"@pnpm/core": major
"@pnpm/config": major
"pnpm": major
---
`resolution-mode` is `lowest-direct` by default.

View File

@@ -216,7 +216,7 @@ export async function getConfig (
],
'recursive-install': true,
registry: npmDefaults.registry,
'resolution-mode': 'highest',
'resolution-mode': 'lowest-direct',
'resolve-peers-from-workspace-root': true,
'save-peer': false,
'save-workspace-protocol': 'rolling',

View File

@@ -178,7 +178,7 @@ const defaults = async (opts: InstallOptions) => {
pruneStore: false,
rawConfig: {},
registries: DEFAULT_REGISTRIES,
resolutionMode: 'highest',
resolutionMode: 'lowest-direct',
saveWorkspaceProtocol: 'rolling',
lockfileIncludeTarballUrl: false,
scriptsPrependNodePath: false,

View File

@@ -274,6 +274,7 @@ async function update (
? createMatcher(dependencies)
: undefined,
updatePackageManifest: opts.save !== false,
resolutionMode: opts.save === false ? 'highest' : opts.resolutionMode,
}, dependencies)
}

View File

@@ -220,7 +220,7 @@ test('interactive update of dev dependencies only', async () => {
expect(
Object.keys(lockfile.packages ?? {})
).toStrictEqual(
['/is-negative@1.0.1', '/is-negative@2.1.0']
['/is-negative@1.0.0', '/is-negative@2.1.0']
)
})