You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lockfile freshness ignores catalog edits for catalog-sourced peers #310
That PR resolves the catalog: ranges of a package's taken peers before merging, so a catalog: peer declared by a file: dependency is now auto-installed in pnpm v11. Before it, pnpm v11 left that peer missing. pnpm v12 already resolved catalog peers this way.
The lockfile does not record that the peer came from a catalog:
getCatalogSnapshots records only direct dependencies resolved through catalog:.
The consumer's snapshot keeps the raw catalog: peer range.
As a result, after the catalog entry changes (for example ^1.0.0 to ^2.0.0), pnpm install treats the lockfile as up to date and keeps the old version.
Reproduction in the v11 installer tests: a file:consumer that declares peerDependencies: { "@pnpm.e2e/peer-c": "catalog:" }, with autoInstallPeers: true. Install with catalogs.default["@pnpm.e2e/peer-c"] = "^1.0.0", then with "^2.0.0". @pnpm.e2e/[email protected] stays locked.
Not verified: whether pnpm v12 has the same gap. It resolves taken catalog peers in extract_peer_dependencies, so it likely does.
Possible directions:
Record catalog-sourced peers in the lockfile catalogs section, or
Include the resolved catalog ranges of peers in the up-to-date check.
Written by an agent (Claude Code, claude-opus-5-5).
Checked the v12 question in this task against released 12.23.0. The gap does not reproduce there.
Fixture: a workspace with packages/file-consumer declaring peerDependencies: {"is-number": "catalog:"} and packages/consumer depending on file:../file-consumer, default catalog is-number: ^7.0.0, default autoInstallPeers. The first install locks [email protected] and records catalogs.default.is-number: {specifier: ^7.0.0, version: 7.0.0}. Changing the catalog to ^6.0.0 and reinstalling re-resolves the taken peer: + is-number 6.0.0 (7.0.0 is available), with the importer and the catalogs section both at 6.0.0.
So v12 decides freshness from the recorded catalog snapshot and refreshes the peer. The remaining half appears to be the v11 lockfile, which does not record that the peer came from a catalog. I did not run the v11 scenario.
Written by an agent (Claude Code, deepseek-v4.1-flash-mb).
Activity
fix(lockfile): refresh local peers from catalogs (#18129)
fix: resolve catalog peers of local file dependencies (#18386)
BlueX888 commentedon Nov 24, 2026
Checked the v12 question in this task against released 12.23.0. The gap does not reproduce there.
Fixture: a workspace with
packages/file-consumerdeclaringpeerDependencies: {"is-number": "catalog:"}andpackages/consumerdepending onfile:../file-consumer, default catalogis-number: ^7.0.0, defaultautoInstallPeers. The first install locks[email protected]and recordscatalogs.default.is-number: {specifier: ^7.0.0, version: 7.0.0}. Changing the catalog to^6.0.0and reinstalling re-resolves the taken peer:+ is-number 6.0.0 (7.0.0 is available), with the importer and the catalogs section both at 6.0.0.So v12 decides freshness from the recorded catalog snapshot and refreshes the peer. The remaining half appears to be the v11 lockfile, which does not record that the peer came from a catalog. I did not run the v11 scenario.
Written by an agent (Claude Code, deepseek-v4.1-flash-mb).