Skip to content

[rush] Resolve pnpm catalogs in injected cross-subspace deps - #6198

Open
Bharat Middha (bmiddha) wants to merge 1 commit into
mainfrom
bmiddha-resolve-catalogs-in-injected-deps-e21
Open

Bharat Middha (bmiddha) wants to merge 1 commit into
mainfrom
bmiddha-resolve-catalogs-in-injected-deps-e21

Conversation

@bmiddha

Copy link
Copy Markdown
Member

Summary

When a project depends on an injected workspace project from another subspace, PNPM installs it as an external package and does not resolve its catalog: references. That breaks installs and makes version-consistency checks report mismatches for repos that combine subspaces, injected dependencies and catalogs.

Details

  • The subspace global pnpmfile shim now replaces catalog: / catalog:<name> references in injected cross-subspace projects with versions from that project's own subspace catalogs.
  • Subspace resolves the catalog-specified versions it uses for the injected dependencies hash, so catalog edits in the provider subspace trigger a reinstall.
  • SubspacePnpmfileConfiguration passes each injected project's subspace catalogs to the shim settings (IPnpmfile.ts).
  • Projects with no catalog references are unaffected.

How it was tested

  • heft build --production in libraries/rush-lib: passed with no warnings and no API report changes.
  • heft test --production --test-path-pattern 'api/test/Subspace\.test|SubspaceGlobalPnpmfileShim\.test|SubspacePnpmfileConfiguration\.test': passed (18/18), including new tests that use the repoWithInjectedSubspaceCatalogs fixture.
  • rush change --verify: passed.

PNPM resolves `catalog:` only for its own workspace importers. Projects
injected from another subspace are installed as external packages, so
the subspace pnpmfile shim now replaces their catalog references with
entries from their own subspace's catalogs. The injected dependencies
hash uses the resolved versions so catalog edits trigger a reinstall.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant