Skip to content

Commit 4cae36c

Browse files
authored
Merge pull request #4408 from microsoft/octogonz/ae-ts-5.3.0-beta
Update API Extractor to support TypeScript 5.3.3
2 parents 235c79b + b64e31c commit 4cae36c

File tree

10 files changed

+155
-116
lines changed

10 files changed

+155
-116
lines changed

apps/api-extractor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"resolve": "~1.22.1",
4949
"semver": "~7.5.4",
5050
"source-map": "~0.6.1",
51-
"typescript": "~5.0.4"
51+
"typescript": "5.3.3"
5252
},
5353
"devDependencies": {
5454
"local-eslint-config": "workspace:*",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ export class ExportAnalyzer {
268268
: undefined;
269269

270270
const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(
271+
this._program,
271272
importOrExportDeclaration.getSourceFile(),
272273
moduleSpecifier,
273274
mode
@@ -882,6 +883,7 @@ export class ExportAnalyzer {
882883
)
883884
: undefined;
884885
const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(
886+
this._program,
885887
importOrExportDeclaration.getSourceFile(),
886888
moduleSpecifier,
887889
mode

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,19 @@ export class TypeScriptInternals {
8282
* The compiler populates this cache as part of analyzing the source file.
8383
*/
8484
public static getResolvedModule(
85+
program: ts.Program,
8586
sourceFile: ts.SourceFile,
8687
moduleNameText: string,
8788
mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined
8889
): ts.ResolvedModuleFull | undefined {
8990
// Compiler internal:
90-
// https://github.com/microsoft/TypeScript/blob/v4.7.2/src/compiler/utilities.ts#L161
91-
92-
return (ts as any).getResolvedModule(sourceFile, moduleNameText, mode);
91+
// https://github.com/microsoft/TypeScript/blob/v5.3.3/src/compiler/types.ts#L4698
92+
const result: ts.ResolvedModuleWithFailedLookupLocations | undefined = (program as any).getResolvedModule(
93+
sourceFile,
94+
moduleNameText,
95+
mode
96+
);
97+
return result?.resolvedModule;
9398
}
9499

95100
/**

build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml

Lines changed: 104 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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": "Update API Extractor to support TypeScript 5.3.3",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-patch",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-patch"
10+
}

common/config/rush/common-versions.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@
7676
// For testing Heft with TS V3
7777
"~3.9.10",
7878
// For testing Heft with TS V4
79-
"~4.9.5"
79+
"~4.9.5",
80+
81+
"5.3.3"
8082
],
8183
"source-map": [
8284
"~0.6.1" // API Extractor is using an older version of source-map because newer versions are async

common/config/rush/pnpm-lock.yaml

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/config/rush/repo-state.json

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": "148b38e4e98c98edfcfa2d368a33cff4b835df8f",
3+
"pnpmShrinkwrapHash": "e42e10f7ac97560c9546f9077901b92b19a54310",
44
"preferredVersionsHash": "1926a5b12ac8f4ab41e76503a0d1d0dccc9c0e06"
55
}

eslint/eslint-patch/src/eslint-bulk-suppressions/bulk-suppressions-patch.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ export function getGitRootPath(): string {
7474
export const GitRootPath = getGitRootPath();
7575

7676
function findEslintrcDirectory(fileAbsolutePath: string): string {
77-
for (let currentDir = fileAbsolutePath; currentDir.startsWith(GitRootPath); currentDir = path.dirname(currentDir))
77+
for (
78+
let currentDir = fileAbsolutePath;
79+
currentDir.startsWith(GitRootPath);
80+
currentDir = path.dirname(currentDir)
81+
)
7882
if (['.eslintrc.js', '.eslintrc.cjs'].some((eslintrc) => fs.existsSync(path.join(currentDir, eslintrc))))
7983
return currentDir;
8084
throw new Error('Cannot locate eslintrc');

0 commit comments

Comments
 (0)