Skip to content

fix(imports): extract imports from Svelte and Vue script blocks#224

Open
jmcmacnz wants to merge 1 commit intoDeusData:mainfrom
jmcmacnz:fix-svelte-import-extraction
Open

fix(imports): extract imports from Svelte and Vue script blocks#224
jmcmacnz wants to merge 1 commit intoDeusData:mainfrom
jmcmacnz:fix-svelte-import-extraction

Conversation

@jmcmacnz
Copy link
Copy Markdown

@jmcmacnz jmcmacnz commented Apr 8, 2026

Fixes #223

Summary

  • extract imports from embedded <script> blocks in .svelte and .vue files
  • re-parse script_element -> raw_text content with the JavaScript grammar and reuse the existing ES import walker
  • add regression coverage for Svelte and Vue import extraction

Why

Svelte and Vue files are discovered and parsed, but their root AST is markup-oriented rather than plain JS/TS. Imports live inside document -> script_element -> raw_text, so they never reached the normal ES import extraction path.

Validation

  • built the local binary from this branch with scripts/build.sh
  • indexed a downstream Svelte repo using the local binary directly
  • verified that src/App.svelte now produces 7 IMPORTS edges to relative imports including:
    • src/components/TopNavigation.svelte
    • src/components/TreeView.svelte
    • src/components/AdCanvas.svelte
  • confirmed alias imports like $lib/... and @/... still remain unresolved, which is expected and out of scope for this PR

@DeusData
Copy link
Copy Markdown
Owner

Hey, thanks for building this. Will review ASAP once I am back on the 15th :)

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.

Fix import extraction for Svelte and Vue script blocks

2 participants