Builds on #130 (re-export chain following). On v0.9.8 several common barrel forms are still not resolved, so the symbol-level edge between a consumer and the re-exported definition is never created. This affects both directions:
codegraph_callees leaves the barrel as a raw, unresolved import node (no edge to the real symbol).
codegraph_callers / codegraph_impact of the underlying definition return 0 — a false "orphan". This is risky because 0 callers is the canonical dead-code signal, so it can lead to deleting live code.
Still-missed forms (after #130)
#130 covered export { a, b as c } from '...', export * from '...', and export * as ns from '...'. The following are still missed:
- Default re-export —
export { default as Foo } from './Foo.svelte'. Re-exporting the default binding (ubiquitous for Svelte / React component barrels). A .svelte file's component (its default export) is not matched as default.
- Bare directory import —
import { Foo } from './' (or from '.'), which should resolve to ./index.ts. The specifier is not mapped to the directory's index.ts.
- Workspace package-subpath barrels —
import { X } from '@scope/pkg/sub' → packages/pkg/.../sub/index.ts → x.svelte.
Minimal repro
// lib/foo/Foo.svelte — a Svelte component (default export)
// lib/foo/index.ts
export { default as Foo } from './Foo.svelte';
// lib/Bar.svelte
import { Foo } from './foo'; // uses <Foo /> in markup
codegraph callees Bar
-> lists "./foo (import)" as a raw unresolved node; no edge to Foo / Foo.svelte
codegraph callers Foo
-> No callers found (expected: Bar)
- Querying the alias name (
callers Foo, where Foo is the re-exported name) returns at most the import line of some consumers and misses others; it is never unified with the underlying component node.
- The package-subpath form behaves the same:
import { X } from '@scope/pkg/sub' → callees shows @scope/pkg/sub (import) raw; callers X = 0 despite many importers.
Expected
Resolve these re-export forms so the consumer↔definition edge exists in both callees and callers / impact:
export { default as X } from './X.svelte' (map a .svelte default export to its component node),
- bare
'./' / '.' → index.ts,
- workspace package-subpath barrels (
@scope/pkg/sub → its index.ts).
Why it matters
Barrels (index.ts aggregators) are universal in TS / Svelte / React component libraries. A false 0 callers defeats the primary use case of callers / impact (safe refactor / dead-code detection). Observed in a Svelte 5 + SvelteKit 2 bun-workspace monorepo (~600 files indexed): multiple live components reported 0 callers and minimal impact purely because they are consumed through these barrel forms — only an external grep revealed they were live. The forward callees check confirms the barrel import is left unresolved, so this is an edge-creation gap, not only a query-side issue.
Environment
- codegraph v0.9.8 (
node:sqlite backend)
- Windows 11
- TypeScript + Svelte (SvelteKit 2 / Svelte 5), bun workspace monorepo
Builds on #130 (re-export chain following). On v0.9.8 several common barrel forms are still not resolved, so the symbol-level edge between a consumer and the re-exported definition is never created. This affects both directions:
codegraph_calleesleaves the barrel as a raw, unresolvedimportnode (no edge to the real symbol).codegraph_callers/codegraph_impactof the underlying definition return0— a false "orphan". This is risky because0 callersis the canonical dead-code signal, so it can lead to deleting live code.Still-missed forms (after #130)
#130 covered
export { a, b as c } from '...',export * from '...', andexport * as ns from '...'. The following are still missed:export { default as Foo } from './Foo.svelte'. Re-exporting thedefaultbinding (ubiquitous for Svelte / React component barrels). A.sveltefile's component (its default export) is not matched asdefault.import { Foo } from './'(orfrom '.'), which should resolve to./index.ts. The specifier is not mapped to the directory'sindex.ts.import { X } from '@scope/pkg/sub'→packages/pkg/.../sub/index.ts→x.svelte.Minimal repro
callers Foo, whereFoois the re-exported name) returns at most the import line of some consumers and misses others; it is never unified with the underlying component node.import { X } from '@scope/pkg/sub'→calleesshows@scope/pkg/sub (import)raw;callers X=0despite many importers.Expected
Resolve these re-export forms so the consumer↔definition edge exists in both
calleesandcallers/impact:export { default as X } from './X.svelte'(map a.sveltedefault export to its component node),'./'/'.'→index.ts,@scope/pkg/sub→ itsindex.ts).Why it matters
Barrels (
index.tsaggregators) are universal in TS / Svelte / React component libraries. A false0 callersdefeats the primary use case ofcallers/impact(safe refactor / dead-code detection). Observed in a Svelte 5 + SvelteKit 2 bun-workspace monorepo (~600 files indexed): multiple live components reported0 callersand minimalimpactpurely because they are consumed through these barrel forms — only an externalgreprevealed they were live. The forwardcalleescheck confirms the barrel import is left unresolved, so this is an edge-creation gap, not only a query-side issue.Environment
node:sqlitebackend)