Preserve catalog: specifiers for pnpm isolates - #200
Conversation
When isolating a pnpm workspace package that uses "catalog:" dependency specifiers, the adapted manifest had its "catalog:" refs resolved to concrete versions while the generated lockfile importers kept "catalog:". This desync made `pnpm install --frozen-lockfile` fail with ERR_PNPM_OUTDATED_LOCKFILE, breaking deploys (e.g. Firebase). For pnpm (non-forceNpm) the isolated output is itself a workspace and keeps pnpm-workspace.yaml with its catalog definitions, so "catalog:" should be preserved verbatim, exactly like "workspace:*". Catalog resolution is now skipped for pnpm and only applied for bun, npm, yarn, and forceNpm, where the catalog is not available in the output. Pruning also drops the lockfile "catalogs" snapshot, so it is restored after pruning, narrowed to the entries referenced by the retained importers to mirror what pnpm itself writes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR adds pnpm catalog specifier preservation for isolated packages that remain pnpm workspaces. It restores catalog snapshot metadata to pnpm v9 lockfiles after pruning and conditionally resolves catalog specifiers in package manifests. For pnpm workspace outputs (pnpm without 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |

When isolating a pnpm workspace package that uses
catalog:dependency specifiers, the adapted manifest had itscatalog:refs resolved to concrete versions while the generated lockfile importers keptcatalog:. This desync madepnpm install --frozen-lockfilefail withERR_PNPM_OUTDATED_LOCKFILE(specifiers in the lockfile don't match specifiers in package.json), breaking deploys such as Firebase where frozen installs are the default.For pnpm (non-
forceNpm) the isolated output is itself a workspace and keepspnpm-workspace.yamlwith its catalog definitions, socatalog:specifiers can be preserved verbatim, exactly likeworkspace:*already is. Catalog resolution is therefore skipped for pnpm and only applied for bun, npm, yarn, andforceNpm, where the catalog is not available in the isolated output.Pruning the lockfile also dropped the
catalogssnapshot (the same way it dropsoverrides), so the manifest and lockfile were inconsistent even when specifiers matched. The snapshot is now restored after pruning, narrowed to the entries referenced by the retained importers to mirror what pnpm itself writes, so catalog entries belonging to unrelated workspace packages do not leak into the output.Closes #198
Scope: packages (isolate-package)
Visibility: user-facing