Skip to content

Add support for resolution mode #851

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

Merged
merged 10 commits into from
Jun 2, 2025
Merged

Conversation

EricCornelson
Copy link
Contributor

No description provided.

@andrewbranch andrewbranch force-pushed the ercornel/moduleResolution branch from 62d765c to 646a75a Compare May 22, 2025 22:37
@andrewbranch andrewbranch marked this pull request as ready for review May 22, 2025 22:38
@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 22:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for resolution mode across various modules of the project. Key changes include updating APIs to accept a resolution mode parameter (e.g. in fakeProgram, Program, and Resolver), modifying error baselines and import resolution behavior in test files, and introducing new helper functions in the compiler options, module utilities, and AST utilities.

Reviewed Changes

Copilot reviewed 600 out of 600 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testdata/baselines/reference/submodule/compiler/*.diff Removal/updating of error baseline files to reflect new resolution mode behavior.
internal/transformers/importelision_test.go Updates to fakeProgram with new resolution mode methods and added stub implementations.
internal/module/resolver.go Renaming of GetPackageJsonTypeIfApplicable to GetPackageJsonScopeIfApplicable and slight behavior updates.
internal/core/compileroptions.go New functions to expose package json exports/imports and TS extension import options.
internal/compiler/program.go & fileloader.go Updated signatures in GetResolvedModule and added new methods for retrieving resolution mode and file meta data.
internal/checker/* & internal/ast/* Adjustments to incorporate resolution mode in module resolution logic and type-checking.

@andrewbranch
Copy link
Member

Looking at the error diffs that got modified but not deleted, a few big categories stand out:

  • Missing program-level diagnostics (verifyCompilerOptions not ported)
  • Module specifiers in errors mismatch in formatting, which will be fixed by createNodeBuilder, declaration emit, and associated utility port #791
  • Some tests accidentally include trailing commas in package.json, which we successfully parse in Strada by using our own JSON parser and evaluator, but fail to parse in Corsa. npm itself crashes on invalid JSON in package.json files and doesn’t allow it to be pushed to the registry, so I decided to use Go’s built-in JSON parsing for better performance.

@andrewbranch andrewbranch force-pushed the ercornel/moduleResolution branch from 081778a to 45fd7b7 Compare June 2, 2025 17:27
@andrewbranch andrewbranch requested a review from jakebailey June 2, 2025 21:58
@andrewbranch andrewbranch enabled auto-merge June 2, 2025 21:58
@andrewbranch andrewbranch added this pull request to the merge queue Jun 2, 2025
Merged via the queue into main with commit e34eca1 Jun 2, 2025
23 checks passed
@andrewbranch andrewbranch deleted the ercornel/moduleResolution branch June 2, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants