Set pnpm catalogMode to strict#27902
Conversation
- default catalogMode is manual, so `pnpm add` ignores catalog entries and drift goes uncaught - strict rejects `pnpm add foo@x.y.z` when the requested range falls outside the catalog entry, forcing either a deliberate catalog update or a `catalog:` reference in package.json - bare `pnpm add foo` still resolves to the catalog entry, so the common case is unchanged
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR adds Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27902 +/- ##
=======================================
Coverage 73.84% 73.84%
=======================================
Files 1520 1520
Lines 128308 128308
Branches 15383 15383
=======================================
Hits 94748 94748
Misses 32603 32603
Partials 957 957
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Sets
catalogMode: strictinpnpm-workspace.yamlso thatpnpm addcannot silently introduce versions that conflict with the catalog.Behavior
pnpm add foo(no version) — resolves to the catalog entry when one exists, otherwise normal install. Unchanged for the common case.pnpm add foo@x.y.zwhere the range falls outside the catalog entry — fails withERR_PNPM_CATALOG_VERSION_MISMATCH, forcing either a deliberate catalog update or acatalog:reference.pnpm installon the existing tree — unaffected; verified locally, completes in <2s with no lockfile churn.Why
Default
catalogModeismanual, which means the catalog only takes effect when a package.json explicitly says"foo": "catalog:". Anything added viapnpm addbypasses the catalog entirely, which is how the duplication we've been unwinding crept in.strictenforces the policy at the point of entry without changing anything about the existing tree.Test plan