Skip to content

Fix TypeScript runtime .js import resolution#405

Draft
GYF0311 wants to merge 1 commit into
Egonex-AI:mainfrom
GYF0311:fix/ts-js-import-resolution
Draft

Fix TypeScript runtime .js import resolution#405
GYF0311 wants to merge 1 commit into
Egonex-AI:mainfrom
GYF0311:fix/ts-js-import-resolution

Conversation

@GYF0311

@GYF0311 GYF0311 commented Jun 6, 2026

Copy link
Copy Markdown

Summary

  • Resolve TypeScript NodeNext / ESM runtime .js, .jsx, .mjs, and .cjs import specifiers to source files when the exact runtime file does not exist.
  • Preserve exact runtime file matches first, so real .js files still win.
  • Add .mts / .cts source probes and a regression test for ./foo.js resolving to foo.ts.

Root Cause

The resolver previously appended source probes to the full import specifier. For example, ./commands/source.js would probe paths like commands/source.js.ts, miss the existing commands/source.ts, and drop the deterministic import edge.

Validation

  • pnpm --filter @understand-anything/core build
  • pnpm --filter @understand-anything/skill build
  • pnpm test — 16 test files, 201 tests passing
  • Verified a local TypeScript ESM fixture now produces deterministic internal import edges where it previously produced none.

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.

1 participant