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
TypeScript path aliases (@/, @common/) not resolved — imports treated as npm packages #575
When a project uses TypeScript path aliases (e.g. @/ → src/, configured in tsconfig.json or vite.config.ts), graphify's AST extractor treats aliased imports as bare npm package names and falls back to taking only the last path segment:
# extract.py, _import_js()else:
# Bare/scoped import (node_modules) - use last segment; dropped as externalmodule_name=raw.split("/")[-1]
tgt_nid=_make_id(module_name)
So import Foo from "@/components/Foo.vue" produces an edge pointing to node ID foo_vue instead of src_components_foo_vue. Since no node with that ID exists, the edge is effectively dangling and never connects to the actual file node.
Impact
In a Vue 3 + Vite project with @/ aliasing src/, 92 of 95 Storybook story files had zero connections to their component implementation files. The graph looked like stories were isolated islands, which made community detection and cross-file queries useless for that entire layer of the codebase.
Proposed fix
Add an optional alias_map: dict[str, str] parameter to extract() and resolve it inside _import_js() before the bare-import fallback:
The alias map could be populated automatically by reading tsconfig.jsoncompilerOptions.paths and/or vite.config.tsresolve.alias before calling extract(). Alternatively, a graphify.toml config file in the project root could let users declare aliases explicitly.
Workaround
For now I'm running a post-processing script after every /graphify and --update that injects the missing edges directly into graph.json. It works but requires the alias map to be maintained separately from the project's existing tsconfig.json.
Fixed: _import_js() now reads the nearest tsconfig.json compilerOptions.paths (cached per tsconfig file) and resolves path aliases (e.g. @/) to real paths before falling back to the bare-package branch.
Activity
safishamsi commentedon Apr 27, 2026
Fixed:
_import_js()now reads the nearesttsconfig.json compilerOptions.paths(cached per tsconfig file) and resolves path aliases (e.g.@/) to real paths before falling back to the bare-package branch.Fix 6 bugs: ID collisions, path portability, alias resolution, HTML c…
kurellajunior commentedon Apr 28, 2026
Wohaho… /me watching the implementation train run by
Do you guys do CD or how do I get this version running?It works in v0.5.2
You are awesome and greetings from my Claude to your Claude 😉
Fix 6 bugs: ID collisions, path portability, alias resolution, HTML c…