architecture #
svelte-docinfo analyzes its own source and draws the result below. Each node is one module
under src/lib/; each arrow is an internal import. Layers fall out of the import
graph itself, not asserted in prose but observed in data. Hover any module to isolate its
immediate neighbors; click to jump to its API page.
How to read it #
- Arrows point from importer to imported: X depends on Y. Reads with gravity, so dependencies fall downward toward the foundation.
- Layers are assigned by longest-path-from-sink. A module's layer is one plus the deepest layer it transitively depends on. Sinks (no internal imports) land at the bottom.
- Hover a module to isolate its immediate neighbors. Edges split by direction: what the module depends on and what depends on it.
What the layers say #
The bottom rows are the primitives that nothing in the library depends on transitively: path normalization, types, concurrency caps, the diagnostics schema. The middle rows are the per-kind TypeScript extractors and the file-system helpers. The top rows are the orchestrators: the persistent session on top of core analysis, then the one-shot wrappers, then the vite plugin and cli entries.
Across 30 modules and 69 internal imports, the graph is naturally acyclic, so no back-edges had to be reversed to lay it out.
How this was drawn #
The layout is precomputed at build time by dependency_graph.gen.json.ts, which
reads library.json (itself generated by library.gen.ts via analyze) and runs a Sugiyama-style layered layout:
longest-path-from-sink for layer assignment, dummy nodes on long edges, median-heuristic
crossing reduction. The result is a small JSON sibling the Svelte component renders to SVG.
No layout libraries. About 300 lines, end to end.