-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
* feat: allow [email protected] 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 * [email protected], 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,12 +114,13 @@ | |
"ts-node": "10.7.0", | ||
"tslint": "^6.1.3", | ||
"tsx": "^3.12.7", | ||
"typescript": ">=4.3.5 <5.3.0" | ||
"typescript": ">=4.3.5 <5.4.0" | ||
}, | ||
"resolutions": { | ||
"@jest/create-cache-key-function": "^29", | ||
"@jest/reporters": "^29", | ||
"@jest/test-result": "^29", | ||
"@microsoft/api-extractor@^7.38.0": "patch:@microsoft/api-extractor@npm%3A7.38.0#./.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch", | ||
"@swc/core-android-arm-eabi": "link:./tools/dummypkg", | ||
"@swc/core-android-arm64": "link:./tools/dummypkg", | ||
"@swc/core-freebsd-x64": "link:./tools/dummypkg", | ||
|
@@ -140,7 +141,7 @@ | |
"pretty-format": "^29", | ||
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", | ||
"tsx": "^3.12.7", | ||
"typescript": "patch:typescript@npm%3A5.2.2#./.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch" | ||
"typescript": "patch:typescript@npm%3A5.3.0-beta#./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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.