Skip to content

refactor(ts): TS-0 — subdirectory-capable module resolution - #63

Merged
gocanto merged 2 commits into
mainfrom
refactor/ts0-resolution-infra
Jul 24, 2026
Merged

refactor(ts): TS-0 — subdirectory-capable module resolution#63
gocanto merged 2 commits into
mainfrom
refactor/ts0-resolution-infra

Conversation

@gocanto

@gocanto gocanto commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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:

  • Both #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:coverage use a quoted recursive glob ('src/**/*.test.ts') expanded by Node's test runner.
  • alias-specifiers.test.ts roots its scan at import.meta.dirname instead of a single module's resolved location.
  • stage-ts-assets.sh copies sources recursively (still excluding *.test.ts), preserving directory structure.

Gate proven: bun build --compile resolves the wildcard maps — staged binary + full infra/test-binary-smoke.sh pass. Coverage 96.82% lines (gate ≥90). make format-all clean.

Part of the staged refactor PR series; subsequent TS PRs stack on this branch.

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.
@gocanto
gocanto merged commit 495f941 into main Jul 24, 2026
9 checks passed
@gocanto
gocanto deleted the refactor/ts0-resolution-infra branch July 24, 2026 02:47
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