Files
orca/mobile/patches/@expo__cli@55.0.36.patch
T
Neil cc2b6fe6a2 build(mobile): move to TypeScript 7 and Vitest 5, typecheck through the root tsrs runner (#33419)
- Bump mobile typescript to ^7.0.2 and vitest to 5.0.5; keep TypeScript 6 as typescript-api
  for the test-support code that walks the AST, mirroring the root.
- Patch Expo CLI's tsconfig reader to fall back to typescript-api: TypeScript 7 has no
  compiler API, and Metro otherwise crashes reading tsconfig paths.
- Register mobile/tsconfig.json and mobile/tsconfig.test.json with the root typecheck runner;
  locally they use incremental tsrs (Bun elsewhere), CI uses Bun like root CI.
- Route the tests-typecheck ratchet through the same compiler selection.
- Enforce root/mobile parity for typescript, typescript-api and vitest.
2026-10-24 23:09:20 -07:00

25 lines
1.1 KiB
Diff

diff --git a/build/src/utils/tsconfig/evaluateTsConfig.js b/build/src/utils/tsconfig/evaluateTsConfig.js
index ecf0298a6858541f2e33d0af5293ad61aa80a159..491d9800703dab8e3c197c09bd45af4fd3e13b58 100644
--- a/build/src/utils/tsconfig/evaluateTsConfig.js
+++ b/build/src/utils/tsconfig/evaluateTsConfig.js
@@ -77,11 +77,15 @@ function evaluateTsConfig(ts, tsConfigPath) {
}
}
function importTypeScriptFromProjectOptionally(projectRoot) {
- const resolvedPath = _resolvefrom().default.silent(projectRoot, 'typescript');
- if (!resolvedPath) {
- return null;
+ // TypeScript 7 ships no compiler API; read tsconfig with the project's TypeScript 6 alias.
+ for (const name of ['typescript', 'typescript-api']) {
+ const resolvedPath = _resolvefrom().default.silent(projectRoot, name);
+ const ts = resolvedPath ? require(resolvedPath) : null;
+ if (typeof (ts == null ? void 0 : ts.readConfigFile) === 'function') {
+ return ts;
+ }
}
- return require(resolvedPath);
+ return null;
}
//# sourceMappingURL=evaluateTsConfig.js.map