Skip to content

Commit 9dba9af

Browse files
committed
Declare root dev dependencies that Yarn hoisting was hiding
Our root scripts use several packages that the root `package.json` doesn't declare. They work under Yarn only because hoisting happens to put them in the root `node_modules`: - `@babel/register` and `nullthrows`, used by `build` and the other scripts under `scripts/` - `flow-estree`, used by our lint rules - `@types/babel__core`, `@types/babel__traverse` and `@types/connect`, needed by `typecheck-ts` - `source-map@^0.6.1`. Our packages depend on 0.5, which ships no types, so `typecheck-ts` has been picking up the hoisted 0.6 typings instead. This keeps that behaviour explicit. Each range matches what's already locked, so `yarn.lock` doesn't change. This is needed for any package manager that doesn't hoist, in particular pnpm. Changelog: Internal Test plan: `yarn install --frozen-lockfile` passes with the unchanged `yarn.lock`. Under pnpm 11.28.8 and 12.15.0, before this change `build`, `lint` and `typecheck-ts` fail on missing modules or declarations. After it, `build`, `lint`, `format-check`, `verify-api-snapshots`, `typecheck-ts` and `test-smoke` all pass.
1 parent 2dc425a commit 9dba9af

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎package.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
99
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
1010
"@babel/plugin-transform-react-jsx": "^7.25.2",
11+
"@babel/register": "^7.24.6",
1112
"@babel/types": "^7.29.8",
1213
"@microsoft/api-extractor": "^7.52.2",
1314
"@tsconfig/node20": "^20.1.4",
15+
"@types/babel__core": "^7.1.14",
16+
"@types/babel__traverse": "^7.0.6",
17+
"@types/connect": "^3.4.35",
1418
"@types/node": "^22.0.0",
1519
"@typescript-eslint/eslint-plugin": "^8.59.2",
1620
"@typescript-eslint/parser": "^8.59.2",
@@ -32,6 +36,7 @@
3236
"flow-api-translator": "0.336.0",
3337
"flow-bin": "^0.337.0",
3438
"flow-eslint": "0.336.0",
39+
"flow-estree": "0.336.0",
3540
"flow-parser": "0.336.0",
3641
"invariant": "^2.2.4",
3742
"istanbul-lib-coverage": "3.0.0",
@@ -43,9 +48,11 @@
4348
"jest-watch-typeahead": "^2.2.0",
4449
"jsonc-eslint-parser": "^2.3.0",
4550
"metro-babel-register": "*",
51+
"nullthrows": "^1.1.1",
4652
"prettier": "3.9.4",
4753
"progress": "^2.0.0",
4854
"signedsource": "^2.0.0",
55+
"source-map": "^0.6.1",
4956
"typescript": "^6.0.3"
5057
},
5158
"scripts": {

0 commit comments

Comments
 (0)