feat: install config dependencies into the global virtual store#10910
Merged
feat: install config dependencies into the global virtual store#10910
Conversation
Config dependencies are now imported into {storeDir}/links/ following the
same path convention as regular packages (@scope/name/version/hash), then
symlinked into node_modules/.pnpm-config/. When the package already exists
in the GVS, the fetch and import are skipped entirely.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes how pnpm installs configuration dependencies (config deps). Instead of importing config deps directly into the local node_modules/.pnpm-config/ directory, they are now first imported into the global virtual store at {storeDir}/links/ using the same path hash convention as regular GVS packages, and then symlinked into the local node_modules/.pnpm-config/. This allows config dependencies to be shared across projects using the same store, avoiding redundant fetches and imports.
Changes:
- Config deps are imported into
{storeDir}/links/using GVS-compatible hashing, with afs.existsSynccheck to skip fetch/import when already present, and then symlinked locally viasymlink-dir - Added
@pnpm/crypto.object-hasherandsymlink-diras dependencies of@pnpm/config.deps-installer; addedstoreDirto theInstallConfigDepsOptsinterface and propagated it through all callers - Updated tests to pass
storeDir, verify symlink creation, and adjusted the E2E patch path assertion from exact match totoContainsince patch paths now resolve through the GVS
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
config/deps-installer/src/installConfigDeps.ts |
Core implementation: GVS import + symlink logic, calcConfigDepGlobalDir hash function, storeDir added to opts |
config/deps-installer/package.json |
Added @pnpm/crypto.object-hasher and symlink-dir dependencies |
config/deps-installer/tsconfig.json |
Added crypto/object-hasher project reference |
config/deps-installer/test/installConfigDeps.ts |
Updated tests to pass storeDir, added symlink assertion |
config/deps-installer/test/resolveConfigDeps.test.ts |
Updated test to use real storeDir from createTempStore |
cli/cli-utils/src/getConfig.ts |
Pass storeDir to installConfigDeps |
pkg-manager/plugin-commands-installation/src/add.ts |
Pass storeDir to resolveConfigDeps |
pnpm/test/configurationalDependencies.test.ts |
Relaxed patch path assertion to toContain for GVS paths |
pnpm-lock.yaml |
Lockfile updates for new dependencies |
.changeset/config-deps-global-virtual-store.md |
Changeset describing the minor feature |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move the leaf node hash computation from config deps-installer into calcLeafGlobalVirtualStorePath in @pnpm/calc-dep-state to avoid duplicating the hash logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{storeDir}/links/following the same@scope/name/version/hashpath convention as regular GVS packages, then symlinked intonode_modules/.pnpm-config/@pnpm/crypto.object-hasherandsymlink-diras dependencies of@pnpm/config.deps-installerTest plan
installConfigDepspass (symlink created, version update works, removal works)resolveConfigDepspasspnpm add --config)🤖 Generated with Claude Code