feat(core): pruneLockfileImporters is true by default

This commit is contained in:
Zoltan Kochan
2022-03-16 23:01:54 +02:00
parent f332202030
commit a36b6026bb
5 changed files with 16 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/core": major
---
pruneLockfileImporters is true by default.

View File

@@ -141,7 +141,7 @@ const defaults = async (opts: InstallOptions) => {
preferFrozenLockfile: true,
preferWorkspacePackages: false,
preserveWorkspaceProtocol: true,
pruneLockfileImporters: false,
pruneLockfileImporters: true,
pruneStore: false,
rawConfig: {},
registries: DEFAULT_REGISTRIES,

View File

@@ -249,6 +249,7 @@ test('dependencies of other importers are not pruned when installing for a subse
dir: path.resolve('project-1'),
lockfileDir: process.cwd(),
modulesCacheMaxAge: 0,
pruneLockfileImporters: false,
}))
await projects['project-1'].has('is-positive')
@@ -313,10 +314,12 @@ test('dependencies of other importers are not pruned when (headless) installing
dir: path.resolve('project-1'),
lockfileDir: process.cwd(),
lockfileOnly: true,
pruneLockfileImporters: false,
}))
await mutateModules(importers.slice(0, 1), await testDefaults({
frozenLockfile: true,
modulesCacheMaxAge: 0,
pruneLockfileImporters: false,
}))
await projects['project-1'].has('is-positive')

View File

@@ -842,7 +842,12 @@ test('lockfile file has correct format when lockfile directory does not equal th
process.chdir('project-2')
await addDependenciesToPackage(manifest, ['is-positive'], await testDefaults({ save: true, lockfileDir: path.resolve('..'), storeDir }))
await addDependenciesToPackage(manifest, ['is-positive'], await testDefaults({
save: true,
lockfileDir: path.resolve('..'),
storeDir,
pruneLockfileImporters: false,
}))
{
const lockfile = await readYamlFile<Lockfile>(path.join('..', WANTED_LOCKFILE))

View File

@@ -317,6 +317,7 @@ test('uninstalling a dependency from package that uses shared lockfile', async (
], await testDefaults({
lockfileDir: process.cwd(),
store,
pruneLockfileImporters: false,
}))
await projects['project-1'].hasNot('is-positive')