You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix import extraction for Svelte and Vue script blocks #223
Svelte and Vue files are discovered and parsed, but imports inside their <script> blocks are not extracted into IMPORTS edges.
Root cause
cbm_extract_imports() only routes JavaScript, TypeScript, and TSX through the ES import walker. Svelte and Vue parse to a markup-oriented AST at the root, where imports live inside document -> script_element -> raw_text, so they never reach the normal ES import extraction path.
Proposed fix
add a Svelte/Vue-specific import extractor in internal/cbm/extract_imports.c
find script_element -> raw_text
re-parse the embedded script text with the JavaScript grammar
run the existing ES import walker on that sub-tree
add regression tests for .svelte and .vue import extraction
Validation
I verified this against a downstream Svelte repo after building the local branch:
before the fix: src/App.svelte had zero outgoing IMPORTS edges
after the fix: src/App.svelte produced 7 IMPORTS edges to relative imports such as:
src/components/TopNavigation.svelte
src/components/TreeView.svelte
src/components/AdCanvas.svelte
Alias imports like $lib/... and @/... still do not resolve, but that is a separate pipeline concern and not part of this fix.
Scope
This issue is only about extracting imports from embedded script blocks in .svelte / .vue files.
Activity
DeusData commentedon Apr 8, 2026
Hey, thanks for finding this. Will get on it when I am back after the 15th :)
fix(imports): extract ES imports from embedded <script> blocks (DeusD…
fix(imports): extract ES imports from embedded <script> blocks (DeusD…
fix(imports): extract ES imports from embedded <script> blocks (DeusD…
fix(imports): extract ES imports from embedded <script> blocks (#224)