refactor: 重构项目结构,将 tracer 模块提取为独立子包

- 将 tracer 相关代码移动到 tracers.ts 子目录中
- 新增类型定义文件,统一管理命令类型
- 实现上下文管理机制,集中处理 tracer 命令
- 更新构建配置和依赖管理
- 移除旧的根目录文件,保持代码结构清晰
This commit is contained in:
2026-02-04 13:45:17 +08:00
parent c90f4a0244
commit a3bbd5638a
21 changed files with 468 additions and 53 deletions

View File

@@ -0,0 +1 @@
export * from './tracer-context';

View File

@@ -0,0 +1,22 @@
import type { TracerCommand } from '../types';
const createTracerContext = () => {
const commands: TracerCommand[] = [];
const getTracerContext = () => {
const command = (command: TracerCommand) => {
commands.push(command);
};
return {
commands,
command,
};
};
return {
getTracerContext,
};
};
export const { getTracerContext } = createTracerContext();