Skip to content
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

fix(bundler) Typescript paths with packages external fix #16163

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

zpix1
Copy link
Contributor

@zpix1 zpix1 commented Jan 4, 2025

What does this PR do?

This patch fixes issue #14721, where packages=external option of bundler incorrectly excluded packages which were imported with mapped path (using tsconfig path aliases).

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

I wrote automated tests

  • I checked the lifetime of memory allocated to verify it's (1) freed and (2) only freed when it should be
  • I included a test for the new code, or an existing test covers it
  • JSValue used outside outside of the stack is either wrapped in a JSC.Strong or is JSValueProtect'ed
  • I wrote TypeScript/JavaScript tests and they pass locally (bun-debug test test-file-name.test)

@zpix1 zpix1 marked this pull request as draft January 4, 2025 14:31
@zpix1 zpix1 marked this pull request as ready for review January 4, 2025 16:50
Copy link
Member

@paperclover paperclover left a comment

Choose a reason for hiding this comment

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

this seems reasonable

return MatchResult{ .path_pair = .{
.primary = _result.path_pair.primary,
.secondary = auto_main_result.path_pair.primary,
}, .diff_case = _result.diff_case, .dirname_fd = _result.dirname_fd, .package_json = package_json, .file_fd = auto_main_result.file_fd, .is_node_module = is_node_module_folder };
Copy link
Member

Choose a reason for hiding this comment

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

this should have a trailing comma to tell the formatter to use multiple lines

@zpix1 zpix1 force-pushed the zpix1/#14721-typescript-paths-with-packages-external-fix branch from 63ed161 to 33184af Compare January 7, 2025 05:42
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