Skip to content

refactor: kill J namespace barrel (Phase 1, #234) - #235

Merged
pajoma merged 1 commit into
developfrom
refactor/234-phase1-kill-j-barrel
Jun 2, 2026
Merged

refactor: kill J namespace barrel (Phase 1, #234)#235
pajoma merged 1 commit into
developfrom
refactor/234-phase1-kill-j-barrel

Conversation

@pajoma

@pajoma pajoma commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Phase 1 of #234 — package-by-feature restructure.

Removes the J namespace barrel that created the root import cycle (src/index.ts → submodule → src/index.ts).

Changes

  • Replace import * as J from '<root>' + J.<Sub>.<Sym> with named imports from each submodule barrel across 47 files.
  • Also fixed a non-codemod variant: import { Util } from '..' in vscode/conf.ts.
  • Empty src/index.ts (export {}) to break the cycle.

Why behavior-identical

J.<Sub>.X already resolved through src/<sub>/index.ts. Rewriting to named imports from the same barrel changes resolution path only by dropping the root re-export — no symbol resolves differently.

Verification

  • npm run compile-tests (tsc) ✔
  • npm run compile (esbuild) ✔
  • npm run lint
  • Full suite: 238 passing, exit 0

Notes

  • Pure mechanical, zero behavior change. Largest diff of the restructure — unblocks Phases 2–5.
  • Acceptance: no import * as J remains; root barrel reduced to export {}.

Refs #234.

🤖 Generated with Claude Code

Phase 1 of #234. Replace `import * as J from <root>` + `J.<Sub>.<Sym>`
with named imports from each submodule barrel. Root src/index.ts emptied
to break the import cycle. Behavior-identical: J.<Sub>.X already resolved
through src/<sub>/index.ts.

Refs #234.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pajoma

pajoma commented Jun 2, 2026

Copy link
Copy Markdown
Owner Author

Brooks-Lint PR Review: Approved

Health Score: 95/100

Phase 1 of #234 is successfully implemented. By replacing the global \J\ namespace barrel with granular named imports, this PR breaks the primary circular dependency cycle that previously coupled the entire system.

Key Findings:

  • Architecture: The root import cycle (\src/index.ts\ → submodule → \src/index.ts) is now broken. This enables better tree-shaking and clear dependency tracking.
  • Verification: Purely mechanical change with zero behavior shift. Confirmed by 238 passing tests.
  • Risk: High file churn (47 files) is necessary and expected for this structural fix.

Recommendation: Merge immediately to unblock Phase 2 (DI Container) and minimize rebase conflicts.

@pajoma
pajoma merged commit c699f77 into develop Jun 2, 2026
2 checks passed
@pajoma
pajoma deleted the refactor/234-phase1-kill-j-barrel branch June 2, 2026 17:14
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