chore: bump TypeScript from 5 to 7, and add TypeScript 6 side by side#9518
chore: bump TypeScript from 5 to 7, and add TypeScript 6 side by side#9518Mrtenz wants to merge 3 commits into
Conversation
Pin the `typescript` dev dependency to TypeScript 6 via the `@typescript/typescript6` package alias, and add `@typescript/native` as an alias for TypeScript 7. This allows incremental testing against TypeScript 7 without disrupting the current TypeScript 6 build. Also bump Yarn from 4.16.0 to 4.17.1 — the previous version broke when applying the built-in TypeScript patch.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution MetaMask internal reviewing guidelines:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Apply a Yarn patch to `@typescript/old` (TypeScript 6) so that `tsc` resolves to TypeScript 7 and `tsc6` resolves to TypeScript 6. Without the patch, a Yarn bug causes `tsc` to resolve to TypeScript 6.
Explanation
The monorepo was previously on TypeScript 5 (
~5.3.3). This PR bumps it to TypeScript 7 by aliasingtypescripttonpm:typescript@^7.0.2(via@typescript/native) in allpackage.jsonfiles.TypeScript 7.0 does not ship a JavaScript API (it uses a native Go binary instead), so tools that depend on the TypeScript JS API — such as ESLint — cannot use it directly. TypeScript 7.1 will restore the JS API, but until then TypeScript 6 is installed alongside TypeScript 7 under the
@typescript/typescript6alias so these tools continue to work in the interim.Yarn is bumped from 4.16.0 to 4.17.1 because the previous version broke when applying the built-in TypeScript patch.
References
https://consensyssoftware.atlassian.net/browse/WPC-1158
Checklist