feat(core): pruneLockfileImporters is true by default

This commit is contained in:
Zoltan Kochan committed 2022-03-16 23:46:39 +02:00
1 parent f332202030
commit a36b6026bb
5 files changed
+16 -2

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@pnpm/core": major
---
pruneLockfileImporters is true by default.
@@ -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,
@@ -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')
+6 -1
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))
+1
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')