Repository navigation
refactor(core): move compile facade out of index.ts barrel - #2038
Merged
Merged
Conversation
Relocates the ~1,480 lines of compile-pipeline implementation from packages/core/src/index.ts into two new deep-path modules: - src/compile/compile.ts: CompileOptions/CompileResult types, _compileFromPreparedInput/_compileCore/_compileProjectCore, compile()/compileProject() overloads, the deprecated compileOrgView()/compileProjectOrgView() wrappers, buildNodeMetadata/buildDeployNodeMetadata, the multi-level SVG builders (buildDrillDownSvg, renderEntityView, buildAllLayersSvg*, buildDrillDownSvgOrg, buildAllViewsSvg, buildAllViewsSvgProject), and diagnosticToWarning. - src/compile/compile-diff.ts: the diff-compile facade (resolveBeforeAfter/assembleDiffSheets/toDiffStateMaps helpers extracted in the first #2014 batch, compileSystemDiff, compileDeployDiff, compileOrgDiff, buildAllViewsSvgDiffProject). index.ts now only re-exports this surface (`export { ... } from "./compile/compile.js"` / "./compile/compile-diff.js"`) alongside its existing barrel exports — same names, same types, zero behavior change. Refs #2014 (point 2)
…facade move - oxfmt reformats compile-diff.ts (multi-line import wrap) - ADR-20260616-01 / ADR-20260714-04 machine-checkable "grep" assumptions pointed at packages/core/src/index.ts for text that now lives in packages/core/src/compile/compile.ts after the facade extraction Refs #2014 (point 2)
…extraction # Conflicts: # packages/core/src/index.ts
This was referenced Oct 31, 2026
kompiro
added a commit
that referenced
this pull request
Oct 31, 2026
…ations (#3425) * docs(tpl): 2026-10 deprecation review, refresh 15 TPLs with stale citations Repoint line-number citations whose code moved (index.ts split in #2038, needsQuotes rewrite in #2707, diagLocFormatter in #2715, spec/CSS drift), drop citations of sites the VS Code shared viewer removed (#3312), record that the gh-aw consumer of TPL-2658/TPL-2786 left in #3423, and drop the "experimental" facet headings that language v2.0 removed (#2677). Refs #3357 Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tpl): address local review on the 2026-10 TPL review Correct the BARE_ID_PATTERN history in TPL-1101 (the keyword copy was RESERVED_KEYWORDS), repoint TPL-239's drifted cli/index.ts:442 citation to program.parseAsync, drop an em dash in TPL-1503, and place TPL-2996's origin section before the known patterns like TPL-2658/TPL-2786. Refs #3357 Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tpl): name #3423 as the gh-aw removal in absent-path markers #3421 tracks the revival; the workflows and their safety test were removed by #3423 (ADR-3421). Refs #3357 Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tpl): drop TPL-2791's citation of the function #3422 removed detectCyclicDependencies left warnings.ts when #3422 moved the cyclic flag to model construction; the TPL body already names findCyclicDependencies and markCyclicEdges in parser/cyclic-dependencies.ts. Refs #3357 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
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.
Summary
Second point of the
packages/corerefactoring plan in #2014 (point 1/3/7/8 landed in #2026). Moves the ~1,480-line compile-pipeline implementation out ofpackages/core/src/index.tsinto two new deep-path modules underpackages/core/src/compile/, usingoxlint'sno-restricted-importsrule (barrel imports forbidden insidepackages/core/src/**) as the guardrail.src/compile/compile.ts:CompileOptions/CompileResulttypes,_compileFromPreparedInput/_compileCore/_compileProjectCore, thecompile()/compileProject()overloads, the deprecatedcompileOrgView()/compileProjectOrgView()wrappers,buildNodeMetadata/buildDeployNodeMetadata, the multi-level SVG builders (buildDrillDownSvg,renderEntityView,buildAllLayersSvg/buildAllLayersSvgOrg,buildDrillDownSvgOrg,buildAllViewsSvg,buildAllViewsSvgProject), anddiagnosticToWarning.src/compile/compile-diff.ts: the diff-compile facade —resolveBeforeAfter/assembleDiffSheets/toDiffStateMaps(the helpers extracted in the first refactor(core): dedupe compile-diff pipelines, CJK width heuristic, and layout decomposition opportunities #2014 batch, refactor(core): dedupe diff pipelines, CJK width heuristic, and micro-duplications (first batch of #2014) #2026),compileSystemDiff,compileDeployDiff,compileOrgDiff,buildAllViewsSvgDiffProject.index.tsnow only re-exports this surface (export { ... } from "./compile/compile.js"/"./compile/compile-diff.js") alongside its existing barrel exports. Same names, same types — zero behavior change. Only import paths were adjusted from./xto../x; no logic was touched.Also fixed two ADR machine-checkable
grep:assumptions (ADR-20260616-01,ADR-20260714-04) that pointed at text now living incompile/compile.tsinstead ofindex.ts.Why this split (and not more)
compile.tsandcompile-diff.tshave no interdependency (each imports directly fromrenderer/,view/,resolver/,fs/,builtins/,diff/) so there's no risk of a cycle between them, confirmed bypnpm check:cycles.NodeMetadata,PreparedCompileInput,buildNodeMetadata,buildDeployNodeMetadata,diagnosticToWarning, and the diff helpers stay private (not re-exported) — they were never part of the public surface.Verification
pnpm --filter @karasu-tools/core testpnpm typecheck(full repo, all 9 packages)pnpm check:cyclespnpm knip@resvg/resvg-wasmconfig hint, unrelated)pnpm lintpnpm adr:check-assumptionsByte-identity render check
Wrote a harness (
tsxscript importing@karasu-tools/core'sindex.tsdirectly, once pointed atmainand once at this branch) that renders every bundled example project viabuildAllViewsSvgProjectin bothdefaultandicondisplay modes:diff -rqexit 0) across all example projects (getting-started,deploy-only,org-only,client-mcp,feature-samples,multi-file-system, allec-platformvariants, ja + en).JSON.stringify) also byte-identical for all 52 renders.Separately exercised the relocated
compile/compile-diff.tsfacade specifically (not covered by the non-diff harness above): renderedbuildAllViewsSvgDiffProjectfor 4 example projects × 2 display modes (before = full project, after = truncated copy, to exercise added/removed/changed diff states across system/deploy/org views) — 8/8 diff SVGs + diff-metadata JSON byte-identical betweenmainand this branch.No changeset: internal refactor only, the public export surface (
index.ts) is unchanged in names and types.Refs #2014
🤖 Generated with Claude Code