Skip to content

Commit 780a5b7

Browse files
committed
chore(types): run TypeScript 6 and 7 side by side
TypeScript 7 does not expose a compiler API, while ESLint tooling still imports `typescript`. Keep the compatibility API under that canonical package name and let the native package provide `tsc`. Refs: https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/
1 parent 69b452d commit 780a5b7

3 files changed

Lines changed: 39 additions & 28 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
"@types/mocha": "^10.0.10",
199199
"@types/node": "^18.19.106",
200200
"@types/sinon": "^22.0.0",
201+
"@typescript/native": "npm:typescript@^7.0.2",
201202
"@vercel/nft": "^0.29.4",
202203
"axios": "^1.18.1",
203204
"benchmark": "^2.1.4",
@@ -239,7 +240,7 @@
239240
"source-map-support": "^0.5.21",
240241
"test-exclude": "^8.0.0",
241242
"tiktoken": "^1.0.21",
242-
"typescript": "^7.0.2",
243+
"typescript": "npm:@typescript/typescript6@^6.0.2",
243244
"v8-to-istanbul": "^9.0.0",
244245
"workerpool": "^10.0.3",
245246
"yaml": "^2.9.0",

tsconfig.dev.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"strictBuiltinIteratorReturn": true,
1111
"strictFunctionTypes": true,
1212

13-
"alwaysStrict": false,
1413
"exactOptionalPropertyTypes": false,
1514
"forceConsistentCasingInFileNames": false,
1615
"noFallthroughCasesInSwitch": false,
@@ -28,7 +27,6 @@
2827
"moduleDetection": "force",
2928
"resolveJsonModule": true,
3029
"verbatimModuleSyntax": true,
31-
"baseUrl": ".",
3230

3331
"types": ["node"],
3432
"typeRoots": ["./types", "./node_modules/@types"],

yarn.lock

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,37 @@
11001100
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.61.0.tgz#0ddb46e012a4288292950bdd253db42f278ce64d"
11011101
integrity sha512-9QTQpZ5Iin4CdIodfbDQFSeiSJKidgYJYug1P9CC2xWgUTvlmixViqDZNciMjwLBZyJnG4tGmPl97rVAFb1AJg==
11021102

1103+
"@typescript/native@npm:typescript@^7.0.2":
1104+
version "7.0.2"
1105+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-7.0.2.tgz#9ec773d7954a8c182c17cc5bbd575aa28bc51582"
1106+
integrity sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==
1107+
optionalDependencies:
1108+
"@typescript/typescript-aix-ppc64" "7.0.2"
1109+
"@typescript/typescript-darwin-arm64" "7.0.2"
1110+
"@typescript/typescript-darwin-x64" "7.0.2"
1111+
"@typescript/typescript-freebsd-arm64" "7.0.2"
1112+
"@typescript/typescript-freebsd-x64" "7.0.2"
1113+
"@typescript/typescript-linux-arm" "7.0.2"
1114+
"@typescript/typescript-linux-arm64" "7.0.2"
1115+
"@typescript/typescript-linux-loong64" "7.0.2"
1116+
"@typescript/typescript-linux-mips64el" "7.0.2"
1117+
"@typescript/typescript-linux-ppc64" "7.0.2"
1118+
"@typescript/typescript-linux-riscv64" "7.0.2"
1119+
"@typescript/typescript-linux-s390x" "7.0.2"
1120+
"@typescript/typescript-linux-x64" "7.0.2"
1121+
"@typescript/typescript-netbsd-arm64" "7.0.2"
1122+
"@typescript/typescript-netbsd-x64" "7.0.2"
1123+
"@typescript/typescript-openbsd-arm64" "7.0.2"
1124+
"@typescript/typescript-openbsd-x64" "7.0.2"
1125+
"@typescript/typescript-sunos-x64" "7.0.2"
1126+
"@typescript/typescript-win32-arm64" "7.0.2"
1127+
"@typescript/typescript-win32-x64" "7.0.2"
1128+
1129+
"@typescript/old@npm:typescript@^6":
1130+
version "6.0.3"
1131+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-6.0.3.tgz#90251dc007916e972786cb94d74d15b185577d21"
1132+
integrity sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==
1133+
11031134
"@typescript/typescript-aix-ppc64@7.0.2":
11041135
version "7.0.2"
11051136
resolved "https://registry.yarnpkg.com/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz#cdc7ce81d60f1e09034960ddfb1fb880d7a776b6"
@@ -4249,31 +4280,12 @@ typedarray@^0.0.6:
42494280
resolved "https://registry.yarnpkg.com/typescript/-/typescript-6.0.3.tgz#90251dc007916e972786cb94d74d15b185577d21"
42504281
integrity sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==
42514282

4252-
typescript@^7.0.2:
4253-
version "7.0.2"
4254-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-7.0.2.tgz#9ec773d7954a8c182c17cc5bbd575aa28bc51582"
4255-
integrity sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==
4256-
optionalDependencies:
4257-
"@typescript/typescript-aix-ppc64" "7.0.2"
4258-
"@typescript/typescript-darwin-arm64" "7.0.2"
4259-
"@typescript/typescript-darwin-x64" "7.0.2"
4260-
"@typescript/typescript-freebsd-arm64" "7.0.2"
4261-
"@typescript/typescript-freebsd-x64" "7.0.2"
4262-
"@typescript/typescript-linux-arm" "7.0.2"
4263-
"@typescript/typescript-linux-arm64" "7.0.2"
4264-
"@typescript/typescript-linux-loong64" "7.0.2"
4265-
"@typescript/typescript-linux-mips64el" "7.0.2"
4266-
"@typescript/typescript-linux-ppc64" "7.0.2"
4267-
"@typescript/typescript-linux-riscv64" "7.0.2"
4268-
"@typescript/typescript-linux-s390x" "7.0.2"
4269-
"@typescript/typescript-linux-x64" "7.0.2"
4270-
"@typescript/typescript-netbsd-arm64" "7.0.2"
4271-
"@typescript/typescript-netbsd-x64" "7.0.2"
4272-
"@typescript/typescript-openbsd-arm64" "7.0.2"
4273-
"@typescript/typescript-openbsd-x64" "7.0.2"
4274-
"@typescript/typescript-sunos-x64" "7.0.2"
4275-
"@typescript/typescript-win32-arm64" "7.0.2"
4276-
"@typescript/typescript-win32-x64" "7.0.2"
4283+
"typescript@npm:@typescript/typescript6@^6.0.2":
4284+
version "6.0.2"
4285+
resolved "https://registry.yarnpkg.com/@typescript/typescript6/-/typescript6-6.0.2.tgz#79e0e47492564c83f8602013d7dd10d5ebc51a8c"
4286+
integrity sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==
4287+
dependencies:
4288+
"@typescript/old" "npm:typescript@^6"
42774289

42784290
undici-types@~5.26.4:
42794291
version "5.26.5"

0 commit comments

Comments
 (0)