Unverified Commit c5263474 authored by Luke Sandberg's avatar Luke Sandberg Committed by GitHub

Adopt pnpm catalogs for devDependencies (#93071)

### What?

Adopt pnpm [catalogs](https://pnpm.io/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.

<!-- NEXT_JS_LLM_PR -->
parent 2b846de4
...@@ -35,10 +35,11 @@ ...@@ -35,10 +35,11 @@
"@types/react": "^18", "@types/react": "^18",
"@types/react-dom": "^18", "@types/react-dom": "^18",
"cross-env": "10.1.0", "cross-env": "10.1.0",
"eslint": "catalog:",
"inliner": "1.13.1", "inliner": "1.13.1",
"postcss": "^8.5", "postcss": "^8.5",
"tailwindcss": "^4.1.9", "tailwindcss": "^4.1.9",
"tw-animate-css": "1.3.3", "tw-animate-css": "1.3.3",
"typescript": "6.0.2" "typescript": "catalog:"
} }
} }
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
"dd-trace": "4.12.0", "dd-trace": "4.12.0",
"es5-ext": "0.10.53", "es5-ext": "0.10.53",
"escape-string-regexp": "2.0.0", "escape-string-regexp": "2.0.0",
"eslint": "9.37.0", "eslint": "catalog:",
"eslint-config-next": "workspace:*", "eslint-config-next": "workspace:*",
"eslint-formatter-codeframe": "7.32.1", "eslint-formatter-codeframe": "7.32.1",
"eslint-plugin-eslint-plugin": "5.2.1", "eslint-plugin-eslint-plugin": "5.2.1",
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
"image-size": "1.2.1", "image-size": "1.2.1",
"is-animated": "2.0.2", "is-animated": "2.0.2",
"isomorphic-unfetch": "3.0.0", "isomorphic-unfetch": "3.0.0",
"jest": "29.7.0", "jest": "catalog:",
"jest-diff": "29.7.0", "jest-diff": "29.7.0",
"jest-environment-jsdom": "29.7.0", "jest-environment-jsdom": "29.7.0",
"jest-extended": "4.0.2", "jest-extended": "4.0.2",
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
"postcss-pseudoelements": "5.0.0", "postcss-pseudoelements": "5.0.0",
"postcss-short-size": "4.0.0", "postcss-short-size": "4.0.0",
"postcss-trolling": "0.1.7", "postcss-trolling": "0.1.7",
"prettier": "3.6.2", "prettier": "catalog:",
"pretty-bytes": "5.3.0", "pretty-bytes": "5.3.0",
"pretty-ms": "7.0.0", "pretty-ms": "7.0.0",
"random-seed": "0.3.0", "random-seed": "0.3.0",
...@@ -302,7 +302,7 @@ ...@@ -302,7 +302,7 @@
"tsec": "0.2.1", "tsec": "0.2.1",
"tsx": "4.19.2", "tsx": "4.19.2",
"turbo": "2.9.4", "turbo": "2.9.4",
"typescript": "6.0.2", "typescript": "catalog:",
"typescript-eslint": "8.46.0", "typescript-eslint": "8.46.0",
"unfetch": "4.2.0", "unfetch": "4.2.0",
"wait-port": "0.2.2", "wait-port": "0.2.2",
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
"cross-spawn": "7.0.3", "cross-spawn": "7.0.3",
"fast-glob": "3.3.1", "fast-glob": "3.3.1",
"picocolors": "1.1.1", "picocolors": "1.1.1",
"prettier": "catalog:",
"prettier-plugin-tailwindcss": "0.6.2", "prettier-plugin-tailwindcss": "0.6.2",
"prompts": "2.4.2", "prompts": "2.4.2",
"tar": "7.5.7", "tar": "7.5.7",
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
}, },
"devDependencies": { "devDependencies": {
"@types/eslint": "9.6.1", "@types/eslint": "9.6.1",
"eslint": "9.37.0" "eslint": "9.37.0",
"typescript": "catalog:"
}, },
"scripts": { "scripts": {
"dev": "pnpm build", "dev": "pnpm build",
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
"@types/jscodeshift": "0.11.0", "@types/jscodeshift": "0.11.0",
"@types/prompts": "2.4.2", "@types/prompts": "2.4.2",
"@types/semver": "7.3.1", "@types/semver": "7.3.1",
"typescript": "6.0.2" "jest": "catalog:",
"typescript": "catalog:"
} }
} }
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
"devDependencies": { "devDependencies": {
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.34.0",
"dotenv": "16.3.1", "dotenv": "16.3.1",
"dotenv-expand": "10.0.0" "dotenv-expand": "10.0.0",
"typescript": "catalog:"
} }
} }
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
"@types/jest": "^29.5.0", "@types/jest": "^29.5.0",
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.34.0",
"jest": "^29.5.0", "jest": "^29.5.0",
"ts-jest": "^29.1.0" "ts-jest": "^29.1.0",
"typescript": "catalog:"
} }
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": false, "skipLibCheck": false,
"lib": ["es2022", "dom"], "lib": ["es2022", "dom", "dom.iterable"],
"rootDir": "src", "rootDir": "src",
"types": ["jest"] "types": ["jest"]
}, },
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
}, },
"devDependencies": { "devDependencies": {
"react-refresh": "0.12.0", "react-refresh": "0.12.0",
"typescript": "catalog:",
"webpack": "^4 || ^5" "webpack": "^4 || ^5"
} }
} }
This diff is collapsed.
...@@ -6,6 +6,11 @@ packages: ...@@ -6,6 +6,11 @@ packages:
- 'turbopack/crates/*/js' - 'turbopack/crates/*/js'
- 'turbopack/crates/turbopack-tests/tests/execution' - 'turbopack/crates/turbopack-tests/tests/execution'
- 'turbopack/packages/*' - 'turbopack/packages/*'
catalog:
eslint: 9.37.0
jest: 29.7.0
prettier: 3.6.2
typescript: 6.0.2
updateNotifier: false updateNotifier: false
publicHoistPattern: publicHoistPattern:
- '*eslint*' - '*eslint*'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment