Skip to content

feat: install config dependencies into the global virtual store#10910

Merged
zkochan merged 3 commits intomainfrom
config-deps-gvs
Mar 8, 2026
Merged

feat: install config dependencies into the global virtual store#10910
zkochan merged 3 commits intomainfrom
config-deps-gvs

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Mar 8, 2026

Summary

  • Config dependencies are now imported into {storeDir}/links/ following the same @scope/name/version/hash path convention as regular GVS packages, then symlinked into node_modules/.pnpm-config/
  • When the package already exists in the GVS, the fetch and import are skipped entirely — only the local symlink is created
  • Added @pnpm/crypto.object-hasher and symlink-dir as dependencies of @pnpm/config.deps-installer

Test plan

  • Unit tests for installConfigDeps pass (symlink created, version update works, removal works)
  • Unit tests for resolveConfigDeps pass
  • E2E tests for config dependencies pass (patches applied, updateConfig hook, catalogs, pnpm add --config)
  • E2E hooks tests pass (config dep pnpmfile loading through symlink)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 8, 2026 12:09
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 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 a fs.existsSync check to skip fetch/import when already present, and then symlinked locally via symlink-dir
  • Added @pnpm/crypto.object-hasher and symlink-dir as dependencies of @pnpm/config.deps-installer; added storeDir to the InstallConfigDepsOpts interface and propagated it through all callers
  • Updated tests to pass storeDir, verify symlink creation, and adjusted the E2E patch path assertion from exact match to toContain since 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.

zkochan and others added 2 commits March 8, 2026 13:20
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>
@zkochan zkochan added this to the v11.0 milestone Mar 8, 2026
@zkochan zkochan merged commit 821b36a into main Mar 8, 2026
13 checks passed
@zkochan zkochan deleted the config-deps-gvs branch March 8, 2026 12:49
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