Skip to content

Confirm TypeScript PR #60238 changes are already correctly ported #1131

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

Closed
wants to merge 1 commit into from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 9, 2025

This PR investigates and confirms that TypeScript PR #60238 "Fix prioritization of paths specifiers over node_modules package specifiers" has already been correctly ported to the Go codebase.

Analysis

The original TypeScript PR #60238 made critical changes to the computeModuleSpecifiers function to ensure that paths specifiers from tsconfig.json are properly prioritized over node_modules package specifiers:

Key Changes:

  1. Removed conditional: The getLocalModuleSpecifier call was moved outside the if (!specifier) block to always execute
  2. Updated pathsOnly parameter: Changed from modulePath.isRedirect to modulePath.isRedirect || !!specifier
  3. Improved prioritization: Ensures paths specifiers are always considered and prioritized over node_modules

Verification

After thorough analysis of the Go implementation in /internal/modulespecifiers/specifiers.go, I confirmed that:

Line 356-364: getLocalModuleSpecifier is called unconditionally (not inside an if block)
Line 363: pathsOnly parameter correctly uses modulePath.IsRedirect || len(specifier) > 0
Lines 365-391: All local specifier processing logic runs unconditionally

Testing

  • All existing tests pass without baseline changes
  • Build succeeds without errors
  • Manual verification confirms paths resolution works correctly with the test case from the original PR
  • Repository remains clean with no changes needed

Conclusion

The TypeScript PR #60238 changes have already been correctly ported to the Go codebase. The module specifier prioritization logic properly prioritizes paths specifiers over node_modules package specifiers as intended.

No code changes were required.

Fixes #1127.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Port TypeScript PR #60238: Fix prioritization of paths specifiers over node_modules package specifiers Confirm TypeScript PR #60238 changes are already correctly ported Jun 9, 2025
@Copilot Copilot AI requested a review from andrewbranch June 9, 2025 22:52
Copilot finished work on behalf of andrewbranch June 9, 2025 22:52
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.

Port TypeScript PR #60238: Fix prioritization of paths specifiers over node_modules package specifiers
2 participants