Files
pnpm/workspace
Abdullah Alaqeel 97e1982d28 fix: detect enableGlobalVirtualStore toggle in workspace state check (#12147)
* fix: detect enableGlobalVirtualStore toggle in workspace state check (#12142)

The optimisticRepeatInstall fast path bypasses validateModules entirely,
so toggling enableGlobalVirtualStore off was not detected — pnpm printed
"Already up to date" without reinstalling deps in the new virtual store
location.

Add enableGlobalVirtualStore to WORKSPACE_STATE_SETTING_KEYS so
checkDepsStatus detects the change and falls through to the full
mutateModules path (which includes the virtualStoreDir compatibility
check and purge).

* refactor: bidirectional settings comparison in checkDepsStatus

Iterate over WORKSPACE_STATE_SETTING_KEYS instead of
Object.entries(workspaceState.settings) so that settings absent from
legacy state files (e.g. enableGlobalVirtualStore) are still compared
against the current config. Removes the ad-hoc allowBuilds null-check
block since the main loop now covers it with the ?? {} coalescing.

* fix(workspace-state): track enableGlobalVirtualStore in pacquet state

Port pnpm/pnpm#12147 to pacquet. pnpm's checkDepsStatus now iterates the
full WORKSPACE_STATE_SETTING_KEYS list, so a key pacquet omits from
.pnpm-workspace-state-v1.json is read as `undefined` and compared
against pnpm's resolved config. `enableGlobalVirtualStore` resolves to a
concrete default (true, or false under CI), so omitting it would make
pnpm reinstall after a pacquet install — and pacquet itself never
detected the toggle (its own copy of pnpm/pnpm#12142).

Add `enable_global_virtual_store` to WorkspaceStateSettings;
current_settings writes `then_some(true)` (omit when off, mirroring
pnpm omitting its undefined default); settings_match coerces
`None`/`Some(false)` as equal before comparing, matching the existing
allow_builds/package_extensions handling.

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2026-06-08 17:15:49 +02:00
..
2026-06-05 08:27:41 +02:00
2026-04-30 23:03:46 +02:00
2026-04-30 23:03:46 +02:00