Prevent Renovate from rewriting pnpm peer catalog ranges#1568
Conversation
Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
There was a problem hiding this comment.
Pull request overview
Updates repo-level Renovate configuration to prevent automated edits to pnpm’s peer catalog ranges, which are intentionally curated to reflect consumer-supported peer ranges rather than the workspace’s pinned versions.
Changes:
- Disable Renovate updates for the
pnpm.catalog.peerdepType via a repo-levelpackageRulesentry. - Document the “peer catalog is manually curated and must not be rewritten” policy in
AGENTS.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
AGENTS.md |
Documents that catalogs.peer ranges are intentionally wider and that Renovate is configured to never rewrite them. |
.github/renovate.json |
Adds a packageRules entry disabling Renovate for matchDepTypes: ["pnpm.catalog.peer"]. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
Renovate keeps rewriting the manually curated ranges in the
catalogs.peersection ofpnpm-workspace.yaml— #1566 bumpsstyled-components: ^6.1to^6.4.3, and #1564 (closed unmerged) rewrotereact/react-domfrom^19.2to^19.2.7. Those ranges are intentionally wider than the default catalog: they declare what consumers may use, so they must only change through deliberate, manual edits.This happens because the shared
github>sanity-io/renovate-config:strategypreset only appliesrangeStrategy: widento thepeerDependenciesdepType, while pnpm catalog entries get the dynamic depTypepnpm.catalog.peer— which falls through to the defaultrangeStrategy: bump.Fix
Add a
packageRulesentry to.github/renovate.jsonthat disables Renovate entirely formatchDepTypes: ["pnpm.catalog.peer"]. Repo-levelpackageRulesare appended after preset rules, so this rule wins. The default catalog (pnpm.catalog.default) is unaffected.Once this lands on
main(Renovate reads config from the default branch), the next Renovate run should autoclose #1566 since its update is no longer wanted. It also stops #1564 from coming back: closing that PR only ignored the exact^19.2.7update, so Renovate would have opened a fresh PR for the next react patch release — now peer-catalog entries are skipped entirely.Also documents the policy in the
peercatalog section ofAGENTS.md.Verification
Ran
renovate --platform=localdry runs against this repo with the old and new config (comparison below): before, thereact,react-dom(= #1564), andstyled-components(= #1566) peer entries would be rewritten; after, all four peer entries reportskipReason: "disabled", and the only branches dropped from Renovate's plan are the two peer-catalog-only ones (renovate/styled-components-6.x,renovate/react-monorepo) — the other 66 branches are untouched.Renovate dry-run before/after comparison
renovate-config-validator .github/renovate.jsonrenovate --platform=localdry run before/after comparisonpnpm formatpnpm lintpnpm knippnpm buildpnpm test run --changed origin/main(no affected packages — config/docs only, so no changeset needed)To show artifacts inline, enable in settings.