New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow typescript@5.3.0-beta as devDependency #7821
Merged
JoshuaKGoldberg
merged 11 commits into
typescript-eslint:main
from
JoshuaKGoldberg:typescript-5.3-beta
Nov 13, 2023
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e198efb
feat: allow typescript@5.3.0-beta as devDependency
JoshuaKGoldberg 1e2bf7b
Merge branch 'main' into typescript-5.3-beta
JoshuaKGoldberg a13decf
fix: no-restricted-imports.ts satisfies and assertions/attributes
JoshuaKGoldberg b85a0eb
Use patch-package for api-extractor
JoshuaKGoldberg 0f31fc2
Review feedback on typos
JoshuaKGoldberg 1213b98
Update patch with optional chaining
JoshuaKGoldberg 91f802c
I, ah, forgot we're on Yarn 3+
JoshuaKGoldberg d487f52
Fix lint, and update snapshots
JoshuaKGoldberg ac4bedd
typescript@5.3.1-rc, and aliased interfaces
JoshuaKGoldberg 281ce30
add yarn.lock update as well
JoshuaKGoldberg a2bef1d
Went back to 5.3.0-beta
JoshuaKGoldberg File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The future is now old man dot jpg
We can switch this to the 5.3 RC now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarnpkg/berry#4441 keeps hitting me shakes fist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
microsoft/TypeScript#56371 never mind 🥲