Skip to content

refactor: 清理死代码与冗余导出 - #17

Merged
zavier merged 2 commits into
mainfrom
refactor/dead-code-cleanup
Aug 1, 2026
Merged

refactor: 清理死代码与冗余导出#17
zavier merged 2 commits into
mainfrom
refactor/dead-code-cleanup

Conversation

@zavier

@zavier zavier commented Aug 1, 2026

Copy link
Copy Markdown
Owner

全仓库死代码审查 + 文档同步

变更内容

refactor 清理(14 文件,+20/−124):

  • 删除零引用的 showWorkspacePanel(switch.ts 76 行),连坐清理 sendUnconfiguredHintdb-workspace-panel 消息渲染器(唯一发送方已删)
  • 12 个仅模块内部使用的导出去 export(QueryOptions/QueryOutput/MutationOutput/ConnectionConfig/ConnectionsFile/ConfigLoadResult/FavoriteFilter/DocumentAudience/RenderOptions/MutationValidation/BrowserContent/toRelatedTuiData 等)
  • 4 处未使用变量:3 处参数加 _ 前缀(遵循既有 _kb 约定)、createConnection 删除完全冗余的 env 参数并同步调用点
  • 临时开启 --noUnusedLocals --noUnusedParameters 验证清零

docs 同步(5 文件,+10/−13):候选 4-6 落地后的文档现状对齐(StoredRelation、er-diagram 移除、executeMutation 片段)

为什么

8 个架构候选落地后,零引用导出、死函数与冗余参数沉淀在公开面上。清理后接口面更窄、模块更内聚(AGENTS.md"模块内部类型留在模块内")。

验证

  • npm run check(tsc)+ 临时 noUnusedLocals 检查通过
  • npm test 241 通过
  • npm run lint 0 errors(12 warnings 存量)
  • npm run fmt + fmt:check 通过

zavier added 2 commits August 1, 2026 21:33
候选 4-6 落地后文档同步:
- architecture:facade 签名 RelationRow→StoredRelation、延迟连接描述去掉已私有化的方法名
- relation-tool-redesign:接口记录同步 StoredRelation、er-diagram 标记为已移除
- test-plan/ai-runner:移除 er-diagram 用例(G11),G10 描述改为表结构文本
- mutation-tool-design:executeMutation 片段删除不可达的 timeout 选项
全仓库死代码审查:
- 删除零引用的 showWorkspacePanel,连坐清理 sendUnconfiguredHint 与
  db-workspace-panel 消息渲染器(唯一发送方已删)
- 12 个仅模块内部使用的导出去 export(QueryOptions/QueryOutput/
  MutationOutput/ConnectionConfig/ConnectionsFile/ConfigLoadResult/
  FavoriteFilter/DocumentAudience/RenderOptions/MutationValidation/
  BrowserContent/toRelatedTuiData 等),模块内聚、接口面收窄
- 4 处未使用变量:3 处参数加 _ 前缀(遵循既有 _kb 约定),
  createConnection 删除完全冗余的 env 参数并同步调用点
- 临时开启 noUnusedLocals/noUnusedParameters 验证清零
@zavier
zavier merged commit 9636ce4 into main Aug 1, 2026
1 check passed
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.

1 participant