You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
store prune: find the installed lockfiles of dedicated-lockfile projects and per-project modulesDir #214
Follow-up to pnpm/pnpm#17327, which makes pnpm store prune keep the store files of packages that a registered project's installed lockfile lists, even when they were copied or cloned into node_modules.
That collector finds each project's installed lockfile under the modulesDir set in <registered dir>/pnpm-workspace.yaml. Workspaces with dedicated lockfiles (sharedWorkspaceLockfile: false) are not covered:
pnpm 12 registers only the workspace root (pnpm/crates/package-manager/src/install/run/fast_path.rs), so a project's own <modulesDir>/.pnpm/lock.yaml is never read.
pnpm 11 registers each project's lockfileDir (pnpm11/installing/context/src/index.ts, prepareStoreDir), but that directory has no pnpm-workspace.yaml, so the workspace-level modulesDir is not seen.
Neither stack applies packageConfigs.<project>.modulesDir, which an install resolves through createProjectModulesDirResolver (pnpm 11) and Config::anchor_dedicated_project (pnpm 12).
For these projects the prune falls back to the hard-link count, as it did before pnpm/pnpm#17327, so their copied, cloned, patched, and built packages can still be removed.
A complete fix needs the registered project to point at its effective modules directory, or the prune to resolve the workspace config and packageConfigs the way install does, in both stacks. Recording the effective modulesDir in the project registry would also let the global virtual store prune, which looks only at node_modules, find these projects.
Written by an agent (Claude Code, claude-opus-5-5).
pnpm/pnpm#17327 now reads modulesDir from the nearest pnpm-workspace.yaml at or above the registered directory (commit 31912dcb28b9782678fec8ca88de3f88c9f47398), so a pnpm 11 member registered on its own gets the workspace-level modulesDir. What remains: packageConfigs.<project>.modulesDir in both stacks, and pnpm 12 registering only the workspace root.
Written by an agent (Claude Code, claude-opus-5-5).
pnpm/pnpm#17379 makes store prune apply packageConfigs.<project>.modulesDir in both stacks. It applies the entry only when the workspace does not share one lockfile, which matches the install.
The first point no longer holds. A pnpm 12 install with sharedWorkspaceLockfile: false registers each project as well as the root, as pnpm 11 does. I checked this with a debug build, so registration stays unchanged.
Out of scope: the global virtual store prune still looks only under directories named node_modules.
Written by an agent (Claude Code, claude-opus-5-5).
Activity
zkochan commentedon Oct 26, 2026
pnpm/pnpm#17327 now reads
modulesDirfrom the nearestpnpm-workspace.yamlat or above the registered directory (commit 31912dcb28b9782678fec8ca88de3f88c9f47398), so a pnpm 11 member registered on its own gets the workspace-levelmodulesDir. What remains:packageConfigs.<project>.modulesDirin both stacks, and pnpm 12 registering only the workspace root.Written by an agent (Claude Code, claude-opus-5-5).
zkochan commentedon Oct 26, 2026
pnpm/pnpm#17379 makes
store pruneapplypackageConfigs.<project>.modulesDirin both stacks. It applies the entry only when the workspace does not share one lockfile, which matches the install.The first point no longer holds. A pnpm 12 install with
sharedWorkspaceLockfile: falseregisters each project as well as the root, as pnpm 11 does. I checked this with a debug build, so registration stays unchanged.Out of scope: the global virtual store prune still looks only under directories named
node_modules.Written by an agent (Claude Code, claude-opus-5-5).
fix(store): apply packageConfigs modulesDir when pruning (pnpm#17379)