TypeScript: a method call on an object imported through a re-export barrel produces no CALLS edge
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
调研方向
Start by reading the TypeScript import and export resolution code and the tests for named re-exports, especially the path from packages/lib/src/index.ts to repo.ts. Reproduce the issue with the seven-file workspace and compare the CALLS edges for viaPackage and viaOwnBarrel with viaDirect. Done when the re-exported findOne calls resolve and plainFn resolves through the import in both barrel cases.
由索引模型根据 Issue 内容生成。
描述
v0.12.1, macOS arm64, index_repository --mode full. Follow-up to #1974, which v0.12.0 fixed for us — thank you!
Repro
Seven files, a Bun/npm workspace with one library package that re-exports from src/index.ts.
package.json
{ "name": "barrel-repro", "private": true, "workspaces": ["apps/*", "packages/*"] }
packages/lib/package.json
{ "name": "@x/lib", "type": "module", "module": "src/index.ts" }
packages/lib/src/repo.ts
export const fooRepo = { async findOne(id: string) { return id } }
export function plainFn(id: string) { return id }
packages/lib/src/index.ts
export { fooRepo, plainFn } from './repo'
packages/lib/src/internal.ts — same package, through its own barrel
import { fooRepo, plainFn } from './index'
export async function viaOwnBarrel() { await fooRepo.findOne('c'); plainFn('c') }
apps/app/package.json
{ "name": "@x/app", "type": "module", "dependencies": { "@x/lib": "workspace:*" } }
apps/app/src/job.ts — through the package name
import { fooRepo, plainFn } from '@x/lib'
export async function viaPackage() { await fooRepo.findOne('a'); plainFn('a') }
apps/app/src/direct.ts — control: straight from the defining file
import { fooRepo, plainFn } from '../../../packages/lib/src/repo'
export async function viaDirect() { await fooRepo.findOne('b'); plainFn('b') }
Observed
IMPORTS edges are all there: job.ts → lib/src/index.ts, internal.ts → lib/src/index.ts, lib/src/index.ts → lib/src/repo.ts, direct.ts → lib/src/repo.ts.
CALLS edges:
| caller | → findOne |
→ plainFn |
|---|---|---|
viaDirect |
✅ lsp_ts_namespace |
✅ lsp_ts_import |
viaPackage |
❌ none (only USAGE → fooRepo) |
⚠️ unique_name |
viaOwnBarrel |
❌ none (only USAGE → fooRepo) |
⚠️ unique_name |
So the package specifier is not the problem — the same loss happens with a relative ./index barrel. The chain is lost at the export { … } from './repo' hop: the method on the re-exported object gets no edge at all, and the plain function lands only via the name heuristic rather than the import (with a non-unique name that path is not guaranteed). Same result with "main" or "exports": { ".": "./src/index.ts" } instead of "module".
Expected
A named re-export is followed to the defining module the way a direct import is, so viaPackage → findOne and viaOwnBarrel → findOne resolve like viaDirect → findOne, and plainFn resolves via the import.
Impact
Our Bun monorepo has one library package that re-exports its repositories (object literals) from src/index.ts; the other apps import them by package name. After v0.12.1 intra-package calls resolve, but every cross-app call to those repositories still shows zero callers — e.g. expireLapsedSubscriptions, needsRun, takeDirty, insertIncoming, bumpInbound, each with 1–2 real call sites. As in #1974, this is indistinguishable from a true negative.
Related but different: #1557 §3 (aliased re-exports produce no node), #2297 (renamed named import).
- 主要语言
- C
- 星标
- 45.8k
- 派生
- 3.8k
- 平均合并
- 3 天 6 小时
- 30 天内合并 PR
- 201
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DeusData/codebase-memory-mcp 的其他 Issue
-
Generated Pi extension (cbmem.ts) breaks Gemini/Antigravity: Type.Union of Type.Literal serializes to anyOf/const可能已有人在做 @divakantpandey 于 1 天前认领。 未关闭bug editor/integration
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2787 · 1 条评论 ·
维护者通常 2 天内回复
-
editor/integration parsing/quality
难度 2/5 1-3 小时 新手友好度 68/100
DeusData/codebase-memory-mcp#2286 ·
维护者通常 2 天内回复
-
install writes an unsupported `args` key into the Claude Code SubagentStart hook, so it never runs未关闭bug editor/integration priority/high stability/performance ux/behavior
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2239 · 1 条评论 ·
维护者通常 2 天内回复
-
bug priority/high ux/behavior
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2232 · 2 条评论 ·
维护者通常 2 天内回复
-
documentation editor/integration parsing/quality priority/normal
难度 2/5 1-3 小时 新手友好度 85/100
DeusData/codebase-memory-mcp#2169 ·
维护者通常 2 天内回复
查看 DeusData/codebase-memory-mcp 的全部 Issue
相似的 Issue
-
enhancement ui
难度 1/5 1 小时以内 新手友好度 72/100
ChupathingyCE/chupathingyce#485 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
JustAResearcher/gpu-unlock-ada#98 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
FujiNetWIFI/fujinet-firmware#2216 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 2 天内回复