Skip to content

fix(rush): synchronize native pnpm injections from the installed layout - #6133

Merged
Bharat Middha (bmiddha) merged 2 commits into
mainfrom
bmiddha/pnpm12-injected-sync
Oct 20, 2026
Merged

Bharat Middha (bmiddha) merged 2 commits into
mainfrom
bmiddha/pnpm12-injected-sync

Conversation

@bmiddha

Copy link
Copy Markdown
Member

Stacked on #6131. The review base is bmiddha/pnpm12-native-compat.

Summary

  • Prepare pnpm 12 injected-dependency synchronization from the installed .modules.yaml target map instead of parsing the native lockfile with an older pnpm kit or reconstructing virtual-store names.
  • Preserve peer-variant destinations and per-subspace mappings through the existing pnpm-sync-lib update/copy API.
  • Validate the installed layout, exact manager identity, registered source projects, package names, and materialized target containment before writing any sync descriptors.
  • Keep the existing preparation path for earlier pnpm versions.

Validation

The rebased source passed the normal dependency build, TypeScript, ESLint, API Extractor, Webpack, and 27 focused tests across BaseInstallManager, PnpmSyncUtilities, and PnpmfileConfiguration.

This is support-only: it does not change this repository's package-manager pin, bypass install policies, or claim to fix pnpm's separate external-root frozen-install behavior.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Removed injections can leave stale current-subspace destinations in existing sync descriptors.

1 open finding
What changed in this PR

Adds pnpm 12 injected-dependency synchronization using the installed .modules.yaml layout.

Changes:

  • Validates pnpm’s installed layout and sync destinations.
  • Preserves peer variants and subspace mappings.
  • Adds focused synchronization tests and a change entry.
File Description
BaseInstallManager.ts Selects installed-layout synchronization for pnpm 12+.
PnpmSyncUtilities.ts Parses, validates, and records installed injection targets.
PnpmSyncUtilities.test.ts Tests layout validation and mapping behavior.
pnpm12-injected-layout-sync_2026-10-12-22-00.json Records the Rush patch.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libraries/rush-lib/src/utilities/PnpmSyncUtilities.ts Outdated
Comment thread libraries/rush-lib/src/utilities/PnpmSyncUtilities.ts Outdated
Comment thread libraries/rush-lib/src/utilities/PnpmSyncUtilities.ts Outdated
Use the installed injectedDeps target map with the existing pnpm-sync update/copy API. Validate the layout, manager identity, registered sources and materialized destinations before writing descriptors. Preserve the existing preparation path for earlier pnpm versions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bedb50cb-fcd4-4dc4-83b9-dba6064e5498
Sources dropped from injectedDeps now get an empty target list so their
stale lockfile entries are removed. Validation runs in parallel and the
virtual-store realpath is resolved once.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Compatibility with real native pnpm metadata and cross-subspace synchronization needs human confirmation beyond the synthetic fixtures.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@bmiddha
Bharat Middha (bmiddha) merged commit 338c591 into main Oct 20, 2026
11 checks passed
@bmiddha
Bharat Middha (bmiddha) deleted the bmiddha/pnpm12-injected-sync branch October 20, 2026 21:13
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

4 participants