基于 AST(抽象语法树)的 TypeScript 代码差异分析工具,比传统文本 diff 更准确地捕捉语义级变更。
bun install
bun d <base> <head> [-v|-vv|-vvv]
<base> - 基准文件/目录路径<head> - 目标文件/目录路径-v - 显示更多细节(可叠加:-v、-vv、-vvv)bun check <file>
输出该文件的 AST 节点结构和导出信息。
import type 类型导入import()export default 变更T extends U ? X : Y){ [P in K]: T })keyof / typeof 操作符infer 类型推断declare 语句as const 断言satisfies 表达式!)in/instanceof)@ts-ignore 等)declare global 扩展# 对比两个文件
bun d ./old.ts ./new.ts
# 对比两个目录
bun d ./src-old ./src-new
# 详细模式
bun d ./old.ts ./new.ts -vv
# 诊断文件结构
bun check ./src/main.ts
+ - 新增内容Δ - 变更内容- - 删除内容