-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
* feat: allow typescript@5.3.0-beta as devDependency * fix: no-restricted-imports.ts satisfies and assertions/attributes * Use patch-package for api-extractor * Review feedback on typos * Update patch with optional chaining * I, ah, forgot we're on Yarn 3+ * Fix lint, and update snapshots * typescript@5.3.1-rc, and aliased interfaces * add yarn.lock update as well * Went back to 5.3.0-beta
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
diff --git a/lib/analyzer/ExportAnalyzer.js b/lib/analyzer/ExportAnalyzer.js | ||
index 51f31b4f2f253d82adc9594faa58d8dc031957e0..1fddac54b08665f5a5a717fef740613ae921cb7a 100644 | ||
--- a/lib/analyzer/ExportAnalyzer.js | ||
+++ b/lib/analyzer/ExportAnalyzer.js | ||
@@ -193,7 +193,7 @@ class ExportAnalyzer { | ||
const mode = specifier && ts.isStringLiteralLike(specifier) | ||
? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), specifier) | ||
: undefined; | ||
- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); | ||
+ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); | ||
if (resolvedModule === undefined) { | ||
// The TS compiler API `getResolvedModule` cannot resolve ambient modules. Thus, to match API Extractor's | ||
// previous behavior, simply treat all ambient modules as external. This bug is tracked by | ||
@@ -666,7 +666,7 @@ class ExportAnalyzer { | ||
ts.isStringLiteralLike(importOrExportDeclaration.moduleSpecifier) | ||
? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), importOrExportDeclaration.moduleSpecifier) | ||
: undefined; | ||
- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); | ||
+ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); | ||
if (resolvedModule === undefined) { | ||
// Encountered in https://github.com/microsoft/rushstack/issues/1914. | ||
// | ||
diff --git a/lib/analyzer/TypeScriptInternals.js b/lib/analyzer/TypeScriptInternals.js | ||
index ff13db7709ccf502fe202337869d4024431636c9..217c36b0303c3bf9871edabcd48fbf6e09f18561 100644 | ||
--- a/lib/analyzer/TypeScriptInternals.js | ||
+++ b/lib/analyzer/TypeScriptInternals.js | ||
@@ -84,10 +84,16 @@ class TypeScriptInternals { | ||
* Retrieves the (cached) module resolution information for a module name that was exported from a SourceFile. | ||
* The compiler populates this cache as part of analyzing the source file. | ||
*/ | ||
- static getResolvedModule(sourceFile, moduleNameText, mode) { | ||
+ static getResolvedModule(program, sourceFile, moduleNameText, mode) { | ||
// Compiler internal: | ||
- // https://github.com/microsoft/TypeScript/blob/v4.7.2/src/compiler/utilities.ts#L161 | ||
- return ts.getResolvedModule(sourceFile, moduleNameText, mode); | ||
+ // https://github.com/microsoft/TypeScript/blob/v5.3-beta/src/compiler/types.ts#L4678 | ||
+ const result = program.getResolvedModule( | ||
+ sourceFile, | ||
+ moduleNameText, | ||
+ mode | ||
+ ); | ||
+ return result?.resolvedModule; | ||
+ | ||
} | ||
/** | ||
* Gets the mode required for module resolution required with the addition of Node16/nodenext |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.