Repository navigation
Conversation
The registry comment asked for a repo to verify these against before adding them; this is that verification. Both rows satisfy the invariant extractContainer relies on — the body node starts on the row of the block's opening delimiter, so its slice begins with that line's newline and body.startPosition.row is the shift. Svelte is Vue's shape exactly (script_element/raw_text). Astro holds the same property for a different reason: frontmatter_js_block starts on the opening --- rather than after it, so it shares the shift instead of needing a +1. Astro's row indexes the --- frontmatter only, not the <script> tags that may also appear in the template — the frontmatter is where imports, the Props interface and module-level code live, and it is the block whose edges make a component resolve into the graph. Verified against a 155-component Astro site: all 86 extracted symbols landed on the right line, and 58 edges from components into src/lib that were previously invisible now resolve. That under-reporting was the real cost — `graft callers <sym>` on a module imported by components silently missed every component using it. supported-extensions.test.ts used .svelte as its unsupported example and said in its header that the day someone added it, that file is where the substitution happens; .hbs carries that side now. Co-Authored-By: Claude Opus 5 <[email protected]>
🌱 graft blast radius1 area changed → 5 areas can be affected. 12 dependent symbols, depth 2. flowchart TB
A0(("Dependency Graph<br/>6 symbols"))
A1(("Build Review<br/>2 symbols"))
A2(("CLI Engine<br/>2 symbols"))
A3(("Build Context<br/>1 symbol"))
A4(("MCP Tools<br/>1 symbol"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1,A2,A3,A4 reached;
Who knows this code — 4 people across 6 areas
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no All 12 dependent symbols, grouped by areaDependency Graph — 6 symbols in 6 files
Build Review — 2 symbols in 2 files
CLI Engine — 2 symbols in 2 files
Build Context — 1 symbol in 1 file
MCP Tools — 1 symbol in 1 file
Test signal per changed area — 1 –Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
33 test suites also reference this code33 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
What
Registers
.svelteand.astroinCONTAINER_LANGS, alongside.vue.Both grammars already ship in the bundled
tree-sitter-wasm, so this adds no dependency.Why now
The registry comment asks for exactly one thing before these rows land:
This PR is that verification. I ran a patched build against a 155-component Astro site:
.astrocomponents intosrc/libnow resolve — previously invisible.That second number is the actual cost of the gap.
graft callers <sym>on a module imported by components was silently under-reporting: it returned the.tscall sites and missed every component. On an Astro repo that is most of the callers, and the failure is quiet — you get a confident, incomplete answer right before a rename.The span invariant
extractContainerusesconst shift = body.startPosition.row, which is correct only when the body slice begins with the opening delimiter line's newline.script_elementwrappingraw_text— so the same reasoning carries over unchanged.frontmatter_js_blockstarts on the opening---rather than after it, so its slice also begins with that newline and it shares the shift instead of needing a+1. Taking the outerfrontmatternode as the body would look equivalent and move every symbol up one line.One structural caveat I'd rather state than have you find: Astro frontmatter is always the first thing in the file, so
startPosition.rowis always 0 and no fixture can exercise a nonzero shift for it. The risk there is the delimiter off-by-one, so the Astro fixtures put symbols several lines into the block — either direction fails. Svelte does exercise a nonzero offset (markup above the script).Scope
Astro's row indexes the
---frontmatter only, not<script>tags that may also appear in the template. The frontmatter is where imports, thePropsinterface and module-level code live, and it's the block whose edges make a component resolve into the rest of the graph. Client-side<script>blocks would be a follow-up, andContainerLangtakes a singleblocktoday.Markup is still not indexed for any container language — unchanged from
.vue.Tests
Six new cases in
test/container-extract.test.ts, mirroring the Vue ones: registry/-eclaims, span fixtures for both formats, degradation to a file node when there's no usable block, the file node covering the whole component, an end-to-end build asserting a resolved.astro→.tscall edge, and a clean-buildcheck(the #236 shape).test/supported-extensions.test.tsused.svelteas its unsupported example and its header says that the day someone adds it, that file is where the substitution happens. Done —.hbscarries that side now.Full suite: 1250 pass, 0 fail, 1 skipped.
Also
.vuesupport was invisible to readers too.🤖 Generated with Claude Code