@mycodemap/mycodemap 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/README.md +559 -0
- package/dist/ai/claude.d.ts +38 -0
- package/dist/ai/claude.d.ts.map +1 -0
- package/dist/ai/claude.js +169 -0
- package/dist/ai/claude.js.map +1 -0
- package/dist/ai/codex.d.ts +38 -0
- package/dist/ai/codex.d.ts.map +1 -0
- package/dist/ai/codex.js +169 -0
- package/dist/ai/codex.js.map +1 -0
- package/dist/ai/factory.d.ts +48 -0
- package/dist/ai/factory.d.ts.map +1 -0
- package/dist/ai/factory.js +95 -0
- package/dist/ai/factory.js.map +1 -0
- package/dist/ai/index.d.ts +12 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +29 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/provider.d.ts +70 -0
- package/dist/ai/provider.d.ts.map +1 -0
- package/dist/ai/provider.js +31 -0
- package/dist/ai/provider.js.map +1 -0
- package/dist/ai/subagent-caller.d.ts +90 -0
- package/dist/ai/subagent-caller.d.ts.map +1 -0
- package/dist/ai/subagent-caller.js +280 -0
- package/dist/ai/subagent-caller.js.map +1 -0
- package/dist/ai/types.d.ts +70 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +5 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/cache/file-hash-cache.d.ts +76 -0
- package/dist/cache/file-hash-cache.d.ts.map +1 -0
- package/dist/cache/file-hash-cache.js +159 -0
- package/dist/cache/file-hash-cache.js.map +1 -0
- package/dist/cache/index.d.ts +151 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +303 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/lru-cache.d.ts +93 -0
- package/dist/cache/lru-cache.d.ts.map +1 -0
- package/dist/cache/lru-cache.js +194 -0
- package/dist/cache/lru-cache.js.map +1 -0
- package/dist/cache/parse-cache.d.ts +68 -0
- package/dist/cache/parse-cache.d.ts.map +1 -0
- package/dist/cache/parse-cache.js +173 -0
- package/dist/cache/parse-cache.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +96 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +567 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/ci.d.ts +25 -0
- package/dist/cli/commands/ci.d.ts.map +1 -0
- package/dist/cli/commands/ci.js +481 -0
- package/dist/cli/commands/ci.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +70 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +479 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +10 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +202 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +61 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +340 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +8 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +61 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +55 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +455 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +50 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/query.d.ts +22 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +718 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/watch-foreground.d.ts +9 -0
- package/dist/cli/commands/watch-foreground.d.ts.map +1 -0
- package/dist/cli/commands/watch-foreground.js +67 -0
- package/dist/cli/commands/watch-foreground.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +12 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +114 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +25 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +488 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +115 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/paths.d.ts +90 -0
- package/dist/cli/paths.d.ts.map +1 -0
- package/dist/cli/paths.js +136 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/runtime-logger.d.ts +13 -0
- package/dist/cli/runtime-logger.d.ts.map +1 -0
- package/dist/cli/runtime-logger.js +213 -0
- package/dist/cli/runtime-logger.js.map +1 -0
- package/dist/core/analyzer.d.ts +3 -0
- package/dist/core/analyzer.d.ts.map +1 -0
- package/dist/core/analyzer.js +359 -0
- package/dist/core/analyzer.js.map +1 -0
- package/dist/core/ast-complexity-analyzer.d.ts +40 -0
- package/dist/core/ast-complexity-analyzer.d.ts.map +1 -0
- package/dist/core/ast-complexity-analyzer.js +279 -0
- package/dist/core/ast-complexity-analyzer.js.map +1 -0
- package/dist/core/global-index.d.ts +69 -0
- package/dist/core/global-index.d.ts.map +1 -0
- package/dist/core/global-index.js +388 -0
- package/dist/core/global-index.js.map +1 -0
- package/dist/generator/ai-overview.d.ts +51 -0
- package/dist/generator/ai-overview.d.ts.map +1 -0
- package/dist/generator/ai-overview.js +160 -0
- package/dist/generator/ai-overview.js.map +1 -0
- package/dist/generator/context.d.ts +5 -0
- package/dist/generator/context.d.ts.map +1 -0
- package/dist/generator/context.js +514 -0
- package/dist/generator/context.js.map +1 -0
- package/dist/generator/file-describer.d.ts +93 -0
- package/dist/generator/file-describer.d.ts.map +1 -0
- package/dist/generator/file-describer.js +375 -0
- package/dist/generator/file-describer.js.map +1 -0
- package/dist/generator/index.d.ts +8 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +259 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.d.ts +75 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.js +242 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/base-adapter.d.ts +24 -0
- package/dist/orchestrator/adapters/base-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/base-adapter.js +2 -0
- package/dist/orchestrator/adapters/base-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/codemap-adapter.d.ts +56 -0
- package/dist/orchestrator/adapters/codemap-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/codemap-adapter.js +163 -0
- package/dist/orchestrator/adapters/codemap-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/index.d.ts +10 -0
- package/dist/orchestrator/adapters/index.d.ts.map +1 -0
- package/dist/orchestrator/adapters/index.js +3 -0
- package/dist/orchestrator/adapters/index.js.map +1 -0
- package/dist/orchestrator/ai-feed-generator.d.ts +210 -0
- package/dist/orchestrator/ai-feed-generator.d.ts.map +1 -0
- package/dist/orchestrator/ai-feed-generator.js +377 -0
- package/dist/orchestrator/ai-feed-generator.js.map +1 -0
- package/dist/orchestrator/commit-validator.d.ts +30 -0
- package/dist/orchestrator/commit-validator.d.ts.map +1 -0
- package/dist/orchestrator/commit-validator.js +87 -0
- package/dist/orchestrator/commit-validator.js.map +1 -0
- package/dist/orchestrator/confidence.d.ts +25 -0
- package/dist/orchestrator/confidence.d.ts.map +1 -0
- package/dist/orchestrator/confidence.js +138 -0
- package/dist/orchestrator/confidence.js.map +1 -0
- package/dist/orchestrator/file-header-scanner.d.ts +48 -0
- package/dist/orchestrator/file-header-scanner.d.ts.map +1 -0
- package/dist/orchestrator/file-header-scanner.js +158 -0
- package/dist/orchestrator/file-header-scanner.js.map +1 -0
- package/dist/orchestrator/git-analyzer.d.ts +192 -0
- package/dist/orchestrator/git-analyzer.d.ts.map +1 -0
- package/dist/orchestrator/git-analyzer.js +539 -0
- package/dist/orchestrator/git-analyzer.js.map +1 -0
- package/dist/orchestrator/index.d.ts +20 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +16 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/intent-router.d.ts +41 -0
- package/dist/orchestrator/intent-router.d.ts.map +1 -0
- package/dist/orchestrator/intent-router.js +98 -0
- package/dist/orchestrator/intent-router.js.map +1 -0
- package/dist/orchestrator/result-fusion.d.ts +114 -0
- package/dist/orchestrator/result-fusion.d.ts.map +1 -0
- package/dist/orchestrator/result-fusion.js +332 -0
- package/dist/orchestrator/result-fusion.js.map +1 -0
- package/dist/orchestrator/test-linker.d.ts +166 -0
- package/dist/orchestrator/test-linker.d.ts.map +1 -0
- package/dist/orchestrator/test-linker.js +570 -0
- package/dist/orchestrator/test-linker.js.map +1 -0
- package/dist/orchestrator/tool-orchestrator.d.ts +108 -0
- package/dist/orchestrator/tool-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/tool-orchestrator.js +247 -0
- package/dist/orchestrator/tool-orchestrator.js.map +1 -0
- package/dist/orchestrator/types.d.ts +162 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +39 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/workflow/ci-executor.d.ts +157 -0
- package/dist/orchestrator/workflow/ci-executor.d.ts.map +1 -0
- package/dist/orchestrator/workflow/ci-executor.js +423 -0
- package/dist/orchestrator/workflow/ci-executor.js.map +1 -0
- package/dist/orchestrator/workflow/config.d.ts +97 -0
- package/dist/orchestrator/workflow/config.d.ts.map +1 -0
- package/dist/orchestrator/workflow/config.js +115 -0
- package/dist/orchestrator/workflow/config.js.map +1 -0
- package/dist/orchestrator/workflow/git-analyzer.d.ts +173 -0
- package/dist/orchestrator/workflow/git-analyzer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/git-analyzer.js +473 -0
- package/dist/orchestrator/workflow/git-analyzer.js.map +1 -0
- package/dist/orchestrator/workflow/index.d.ts +21 -0
- package/dist/orchestrator/workflow/index.d.ts.map +1 -0
- package/dist/orchestrator/workflow/index.js +21 -0
- package/dist/orchestrator/workflow/index.js.map +1 -0
- package/dist/orchestrator/workflow/phase-checkpoint.d.ts +38 -0
- package/dist/orchestrator/workflow/phase-checkpoint.d.ts.map +1 -0
- package/dist/orchestrator/workflow/phase-checkpoint.js +75 -0
- package/dist/orchestrator/workflow/phase-checkpoint.js.map +1 -0
- package/dist/orchestrator/workflow/phase-inheritance.d.ts +128 -0
- package/dist/orchestrator/workflow/phase-inheritance.d.ts.map +1 -0
- package/dist/orchestrator/workflow/phase-inheritance.js +266 -0
- package/dist/orchestrator/workflow/phase-inheritance.js.map +1 -0
- package/dist/orchestrator/workflow/result-fusion.d.ts +117 -0
- package/dist/orchestrator/workflow/result-fusion.d.ts.map +1 -0
- package/dist/orchestrator/workflow/result-fusion.js +246 -0
- package/dist/orchestrator/workflow/result-fusion.js.map +1 -0
- package/dist/orchestrator/workflow/templates.d.ts +116 -0
- package/dist/orchestrator/workflow/templates.d.ts.map +1 -0
- package/dist/orchestrator/workflow/templates.js +546 -0
- package/dist/orchestrator/workflow/templates.js.map +1 -0
- package/dist/orchestrator/workflow/test-linker.d.ts +152 -0
- package/dist/orchestrator/workflow/test-linker.d.ts.map +1 -0
- package/dist/orchestrator/workflow/test-linker.js +342 -0
- package/dist/orchestrator/workflow/test-linker.js.map +1 -0
- package/dist/orchestrator/workflow/types.d.ts +202 -0
- package/dist/orchestrator/workflow/types.d.ts.map +1 -0
- package/dist/orchestrator/workflow/types.js +4 -0
- package/dist/orchestrator/workflow/types.js.map +1 -0
- package/dist/orchestrator/workflow/visualizer.d.ts +56 -0
- package/dist/orchestrator/workflow/visualizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/visualizer.js +300 -0
- package/dist/orchestrator/workflow/visualizer.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-context.d.ts +50 -0
- package/dist/orchestrator/workflow/workflow-context.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-context.js +105 -0
- package/dist/orchestrator/workflow/workflow-context.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts +126 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.js +489 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-persistence.d.ts +38 -0
- package/dist/orchestrator/workflow/workflow-persistence.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-persistence.js +166 -0
- package/dist/orchestrator/workflow/workflow-persistence.js.map +1 -0
- package/dist/parser/implementations/fast-parser.d.ts +65 -0
- package/dist/parser/implementations/fast-parser.d.ts.map +1 -0
- package/dist/parser/implementations/fast-parser.js +299 -0
- package/dist/parser/implementations/fast-parser.js.map +1 -0
- package/dist/parser/implementations/smart-parser.d.ts +220 -0
- package/dist/parser/implementations/smart-parser.d.ts.map +1 -0
- package/dist/parser/implementations/smart-parser.js +1536 -0
- package/dist/parser/implementations/smart-parser.js.map +1 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts +57 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts.map +1 -0
- package/dist/parser/implementations/tree-sitter-parser.js +375 -0
- package/dist/parser/implementations/tree-sitter-parser.js.map +1 -0
- package/dist/parser/index.d.ts +19 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +449 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/interfaces/IParser.d.ts +218 -0
- package/dist/parser/interfaces/IParser.d.ts.map +1 -0
- package/dist/parser/interfaces/IParser.js +22 -0
- package/dist/parser/interfaces/IParser.js.map +1 -0
- package/dist/plugins/built-in/call-graph.d.ts +38 -0
- package/dist/plugins/built-in/call-graph.d.ts.map +1 -0
- package/dist/plugins/built-in/call-graph.js +135 -0
- package/dist/plugins/built-in/call-graph.js.map +1 -0
- package/dist/plugins/built-in/complexity-analyzer.d.ts +45 -0
- package/dist/plugins/built-in/complexity-analyzer.d.ts.map +1 -0
- package/dist/plugins/built-in/complexity-analyzer.js +155 -0
- package/dist/plugins/built-in/complexity-analyzer.js.map +1 -0
- package/dist/plugins/index.d.ts +34 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +103 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/plugin-loader.d.ts +22 -0
- package/dist/plugins/plugin-loader.d.ts.map +1 -0
- package/dist/plugins/plugin-loader.js +200 -0
- package/dist/plugins/plugin-loader.js.map +1 -0
- package/dist/plugins/plugin-registry.d.ts +20 -0
- package/dist/plugins/plugin-registry.d.ts.map +1 -0
- package/dist/plugins/plugin-registry.js +143 -0
- package/dist/plugins/plugin-registry.js.map +1 -0
- package/dist/plugins/types.d.ts +72 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +5 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/types/index.d.ts +373 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/watcher/daemon.d.ts +64 -0
- package/dist/watcher/daemon.d.ts.map +1 -0
- package/dist/watcher/daemon.js +189 -0
- package/dist/watcher/daemon.js.map +1 -0
- package/dist/watcher/file-watcher.d.ts +70 -0
- package/dist/watcher/file-watcher.d.ts.map +1 -0
- package/dist/watcher/file-watcher.js +127 -0
- package/dist/watcher/file-watcher.js.map +1 -0
- package/dist/watcher/index.d.ts +5 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/index.js +6 -0
- package/dist/watcher/index.js.map +1 -0
- package/dist/watcher/watch-worker.d.ts +2 -0
- package/dist/watcher/watch-worker.d.ts.map +1 -0
- package/dist/watcher/watch-worker.js +57 -0
- package/dist/watcher/watch-worker.js.map +1 -0
- package/dist/worker/index.d.ts +76 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +155 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/parse-worker.d.ts +2 -0
- package/dist/worker/parse-worker.d.ts.map +1 -0
- package/dist/worker/parse-worker.js +202 -0
- package/dist/worker/parse-worker.js.map +1 -0
- package/mycodemap.config.schema.json +42 -0
- package/package.json +69 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [META] TestLinker - 测试文件关联器
|
|
3
|
+
* [WHY] 基于 Jest/Vitest 配置自动关联测试文件
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* CodemapData - 代码映射数据结构
|
|
7
|
+
* 用于 buildMapping 方法
|
|
8
|
+
*/
|
|
9
|
+
export interface CodemapData {
|
|
10
|
+
/** 文件列表 */
|
|
11
|
+
files?: string[];
|
|
12
|
+
/** 源文件映射 */
|
|
13
|
+
sourceFiles?: string[];
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 测试配置接口
|
|
18
|
+
*/
|
|
19
|
+
export interface TestConfig {
|
|
20
|
+
/** 测试框架类型 */
|
|
21
|
+
framework: 'jest' | 'vitest' | 'none';
|
|
22
|
+
/** 匹配模式 */
|
|
23
|
+
patterns: {
|
|
24
|
+
/** 测试文件匹配模式 */
|
|
25
|
+
testFile: string[];
|
|
26
|
+
/** 测试目录 */
|
|
27
|
+
testDir: string[];
|
|
28
|
+
};
|
|
29
|
+
/** 源文件 → 测试文件映射 */
|
|
30
|
+
sourceToTestMap: Map<string, string[]>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 测试文件关联配置
|
|
34
|
+
*/
|
|
35
|
+
export interface TestLinkerOptions {
|
|
36
|
+
/** 项目根目录 */
|
|
37
|
+
rootDir?: string;
|
|
38
|
+
/** 测试框架类型 */
|
|
39
|
+
framework?: 'jest' | 'vitest' | 'auto';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 测试文件映射结果
|
|
43
|
+
*/
|
|
44
|
+
export interface TestMapping {
|
|
45
|
+
/** 源文件路径 */
|
|
46
|
+
sourceFile: string;
|
|
47
|
+
/** 关联的测试文件 */
|
|
48
|
+
testFile: string | null;
|
|
49
|
+
/** 测试框架 */
|
|
50
|
+
framework: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* TestLinker 类
|
|
54
|
+
*/
|
|
55
|
+
export declare class TestLinker {
|
|
56
|
+
private rootDir;
|
|
57
|
+
private framework;
|
|
58
|
+
private testPatterns;
|
|
59
|
+
private config;
|
|
60
|
+
constructor(options?: TestLinkerOptions);
|
|
61
|
+
/**
|
|
62
|
+
* 初始化测试链接器
|
|
63
|
+
* 检测测试框架并加载配置
|
|
64
|
+
*/
|
|
65
|
+
initialize(): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* 检查配置文件是否存在
|
|
68
|
+
*/
|
|
69
|
+
private hasConfig;
|
|
70
|
+
/**
|
|
71
|
+
* 获取默认测试模式
|
|
72
|
+
*/
|
|
73
|
+
private getDefaultPatterns;
|
|
74
|
+
/**
|
|
75
|
+
* 加载测试配置
|
|
76
|
+
* 读取 jest.config.js / vitest.config.ts
|
|
77
|
+
* @param projectRoot 项目根目录
|
|
78
|
+
* @returns 测试配置对象
|
|
79
|
+
*/
|
|
80
|
+
loadConfig(projectRoot: string): Promise<TestConfig>;
|
|
81
|
+
/**
|
|
82
|
+
* 检查文件是否存在
|
|
83
|
+
*/
|
|
84
|
+
private pathExists;
|
|
85
|
+
/**
|
|
86
|
+
* 解析 Vitest 配置
|
|
87
|
+
*/
|
|
88
|
+
private parseVitestConfig;
|
|
89
|
+
/**
|
|
90
|
+
* 解析 Jest 配置
|
|
91
|
+
*/
|
|
92
|
+
private parseJestConfig;
|
|
93
|
+
/**
|
|
94
|
+
* 确保配置已加载
|
|
95
|
+
*/
|
|
96
|
+
private assertConfig;
|
|
97
|
+
/**
|
|
98
|
+
* 构建源文件 → 测试文件 映射
|
|
99
|
+
* 基于测试框架的匹配规则
|
|
100
|
+
* @param projectRoot 项目根目录
|
|
101
|
+
* @param codemap 代码映射数据
|
|
102
|
+
*/
|
|
103
|
+
buildMapping(projectRoot: string, codemap: CodemapData): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* 查找所有测试文件
|
|
106
|
+
*/
|
|
107
|
+
private findTestFiles;
|
|
108
|
+
/**
|
|
109
|
+
* 从测试文件名推断源文件
|
|
110
|
+
* lru-cache.test.ts → lru-cache.ts
|
|
111
|
+
* src/cache/__tests__/lru-cache.test.ts → src/cache/lru-cache.ts
|
|
112
|
+
*/
|
|
113
|
+
private inferSourceFile;
|
|
114
|
+
/**
|
|
115
|
+
* 扫描测试文件的 import 语句
|
|
116
|
+
* 提取被导入的源文件路径
|
|
117
|
+
* @param testFile 测试文件路径
|
|
118
|
+
* @returns 源文件路径列表
|
|
119
|
+
*/
|
|
120
|
+
scanTestImports(testFile: string): Promise<string[]>;
|
|
121
|
+
/**
|
|
122
|
+
* 查找目录级别测试文件
|
|
123
|
+
* 支持 src/cache/__tests__/*.test.ts 格式
|
|
124
|
+
* 支持 src/cache/test/*.test.ts 格式
|
|
125
|
+
* @param sourceFile 源文件路径
|
|
126
|
+
* @returns 测试文件路径列表
|
|
127
|
+
*/
|
|
128
|
+
findDirLevelTests(sourceFile: string): Promise<string[]>;
|
|
129
|
+
/**
|
|
130
|
+
* 查找相关测试文件
|
|
131
|
+
* @param sourceFiles 源文件路径列表
|
|
132
|
+
* @returns 相关测试文件路径列表
|
|
133
|
+
*/
|
|
134
|
+
findRelatedTests(sourceFiles: string[]): Promise<string[]>;
|
|
135
|
+
/**
|
|
136
|
+
* 解析源文件对应的测试文件
|
|
137
|
+
* @param sourceFile 源文件路径
|
|
138
|
+
* @returns 测试文件路径,如果不存在则返回 null
|
|
139
|
+
*/
|
|
140
|
+
resolveTestFile(sourceFile: string): Promise<string | null>;
|
|
141
|
+
/**
|
|
142
|
+
* 获取文件名(不含扩展名)
|
|
143
|
+
*/
|
|
144
|
+
private getBasename;
|
|
145
|
+
/**
|
|
146
|
+
* 使用 glob 搜索测试文件
|
|
147
|
+
*/
|
|
148
|
+
private globSearch;
|
|
149
|
+
/**
|
|
150
|
+
* 批量解析多个源文件的测试文件
|
|
151
|
+
*/
|
|
152
|
+
resolveTestFiles(sourceFiles: string[]): Promise<TestMapping[]>;
|
|
153
|
+
/**
|
|
154
|
+
* 获取所有测试文件
|
|
155
|
+
*/
|
|
156
|
+
getAllTestFiles(): Promise<string[]>;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* 解析测试文件的便捷函数
|
|
160
|
+
*/
|
|
161
|
+
export declare function resolveTestFile(sourceFile: string): Promise<string | null>;
|
|
162
|
+
/**
|
|
163
|
+
* 批量解析测试文件的便捷函数
|
|
164
|
+
*/
|
|
165
|
+
export declare function resolveTestFiles(sourceFiles: string[]): Promise<TestMapping[]>;
|
|
166
|
+
//# sourceMappingURL=test-linker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-linker.d.ts","sourceRoot":"","sources":["../../src/orchestrator/test-linker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,WAAW;IACX,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY;IACZ,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OA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