mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-06 23:19:19 -04:00
fix: don't remove importers from current lockfile
When doing some operations on a subset of workspace packages, do not remove the not selected packages from the current lockfile (node_modules/.pnpm-lock.yaml)
This commit is contained in:
@@ -286,7 +286,7 @@ export default async function linkPackages (
|
||||
const importers = importerIds.reduce((acc, importerId) => {
|
||||
acc[importerId] = newWantedLockfile.importers[importerId]
|
||||
return acc
|
||||
}, {})
|
||||
}, opts.currentLockfile.importers)
|
||||
currentLockfile = { ...newWantedLockfile, packages, importers }
|
||||
} else if (
|
||||
opts.include.dependencies &&
|
||||
|
||||
@@ -123,6 +123,7 @@ test('dependencies of other importers are not pruned when installing for a subse
|
||||
await rootNodeModules.has('.localhost+4873/is-negative/1.0.0')
|
||||
|
||||
const lockfile = await rootNodeModules.readCurrentLockfile()
|
||||
t.deepEqual(Object.keys(lockfile.importers), ['project-1', 'project-2'])
|
||||
t.deepEqual(Object.keys(lockfile.packages), [
|
||||
'/is-negative/1.0.0',
|
||||
'/is-positive/2.0.0',
|
||||
|
||||
Reference in New Issue
Block a user