Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/metro-babel-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"license": "MIT",
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/types": "^7.29.8",
"@types/babel__core": "^7.1.14",
"flow-enums-runtime": "^0.0.6",
"flow-parser": "0.340.0",
"metro-cache-key": "0.88.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"license": "MIT",
"dependencies": {
"@types/connect": "^3.4.35",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit · Non-hoisted installs still fail on undeclared metro-* imports in metro-config and metro-core

The PR aims to stop published declarations relying on packages that are only available accidentally through transitive dependencies, but the same pattern remains for some internal packages. It isn't a regression, and npm and default pnpm installs aren't affected.

Failure case: a strict TypeScript consumer of metro and metro-config, installed with pnpm hoist: false, gets 4 TS2307 errors at head:

  • metro-config/src/types.d.ts can't find metro-file-map, metro-resolver or metro-transform-worker.
  • metro-core/src/errors/AmbiguousModuleResolutionError.d.ts can't find metro-file-map.

Fix: add these as dependencies of metro-config and metro-core, here or in a follow-up. An import audit of the declarations also flags metro-core to metro, metro-file-map to metro-config and metro-minify-terser to metro-transform-worker. Those would add new links between Metro's packages, so they may need a maintainer decision. They didn't produce errors in this consumer.

Reproduced: Packed head tarballs and installed them in a fresh pnpm 12 consumer with hoist: false. tsc -p . with TypeScript 6.0.3, strict and skipLibCheck: false exited 2 with exactly these 4 TS2307 errors. The same head tarballs pass under default pnpm hoisting. The PR doesn't change these imports or add these dependencies; the failure wasn't run against base. · id 0cfa611c

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added all four direct dependencies in faba463: metro-config now declares metro-file-map, metro-resolver, and metro-transform-worker; metro-core declares metro-file-map. Each uses the existing 0.87.2 workspace version, with no lockfile change.

Freshly built and packed head tarballs reproduce exactly the four TS2307 errors in a strict TypeScript consumer with pnpm hoisting disabled. The same consumer passes with the new manifests; the default-hoisting baseline control also passes. Comparing all 17 tarballs shows only these two package manifests changed.

The config → transform-worker edge stays within the existing config → metro → transform-worker dependency component; the complete strongly connected component partition is unchanged. Other reverse edges noted in the comment remain outside this change.

Validation: frozen Yarn and pnpm installs; full repository checks (162 suites, 3059 tests, 495 snapshots passed; 14 existing skips); and yarn typecheck-ts pass.

"connect": "^3.6.5",
"flow-enums-runtime": "^0.0.6",
"jest-validate": "^29.7.0",
Expand All @@ -27,7 +28,6 @@
"metro-core": "0.88.0"
},
"devDependencies": {
"@types/connect": "^3.4.35",
"metro-babel-register": "0.88.0",
"pretty-format": "^29.7.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/metro-source-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@babel/core": "^7.25.2",
"@babel/traverse": "^7.29.10",
"@babel/types": "^7.29.8",
"@types/babel__core": "^7.1.14",
"flow-enums-runtime": "^0.0.6",
"invariant": "^2.2.4",
"metro-symbolicate": "0.88.0",
Expand Down
1 change: 1 addition & 0 deletions packages/metro-symbolicate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"metro"
],
"dependencies": {
"@types/source-map": "0.5.2",
"flow-enums-runtime": "^0.0.6",
"invariant": "^2.2.4",
"metro-source-map": "0.88.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/metro-transform-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"@babel/generator": "^7.29.1",
"@babel/template": "^7.28.6",
"@babel/traverse": "^7.29.10",
"@babel/types": "^7.29.8",
"@types/babel__core": "^7.1.14",
"@types/babel__traverse": "^7.0.6",
"flow-enums-runtime": "^0.0.6",
"nullthrows": "^1.1.1"
},
Expand All @@ -31,7 +34,6 @@
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
"@babel/types": "^7.29.8",
"babel-plugin-tester": "^6.0.1",
"metro": "0.88.0"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/metro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"@babel/template": "^7.28.6",
"@babel/traverse": "^7.29.10",
"@babel/types": "^7.29.8",
"@types/babel__core": "^7.1.14",
"@types/babel__traverse": "^7.0.6",
"@types/connect": "^3.4.35",
"@types/ws": "^7.4.7",
"@types/yargs": "^17.0.35",
"accepts": "^2.0.0",
"connect": "^3.6.5",
"debug": "^4.4.0",
Expand Down Expand Up @@ -61,8 +66,6 @@
"@babel/plugin-transform-runtime": "^7.24.7",
"@react-native/babel-preset": "0.78.0",
"@react-native/metro-babel-transformer": "0.78.0",
"@types/ws": "^7.4.7",
"@types/yargs": "^17.0.35",
"babel-jest": "^29.7.0",
"dedent": "^0.7.0",
"jest-snapshot": "^29.7.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,11 @@
dependencies:
undici-types "~6.21.0"

"@types/source-map@0.5.2":
version "0.5.2"
resolved "https://registry.yarnpkg.com/@types/source-map/-/source-map-0.5.2.tgz#973459e744cc7445c85b97f770275b479b138e08"
integrity sha512-++w4WmMbk3dS3UeHGzAG+xJOSz5Xqtjys/TBkqG3qp3SeWE7Wwezqe5eB7B51cxUyh4PW7bwVotpsLdBK0D8cw==

"@types/stack-utils@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff"
Expand Down
Loading