Skip to content

Conversation

Copy link
Contributor

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 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 AI requested a review from andrewbranch June 9, 2025 22:52
@jakebailey jakebailey deleted the copilot/fix-1127 branch June 24, 2025 23:56
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