Repository navigation
fix(reference): resolve emitted extensions to TypeScript source - #755
rudycelekli wants to merge 2 commits into
Conversation
Signed-off-by: Rudy Celekli <[email protected]>
|
Reviewed: TS source-extension fallbacks (./dep.js -> dep.ts/.tsx/.d.ts, .mjs->.mts etc. after runtime candidates, TS-callers only) correctly mirror NodeNext behavior with precedence pinned (present runtime wins) and JS callers conservative. 8 counterpart + precedence + JS-negative controls cover it. APPROVE. Two non-blocking nits: caller gate also matches .d.ts importers (consider excluding /.d.(ts|mts|cts)$/), and new suffixes lack index variants — worth a one-line out-of-scope comment. |
Review — APPROVE (two non-blocking nits)Summary
Verification
Nits (non-blocking)
|
Signed-off-by: Rudy Celekli <[email protected]>
|
Thank you. Signed follow-up The relevant importer selection passes 26 tests across two files. |
|
Superseded by #815, which integrated this change and has now merged (3af3811). Thanks @rudycelekli for the fix and the thorough verification — much appreciated! |
Summary
Resolve a TypeScript historical-source import's emitted
.js,.jsx,.mjsor.cjsextension to its present source counterpart when the literal runtime file is absent. This repairs source-reference edges for ordinary NodeNext source trees.Problem and expected behavior
main.tsexporting from./dep.js, withdep.tspresent, was reported as unresolved. The actual installed TypeScript 7.0.2 NodeNext compiler accepts this tree. The built publicimport-reference-sourceCLI reported all eight tested source counterparts as unresolved before the fix.Change and scope
Add source-extension fallbacks for TypeScript callers after existing file candidates. Present runtime files retain precedence. Declaration files retain their actual source identity. JavaScript callers do not acquire TypeScript runtime fallbacks. Counterparts cover explicit filenames, not directory/index resolution. This does not implement full tsconfig or package resolution, nor establish runtime execution of declaration sources.
Contract and boundary impact
ReferenceSourceImportEntries.docs/product-catalog.json), package, or installation impact: none.Evidence and regression coverage
For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/filesystem/referenceSourceTypeScriptExtensions.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts— 26 passed.tsc -pon owned NodeNext fixture tree — exit 0.rea import-reference-source ... --json— all eight source counterparts internal; base had eight unresolved.npm run check— all five tasks passed, 124 existing lint warnings and zero errors.git diff --check— pass.npm run check:fast— pass (both cached tasks).Compatibility, safety, and release
Review checklist
type(scope): outcome.Maintainer follow-up: signed
bb640c7cb241cdb0fce6afd580b7a17fd352dc76adds only the scope comment and declaration-caller controls; the existing valid caller gate is retained. New hosted checks pending, separate from the original all19 green head.