refactor(ts): TS-0 — subdirectory-capable module resolution - #63
Merged
Conversation
Replace the enumerated #sidecar imports maps in both package.json files with
wildcard patterns (#sidecar/*.js and #sidecar/* -> ./src/*.ts). The .js entry
is kept and listed first: Node's longest-suffix pattern precedence needs it so
#sidecar/foo.js resolves to ./src/foo.ts.
Make the test runner glob recursive ('src/**/*.test.ts', quoted so Node's
test runner expands it), re-root the alias-specifiers scan at the test's own
directory (import.meta.dirname) instead of a single module's resolved path, and
copy sidecar sources recursively in stage-ts-assets.sh while still excluding
*.test.ts. No source files move; the current flat layout keeps working.
This was referenced Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 1/8 of the sidecar OOP refactor (architecture plan: strict instance-based OOP with DI, clear module boundaries).
Makes the sidecar's resolution/build/test infrastructure subdirectory-capable without moving any source files:
#sidecar/*import maps collapse from per-module enumeration to two wildcard entries (#sidecar/*.js→./src/*.ts,#sidecar/*→./src/*.ts); Node's longest-suffix pattern precedence keeps.js-suffixed specifiers mapping correctly.test/test:coverageuse a quoted recursive glob ('src/**/*.test.ts') expanded by Node's test runner.alias-specifiers.test.tsroots its scan atimport.meta.dirnameinstead of a single module's resolved location.stage-ts-assets.shcopies sources recursively (still excluding*.test.ts), preserving directory structure.Gate proven:
bun build --compileresolves the wildcard maps — staged binary + fullinfra/test-binary-smoke.shpass. Coverage 96.82% lines (gate ≥90).make format-allclean.Part of the staged refactor PR series; subsequent TS PRs stack on this branch.