Skip to content

Commit de42395

Browse files
authored
[api-extractor] Upgrade bundled TypeScript to 5.9 (#5727)
* [api-extractor] Upgrade bundled TypeScript to 5.9 * fix test * Revert "fix test" This reverts commit 62a34ea. * heft text v3 skipLibCheck * tsconfig comment --------- Co-authored-by: jameshanford <jahanford@users.noreply.github.com>
1 parent 8740839 commit de42395

File tree

9 files changed

+39
-19
lines changed

9 files changed

+39
-19
lines changed

apps/api-extractor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"resolve": "~1.22.1",
7676
"semver": "~7.5.4",
7777
"source-map": "~0.6.1",
78-
"typescript": "5.8.2"
78+
"typescript": "5.9.3"
7979
},
8080
"devDependencies": {
8181
"@rushstack/heft": "1.2.7",

apps/api-extractor/src/analyzer/TypeScriptInternals.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface IGlobalVariableAnalyzer {
1717
export class TypeScriptInternals {
1818
public static getImmediateAliasedSymbol(symbol: ts.Symbol, typeChecker: ts.TypeChecker): ts.Symbol {
1919
// Compiler internal:
20-
// https://github.com/microsoft/TypeScript/blob/v3.2.2/src/compiler/checker.ts
20+
// https://github.com/microsoft/TypeScript/blob/v5.9.3/src/compiler/checker.ts
2121
return (typeChecker as any).getImmediateAliasedSymbol(symbol);
2222
}
2323

@@ -61,7 +61,7 @@ export class TypeScriptInternals {
6161
*/
6262
public static getJSDocCommentRanges(node: ts.Node, text: string): ts.CommentRange[] | undefined {
6363
// Compiler internal:
64-
// https://github.com/microsoft/TypeScript/blob/v2.4.2/src/compiler/utilities.ts#L616
64+
// https://github.com/microsoft/TypeScript/blob/v5.9.3/src/compiler/utilities.ts#L2710
6565

6666
return (ts as any).getJSDocCommentRanges.apply(this, arguments);
6767
}
@@ -73,7 +73,7 @@ export class TypeScriptInternals {
7373
node: ts.Identifier | ts.StringLiteralLike | ts.NumericLiteral
7474
): string {
7575
// Compiler internal:
76-
// https://github.com/microsoft/TypeScript/blob/v3.2.2/src/compiler/utilities.ts#L2721
76+
// https://github.com/microsoft/TypeScript/blob/v5.9.3/src/compiler/utilities.ts#L5368
7777

7878
return (ts as any).getTextOfIdentifierOrLiteral(node);
7979
}
@@ -89,7 +89,7 @@ export class TypeScriptInternals {
8989
mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined
9090
): ts.ResolvedModuleFull | undefined {
9191
// Compiler internal:
92-
// https://github.com/microsoft/TypeScript/blob/v5.3.3/src/compiler/types.ts#L4698
92+
// https://github.com/microsoft/TypeScript/blob/v5.9.3/src/compiler/types.ts#L5064
9393
const result: ts.ResolvedModuleWithFailedLookupLocations | undefined = (program as any).getResolvedModule(
9494
sourceFile,
9595
moduleNameText,
@@ -107,7 +107,7 @@ export class TypeScriptInternals {
107107
compilerOptions: ts.CompilerOptions
108108
): ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined {
109109
// Compiler internal:
110-
// https://github.com/microsoft/TypeScript/blob/v5.8.2/src/compiler/program.ts#L931
110+
// https://github.com/microsoft/TypeScript/blob/v5.9.3/src/compiler/program.ts#L932
111111

112112
return ts.getModeForUsageLocation?.(file, usage, compilerOptions);
113113
}

build-tests/heft-typescript-v3-test/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"strictNullChecks": true,
1717
"noUnusedLocals": true,
1818
"types": ["jest", "node"],
19+
// Skips lib check to suppress api-extractor Uint8Array generic type incompatibility with @types/node@17.0.41
20+
"skipLibCheck": true,
1921

2022
"module": "commonjs",
2123
"target": "es2017",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-extractor",
5+
"comment": "Upgrade the bundled compiler engine to TypeScript 5.9.3",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor"
10+
}

common/config/subspaces/build-tests-subspace/pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
22
{
3-
"pnpmShrinkwrapHash": "ae06e3ff5f65c89fd6b5c88cb4bce597f4a5aa18",
3+
"pnpmShrinkwrapHash": "306357c78efe97f545fc0681fdb84d17f79bbbb2",
44
"preferredVersionsHash": "550b4cee0bef4e97db6c6aad726df5149d20e7d9",
5-
"packageJsonInjectedDependenciesHash": "fa90a0a032a0046e646e8751bbc6d0be86a4dda1"
5+
"packageJsonInjectedDependenciesHash": "0750dcefdccb64160667c86a2af1ba7854f159e2"
66
}

common/config/subspaces/default/common-versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@
106106
// For testing Heft with TS V4
107107
"~4.9.5",
108108

109+
"5.8.2",
109110
// API Extractor bundles a specific TypeScript version because it calls internal APIs
110-
"5.8.2"
111+
"5.9.3"
111112
],
112113
"source-map": [
113114
"~0.6.1" // API Extractor is using an older version of source-map because newer versions are async

common/config/subspaces/default/pnpm-lock.yaml

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
22
{
3-
"pnpmShrinkwrapHash": "c482c23c40b202ed750549c796c24b3550d0ba6e",
3+
"pnpmShrinkwrapHash": "8821e1e50d94962f6d01f6b347c1a79a584bc961",
44
"preferredVersionsHash": "029c99bd6e65c5e1f25e2848340509811ff9753c"
55
}

0 commit comments

Comments
 (0)