Skip to content

Adopt pnpm catalogs for devDependencies#93071

Merged
lukesandberg merged 2 commits into
canaryfrom
04-20-adopt_catalogs
Apr 21, 2026
Merged

Adopt pnpm catalogs for devDependencies#93071
lukesandberg merged 2 commits into
canaryfrom
04-20-adopt_catalogs

Conversation

@lukesandberg
Copy link
Copy Markdown
Contributor

@lukesandberg lukesandberg commented Apr 20, 2026

What?

Adopt pnpm catalogs for shared hoisted devDependencies: typescript, jest, eslint, and prettier. Each is pinned once in pnpm-workspace.yaml and referenced as "<name>": "catalog:" by every consumer.

Also adds the missing dom.iterable lib to @next/routing's tsconfig, required by URLSearchParams.entries() in TypeScript 6.

Why?

Several packages invoke these binaries in their build, test, or lint scripts but do not declare them in their own devDependencies — they rely on the hoisted root install.

This breaks Turborepo's cache invalidation: without a declared dep, a package has no lockfile edge to the tool, so bumping its version (e.g. #91257's TypeScript 5 → 6 upgrade) does not invalidate that package's task hash. @next/routing's types task has been a remote-cache hit on canary since the TS 6 bump, even though it now fails locally on a cold cache — CI is replaying a stale pre-bump success.

The same latent hazard exists for jest (@next/codemod), eslint (@next/bundle-analyzer-ui), and prettier (create-next-app).

How?

  • pnpm-workspace.yaml defines catalog: entries for each tool.
  • Consumer packages declare "<name>": "catalog:". pnpm still hoists one copy, but each consumer now has a real lockfile edge to the resolved version.
  • Root package.json migrates each pin to "catalog:" so the workspace file is the single source of truth.

Turborepo needs no changes — its existing per-package hashing picks up lockfile edge changes automatically. Future catalog bumps will invalidate every consumer's cache.

@types/node is a deliberate omission from this round: several packages intentionally pin different majors (^22, ^20, 20.14.2), so migrating it needs per-package intent review rather than bulk conversion.

Copy link
Copy Markdown
Contributor Author

lukesandberg commented Apr 20, 2026

@lukesandberg lukesandberg changed the title adopt catalogs adopt pnpm catalogs Apr 20, 2026
@lukesandberg lukesandberg marked this pull request as ready for review April 20, 2026 20:16
@lukesandberg lukesandberg requested a review from bgw April 20, 2026 20:16
Extends pnpm catalog adoption to jest, eslint, and prettier. Same motivation
as typescript: packages that invoke these binaries in their scripts but do
not declare them in their own devDependencies rely on hoisted installs, which
leaves Turborepo's package hash without a lockfile edge to invalidate on
version bumps.

- pnpm-workspace.yaml: add catalog entries for eslint, jest, prettier.
- Root package.json: migrate the three pins to catalog:.
- next-codemod: add jest: catalog: (invokes jest in 'test' script).
- apps/bundle-analyzer: add eslint: catalog: (invokes eslint in 'lint').
- create-next-app: add prettier: catalog: (invokes prettier in 'lint-fix').
- next-codemod, apps/bundle-analyzer: their existing literal typescript pins
  also move to catalog: for consistency with the first pass.
@lukesandberg lukesandberg force-pushed the 04-20-adopt_catalogs branch from 06d6fc4 to 8e2af10 Compare April 20, 2026 20:22
@mischnic mischnic changed the title adopt pnpm catalogs Adopt pnpm catalogs for devDependencies Apr 21, 2026
@lukesandberg lukesandberg force-pushed the 04-20-adopt_catalogs branch 3 times, most recently from 00d0672 to 8e2af10 Compare April 21, 2026 18:33
@lukesandberg lukesandberg merged commit c526347 into canary Apr 21, 2026
812 of 826 checks passed
Copy link
Copy Markdown
Contributor Author

Merge activity

@lukesandberg lukesandberg deleted the 04-20-adopt_catalogs branch April 21, 2026 18:53
lukesandberg added a commit that referenced this pull request Apr 24, 2026
Reverts #93071

This breaks our use of lerna, lerna uses npm-package-arg to parse
package.json files and cannot resolve `catalog` references
@github-actions github-actions Bot added the locked label May 6, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants