Skip to content

feat: deprecate $ version references in overrides#12262

Merged
zkochan merged 1 commit into
mainfrom
deprecate-dollar-overrides
Jun 8, 2026
Merged

feat: deprecate $ version references in overrides#12262
zkochan merged 1 commit into
mainfrom
deprecate-dollar-overrides

Conversation

@zkochan

@zkochan zkochan commented Jun 8, 2026

Copy link
Copy Markdown
Member

What

Using the $ version reference syntax in overrides (e.g. "react": "$react") now prints a deprecation warning. The syntax still resolves exactly as before — this only adds a warning that nudges users toward catalogs.

The "$" version reference syntax in overrides is deprecated (used by: react). Define the version in a catalog and reference it with the "catalog:" protocol instead. See https://pnpm.io/catalogs

Why

The $react syntax resolves the override against the root manifest's direct dependencies. This makes it fragile — for example, pnpm fetch with a minimal package.json (only packageManager) crashes with ERR_PNPM_CANNOT_RESOLVE_OVERRIDE_VERSION, even though the lockfile already has everything (#12160).

Catalogs cover the same "maintain the version in one place" use case without that fragility: a catalog: reference is self-contained (the version lives in the catalog, not in the direct deps), and catalogs are already supported inside overrides. The plan is deprecate now, remove in a future major.

Changes

  • @pnpm/config.reader: emit a globalWarn when any override value uses the $ syntax (in getOptionsFromRootManifest.ts). Resolution behavior is unchanged.
  • Tests covering the warning and the no-warning case.
  • Changeset (patch).

Docs were updated separately in the pnpm.io repo (the overrides section now documents the catalog: approach instead of $).

Parity note (pacquet)

No pacquet-side change is needed: pacquet's config-parse-overrides does not implement $ version-reference resolution at all yet, so there is nothing to deprecate there. When pacquet ports the $ syntax, this deprecation warning should be ported alongside it.

Follow-ups (not in this PR)


Written by an agent (Claude Code, claude-opus-4-8).

Summary by CodeRabbit

Release Notes

  • Documentation

    • Documented deprecation of $ version reference syntax in pnpm overrides; users are encouraged to adopt catalog: protocol instead for maintaining synchronized override versions.
  • New Features

    • System now emits warnings when deprecated $ syntax is detected in overrides, guiding users toward the recommended migration path.

Using the "$" syntax in overrides (e.g. "react": "$react") now emits a
deprecation warning. The syntax still resolves as before. Catalogs are the
recommended replacement: reference a catalog entry with the "catalog:"
protocol.

Refs #12160
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4365b54e-869c-4b47-b37b-8955c954b110

📥 Commits

Reviewing files that changed from the base of the PR and between 29a496a and f37da2c.

📒 Files selected for processing (3)
  • .changeset/dollar-overrides-deprecation.md
  • config/reader/src/getOptionsFromRootManifest.ts
  • config/reader/test/deprecatedVersionReferences.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ubuntu-latest / Node.js 24 / Test
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (relying on hoisting), limit functions to no more than two or three arguments, and use a single options object for functions needing more parameters
Follow import order: standard libraries first, then external dependencies (sorted alphabetically), then relative imports
Do not write comments that restate what the code already says; rename variables, split helpers, or move checks to more obvious places instead
Do not repeat documentation at call sites that already lives on the callee; update the JSDoc once and let every call site benefit
Use JSDoc for the function's contract (preconditions, postconditions, edge cases, why the function exists), not for re-narrating the function body
Do not record past implementation shape, refactor history, or removed code in comments; use git log and git blame for that information instead
Write comments only when the reason for code is non-obvious, a hidden invariant exists, a workaround for a known bug is needed, or an exception to surrounding pattern is deliberate

Files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • config/reader/src/getOptionsFromRootManifest.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not use instanceof Error for checking if a caught error is an Error object in Jest tests; use util.types.isNativeError() instead to work across realms

Files:

  • config/reader/test/deprecatedVersionReferences.test.ts
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-06T22:48:27.363Z
Learning: Keep pnpm and pacquet in sync — any user-visible change (CLI flags, defaults, environment-variable handling, lockfile/manifest/state-file format, error codes and messages, log emissions, store layout, hook semantics) must land in both the TypeScript pnpm CLI and the Rust pacquet port in the same PR
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Reference the upstream pnpm commit/PR when porting code from pnpm in commit messages
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11915
File: pacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs:553-617
Timestamp: 2026-05-24T21:11:04.272Z
Learning: In pacquet (pnpm/pnpm repo), `ResolvedPackage.optional` AND-folding intentionally mirrors pnpm's resolveDependencies.ts:1627-1648 revisit behavior: only the directly-visited package's `optional` flag is updated on revisit, not transitive descendants. pnpm CLI corrects stale optional flags via `copyDependencySubGraph` BFS in `lockfile/pruner/src/index.ts:160-205`. Pacquet does not yet have this pruner equivalent, so raw `node.optional` flows directly into snapshot/virtual-store via `dependencies_graph_to_lockfile.rs:409` → `create_virtual_store.rs:762` → `installability.rs:394`. A follow-up issue to port `copyDependencySubGraph` is planned.
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Match how the same feature is implemented in the TypeScript pnpm CLI — any change in pacquet must match pnpm's behavior, logic, edge cases, config resolution, error messages, file/lockfile formats, and existing tests
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11915
File: pacquet/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs:553-617
Timestamp: 2026-05-24T21:11:04.272Z
Learning: In the pacquet Rust port (pnpm/pnpm repo), the `ResolvedPackage.optional` AND-folding on revisit intentionally mirrors pnpm's `resolveDependencies.ts:1627-1648` behavior: only the directly-revisited package's `optional` flag is updated; transitive descendants are not re-walked. pnpm CLI corrects stale optional flags downstream via `copyDependencySubGraph` BFS in `lockfile/pruner/src/index.ts:160-205`, which tracks a `nonOptional` set and re-stamps any package reachable by an all-non-optional path. Pacquet does not yet have this pruner equivalent, so the stale flags flow directly through `dependencies_graph_to_lockfile.rs:409` → `create_virtual_store.rs:762` → `installability.rs:394`. A follow-up to port `copyDependencySubGraph` is planned; until then, do not flag the resolver-layer optional propagation gap as a bug in pacquet PRs — it is intentional parity with pnpm's resolver layer.
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-06T22:48:27.363Z
Learning: Always explicitly include `pnpm` in changesets with the appropriate version bump; the pnpm CLI only receives automatic patch bumps from dependencies, so minor or major bumps must be specified explicitly
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Do not change lockfile format, store layout, `.npmrc` semantics, or CLI surface unless pnpm changed them first
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Do not add features, flags, or behaviors that pnpm does not have
📚 Learning: 2026-06-05T13:47:05.929Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/test/install/frozenStore.ts:2-17
Timestamp: 2026-06-05T13:47:05.929Z
Learning: In the pnpm/pnpm repository, the shared Jest preset keeps `injectGlobals` at its default (`true`), so `test` and `expect` are available as Jest globals. Therefore, reviewers should not flag (or treat as TypeScript/compilation errors) missing `import { test, expect } from 'jest/globals'` when a test file uses `test`/`expect` without importing them. Importing from `jest/globals` may still be used for consistency with sibling files, but it is not required for execution in this repo unless a Jest preset is explicitly configured with `injectGlobals: false`.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
📚 Learning: 2026-05-29T18:03:15.372Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Match how the same feature is implemented in the TypeScript pnpm CLI — any change in pacquet must match pnpm's behavior, logic, edge cases, config resolution, error messages, file/lockfile formats, and existing tests

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • .changeset/dollar-overrides-deprecation.md
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-05-05T23:03:30.044Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11479
File: __utils__/scripts/package.json:6-9
Timestamp: 2026-05-05T23:03:30.044Z
Learning: In the pnpm/pnpm repository, the pattern `cross-env NODE_OPTIONS="$NODE_OPTIONS ..." jest` is an intentional, established convention used across many package.json files (e.g., `fs/hard-link-dir`, `worker`, `__utils__/scripts`). Do not flag this as a cross-platform issue in individual files; any fix should be applied repo-wide as a separate change.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • .changeset/dollar-overrides-deprecation.md
📚 Learning: 2026-05-20T21:18:56.391Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11778
File: pacquet/crates/resolving-local-resolver/tests/resolve.rs:365-372
Timestamp: 2026-05-20T21:18:56.391Z
Learning: In `pacquet/crates/resolving-local-resolver/tests/resolve.rs`, the test `fail_when_resolving_from_not_existing_directory_an_injected_dependency` intentionally uses `injected: false`. The test is a verbatim port of the upstream pnpm TypeScript test (resolving/local-resolver/test/index.ts at ef87f3ccff). The `injected` flag only affects the file/link protocol choice for plain directory paths; when the `file:` scheme is explicit in the bare specifier, the flag has no effect on the resolution code path. The misleading test name is inherited from upstream.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
📚 Learning: 2026-05-29T18:03:15.372Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Applies to pacquet/**/tests/**/*.rs : Port relevant pnpm tests to Rust tests whenever they translate when porting behavior from pnpm

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
📚 Learning: 2026-05-24T08:18:06.019Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11895
File: pnpm/test/deploy.ts:91-95
Timestamp: 2026-05-24T08:18:06.019Z
Learning: In the pnpm/pnpm repository, integration tests that hit the real `registry.npmjs.org` (e.g., for `pacquet` or `pnpm/pacquet`) do NOT use a runtime env-var gate (such as `PNPM_RUN_PUBLIC_REGISTRY_TESTS`). They simply pass `--config.registry=https://registry.npmjs.org/` directly to `execPnpm` and set a higher timeout. This is the established pattern, as seen in `pnpm/test/install/pacquet.ts` and `pnpm/test/deploy.ts`. Do not suggest adding env-var guards for these tests.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
📚 Learning: 2026-05-15T11:37:17.491Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11526
File: config/reader/src/loadNpmrcFiles.ts:189-195
Timestamp: 2026-05-15T11:37:17.491Z
Learning: In pnpm/pnpm `config/reader/src/loadNpmrcFiles.ts`, the `resolveEnvValue` helper intentionally diverges from `pnpm/config.env-replace`'s strict path (which uses `hasOwnProperty`) by checking `env[varName] === undefined` instead. This is deliberate: the strict path only sees `process.env` (which never holds `undefined` values), whereas `resolveEnvValue` is also called from tests that model an unset variable as `{ KEY: undefined }`. Using `=== undefined` ensures that `${VAR-default}` falls back to `default` when the variable is present but set to `undefined`, consistent with the `Record<string, string | undefined>` public API contract.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-05-07T20:38:01.796Z
Learnt from: camcima
Repo: pnpm/pnpm PR: 11159
File: deps/compliance/license-checker/src/utils.ts:42-59
Timestamp: 2026-05-07T20:38:01.796Z
Learning: In `deps/compliance/license-checker/src/utils.ts`, `collectDirectDeps` intentionally uses name-only keys (not `nameversion`) for the shallow-depth filter. This is a deliberate design decision: being over-inclusive (auditing extra versions of a direct dep) is safer for compliance than being under-inclusive. Tightening to `nameversion` would require unsafe `(lockfile.packages as any)?.[ref]` casts through untyped lockfile internals. Do not flag this as a bug.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-05-29T18:03:15.372Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Applies to pacquet/**/*.rs : Log emissions are part of matching pnpm — when porting a function that fires `pnpm:<channel>` events through `globalLogger`, `logger.debug(...)`, or `streamParser.write(...)`, mirror the call site, payload, and ordering so `pnpm/cli.default-reporter` parses pacquet's NDJSON the same way

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-05-24T16:07:54.784Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11904
File: pacquet/crates/package-manager/src/install.rs:556-560
Timestamp: 2026-05-24T16:07:54.784Z
Learning: In pacquet's `is_modules_yaml_consistent` (pacquet/crates/package-manager/src/install.rs), `enableGlobalVirtualStore` is intentionally NOT checked as a separate field. Upstream pnpm's `validateModules.ts` does not persist or check `enableGlobalVirtualStore` in `.modules.yaml` either. Drift on this setting is caught indirectly: toggling `enableGlobalVirtualStore` changes `config.effective_virtual_store_dir()` (GVS-on → `<store>/v11/links`, GVS-off → `<project>/node_modules/.pnpm`), so the existing `modules.virtual_store_dir == config.effective_virtual_store_dir()` comparison in `is_modules_yaml_consistent` already detects the mismatch and prevents the short-circuit. Do not flag the absence of an explicit `enableGlobalVirtualStore` field as a bug.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
📚 Learning: 2026-06-06T22:48:27.363Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-06T22:48:27.363Z
Learning: Keep pnpm and pacquet in sync — any user-visible change (CLI flags, defaults, environment-variable handling, lockfile/manifest/state-file format, error codes and messages, log emissions, store layout, hook semantics) must land in both the TypeScript pnpm CLI and the Rust pacquet port in the same PR

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • .changeset/dollar-overrides-deprecation.md
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-05-14T09:04:00.133Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11622
File: resolving/npm-resolver/test/publishedBy.test.ts:350-354
Timestamp: 2026-05-14T09:04:00.133Z
Learning: In the pnpm/pnpm repository, ESLint is the authoritative style linter. Do not raise review findings for missing trailing commas in multiline function calls (e.g., `fs.writeFileSync(...)`) when this repo’s ESLint configuration does not report them and lint passes. Prefer deferring to the ESLint results for this specific trailing-comma rule rather than enforcing it manually in code review.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-06-05T13:47:26.046Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/src/install/index.ts:2337-2343
Timestamp: 2026-06-05T13:47:26.046Z
Learning: In the pnpm/pnpm codebase, `PnpmError` automatically prefixes `err.code` with `ERR_PNPM_` when you pass a code that does not already start with `ERR_PNPM_` (it normalizes `this.code` via `code.startsWith('ERR_PNPM_') ? code : `ERR_PNPM_${code}``). Therefore, during code review you should NOT flag `new PnpmError(...)` call sites for passing a bare error code (e.g., `new PnpmError('FROZEN_STORE_INCOMPATIBLE_WITH_PNPR', ...)`); the resulting `err.code` will still be `ERR_PNPM_FROZEN_STORE_INCOMPATIBLE_WITH_PNPR`.

Applied to files:

  • config/reader/test/deprecatedVersionReferences.test.ts
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-06-06T22:48:27.363Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-06T22:48:27.363Z
Learning: Always explicitly include `pnpm` in changesets with the appropriate version bump; the pnpm CLI only receives automatic patch bumps from dependencies, so minor or major bumps must be specified explicitly

Applied to files:

  • .changeset/dollar-overrides-deprecation.md
  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-05-29T18:03:15.372Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Do not change lockfile format, store layout, `.npmrc` semantics, or CLI surface unless pnpm changed them first

Applied to files:

  • .changeset/dollar-overrides-deprecation.md
📚 Learning: 2026-05-20T22:49:17.652Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11787
File: pacquet/crates/catalogs-resolver/src/lib.rs:156-167
Timestamp: 2026-05-20T22:49:17.652Z
Learning: In pacquet's `catalogs-resolver` crate (`pacquet/crates/catalogs-resolver/src/lib.rs`), the protocol detection pattern `catalog_lookup.split(':').next().unwrap_or("")` is an intentional byte-for-byte port of pnpm's upstream JavaScript `getProtocol`/split logic in `catalogs/resolver/src/resolveFromCatalog.ts#L95`. A bare value like `"workspace"` (without a colon) is deliberately classified as the `"workspace"` protocol, matching upstream behavior. pacquet's cardinal rule is to match upstream pnpm behavior including quirks; any behavioral change must land in pnpm first and then be ported here.

Applied to files:

  • .changeset/dollar-overrides-deprecation.md
📚 Learning: 2026-05-29T18:03:15.372Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Reference the upstream pnpm commit/PR when porting code from pnpm in commit messages

Applied to files:

  • .changeset/dollar-overrides-deprecation.md
📚 Learning: 2026-05-20T23:08:06.093Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11784
File: pacquet/crates/resolving-deps-resolver/src/hoist_peers.rs:120-133
Timestamp: 2026-05-20T23:08:06.093Z
Learning: Pacquet (pnpm's Rust port) has a cardinal rule: "match pnpm exactly — do not fix pnpm quirks unless the same fix has landed in pnpm first." Review comments should not suggest behavioral deviations from upstream pnpm, even when the upstream behavior appears buggy. If a real bug is identified, it must be fixed upstream first.

Applied to files:

  • .changeset/dollar-overrides-deprecation.md
📚 Learning: 2026-05-26T21:01:06.666Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11966
File: .changeset/require-tarball-integrity.md:6-6
Timestamp: 2026-05-26T21:01:06.666Z
Learning: In pnpm lockfile-related release notes/docs (especially changeset markdown), preserve URL hostnames exactly as they appear in pnpm-lock.yaml tarball resolution entries—keep hosts like `codeload.github.com`, `bitbucket.org`, and `gitlab.com` in lowercase. Do not “correct” them to title-case/preserve brand capitalization (e.g., LanguageTool rules like `GITHUB` capitalization) because these are literal URL fragments, not platform brand names.

Applied to files:

  • .changeset/dollar-overrides-deprecation.md
📚 Learning: 2026-05-29T18:03:15.372Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Do not add features, flags, or behaviors that pnpm does not have

Applied to files:

  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-06-05T13:47:05.929Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/test/install/frozenStore.ts:2-17
Timestamp: 2026-06-05T13:47:05.929Z
Learning: In the `pnpm/pnpm` repository, the shared Jest preset does NOT set `injectGlobals: false` (it defaults to `true`), so `test` and `expect` are available as globals without an explicit import. Adding `import { expect, test } from 'jest/globals'` is a convention-consistency practice to match sibling test files — it is not required for compilation or test execution. Do not flag missing `jest/globals` imports as compile errors in this repo.

Applied to files:

  • config/reader/src/getOptionsFromRootManifest.ts
📚 Learning: 2026-05-29T18:03:15.372Z
Learnt from: CR
Repo: pnpm/pnpm PR: 0
File: pacquet/AGENTS.md:0-0
Timestamp: 2026-05-29T18:03:15.372Z
Learning: Applies to pacquet/**/*.rs : User-facing errors go through `miette` via the `pacquet-diagnostics` crate; match pnpm's error codes and messages where pnpm defines them since error codes are part of the public contract

Applied to files:

  • config/reader/src/getOptionsFromRootManifest.ts
🔇 Additional comments (3)
.changeset/dollar-overrides-deprecation.md (1)

1-7: LGTM!

config/reader/src/getOptionsFromRootManifest.ts (1)

5-5: LGTM!

Also applies to: 31-40, 99-107

config/reader/test/deprecatedVersionReferences.test.ts (1)

1-45: LGTM!


📝 Walkthrough

Walkthrough

The PR adds a deprecation warning system for the $version reference syntax in pnpm overrides. When detected, the system emits a single warning and replaces the deprecated references with catalog-aware versions, while continuing to maintain backward compatibility.

Changes

Deprecation warning for dollar-syntax version overrides

Layer / File(s) Summary
Deprecation changeset documentation
.changeset/dollar-overrides-deprecation.md
Changeset metadata and deprecation notice document that the $-syntax in overrides is deprecated and recommends using catalog: protocol instead.
Deprecation detection and warning implementation
config/reader/src/getOptionsFromRootManifest.ts
Imports globalWarn, detects $-prefixed override values in getOptionsFromPnpmSettings, calls a new internal helper warnAboutDeprecatedVersionReferences that scans overrides and emits a single deprecation warning listing affected selectors.
Deprecation warning test coverage
config/reader/test/deprecatedVersionReferences.test.ts
Jest tests mock globalWarn, verify that a single warning is emitted when overrides use $-syntax with expected message content, and confirm no warning is emitted for non-deprecated overrides.

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 A dollar sign that deprecated,
Now warns us with a catalog fate.
Version refs evolve with style,
Making pnpm override smile! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: deprecating the $ version reference syntax in pnpm overrides, which is the core feature introduced across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deprecate-dollar-overrides

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zkochan zkochan marked this pull request as ready for review June 8, 2026 11:44
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Review Summary by Qodo

Deprecate $ version references in overrides

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Warn on deprecated $ overrides
• Keep override resolution unchanged
• Add coverage for warning behavior
• Publish patch changeset
Diagram
flowchart LR
  A["`getOptionsFromPnpmSettings`"] -- "checks overrides" --> B["`warnAboutDeprecatedVersionReferences`"]
  B -- "calls" --> C["`globalWarn`"]
  A -- "still resolves with manifest" --> D["`createVersionReferencesReplacer`"]
  E["`deprecatedVersionReferences.test.ts`"] -- "verifies" --> B
  F["`.changeset/dollar-overrides-deprecation.md`"] -- "documents release note" --> G["patch release"]

Loading

Grey Divider

File Changes

1. config/reader/src/getOptionsFromRootManifest.ts ✨ Enhancement +16/-2

Warn on deprecated override version references

• Imports globalWarn from @pnpm/logger
• Emits a deprecation warning when override values start with $
• Keeps existing $-reference resolution logic intact
• Skips warning only when overrides are empty

config/reader/src/getOptionsFromRootManifest.ts


2. config/reader/test/deprecatedVersionReferences.test.ts 🧪 Tests +44/-0

Add tests for deprecation warnings

• Mocks @pnpm/logger to capture warnings
• Verifies $ overrides still resolve to manifest versions
• Asserts a warning is emitted for deprecated syntax
• Confirms non-$ overrides do not warn

config/reader/test/deprecatedVersionReferences.test.ts


3. .changeset/dollar-overrides-deprecation.md 📝 Documentation +6/-0

Add patch release note

• Adds a changeset for @pnpm/config.reader and pnpm
• Summarizes the new $ override deprecation warning
• Recommends catalog: references as the replacement

.changeset/dollar-overrides-deprecation.md


Grey Divider

Qodo Logo

@zkochan zkochan merged commit 894ea6a into main Jun 8, 2026
15 checks passed
@zkochan zkochan deleted the deprecate-dollar-overrides branch June 8, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant