Skip to content

feat: use global virtual store for global packages and dlx#10694

Merged
zkochan merged 4 commits intomainfrom
global-install
Mar 1, 2026
Merged

feat: use global virtual store for global packages and dlx#10694
zkochan merged 4 commits intomainfrom
global-install

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Feb 26, 2026

Summary

Global installs (pnpm add -g) and pnpm dlx now use the global virtual store by default. Instead of creating a .pnpm directory inside each install location, packages are stored in the content-addressable store and hard-linked from {storeDir}/links. This makes global installs and dlx faster when packages share common dependencies, as they are deduplicated through the store.

Changes

  • config: Enable enableGlobalVirtualStore by default for global installs. When disabled, the standard node_modules/.pnpm layout is used instead of hardcoding .pnpm.
  • dlx: Pass enableGlobalVirtualStore through to the add handler so dlx also benefits from the virtual store.
  • tests: Explicitly set enableGlobalVirtualStore: false in dlx tests that rely on the non-virtual-store layout.

Opt out

Run pnpm config set enableGlobalVirtualStore false to use the previous behavior. This is also automatically disabled in CI environments, where there is no warm cache to benefit from.

Copilot AI review requested due to automatic review settings February 26, 2026 00:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces support for using a global virtual store for global package installations (pnpm install -g) and pnpm dlx commands. Previously, these operations created .pnpm directories in individual project locations. With this change, packages are now stored centrally at {storeDir}/links by default, improving performance and reducing disk space usage across multiple dlx invocations and global installs.

Changes:

  • Global installs and dlx now default to using the global virtual store (stored at {storeDir}/links)
  • Added enableGlobalVirtualStore configuration option that can be set to false to revert to the old behavior
  • CI environments automatically disable the global virtual store since there's no benefit from a warm cache

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
config/config/src/index.ts Implements logic to set enableGlobalVirtualStore to true by default for global installs, and conditionally sets virtualStoreDir to .pnpm when the global virtual store is disabled
exec/plugin-commands-script-runners/src/dlx.ts Updates dlx handler to default enableGlobalVirtualStore to true when not explicitly set
exec/plugin-commands-script-runners/test/dlx.e2e.ts Updates tests that verify build script behavior to explicitly disable the global virtual store, as they check for files in specific .pnpm paths
.changeset/global-install-virtual-store.md Documents the feature change for the changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

zkochan and others added 3 commits March 1, 2026 17:07
…nstalls

When the global virtual store is disabled, the default `node_modules/.pnpm`
path works fine — no need to explicitly override it to `.pnpm`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zkochan zkochan merged commit 543c7e4 into main Mar 1, 2026
13 checks passed
@zkochan zkochan deleted the global-install branch March 1, 2026 17:03
@zkochan zkochan added this to the v11.0 milestone Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants