@devness/coverit 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/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/agents/orchestrator.d.ts +21 -0
- package/dist/agents/orchestrator.d.ts.map +1 -0
- package/dist/agents/orchestrator.js +235 -0
- package/dist/agents/orchestrator.js.map +1 -0
- package/dist/agents/reporter.d.ts +13 -0
- package/dist/agents/reporter.d.ts.map +1 -0
- package/dist/agents/reporter.js +323 -0
- package/dist/agents/reporter.js.map +1 -0
- package/dist/ai/anthropic-provider.d.ts +19 -0
- package/dist/ai/anthropic-provider.d.ts.map +1 -0
- package/dist/ai/anthropic-provider.js +83 -0
- package/dist/ai/anthropic-provider.js.map +1 -0
- package/dist/ai/claude-cli-provider.d.ts +22 -0
- package/dist/ai/claude-cli-provider.d.ts.map +1 -0
- package/dist/ai/claude-cli-provider.js +197 -0
- package/dist/ai/claude-cli-provider.js.map +1 -0
- package/dist/ai/index.d.ts +15 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +16 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/ollama-provider.d.ts +17 -0
- package/dist/ai/ollama-provider.d.ts.map +1 -0
- package/dist/ai/ollama-provider.js +88 -0
- package/dist/ai/ollama-provider.js.map +1 -0
- package/dist/ai/openai-provider.d.ts +20 -0
- package/dist/ai/openai-provider.d.ts.map +1 -0
- package/dist/ai/openai-provider.js +74 -0
- package/dist/ai/openai-provider.js.map +1 -0
- package/dist/ai/prompts.d.ts +36 -0
- package/dist/ai/prompts.d.ts.map +1 -0
- package/dist/ai/prompts.js +259 -0
- package/dist/ai/prompts.js.map +1 -0
- package/dist/ai/provider-factory.d.ts +26 -0
- package/dist/ai/provider-factory.d.ts.map +1 -0
- package/dist/ai/provider-factory.js +111 -0
- package/dist/ai/provider-factory.js.map +1 -0
- package/dist/ai/types.d.ts +37 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +10 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/analysis/code-scanner.d.ts +9 -0
- package/dist/analysis/code-scanner.d.ts.map +1 -0
- package/dist/analysis/code-scanner.js +409 -0
- package/dist/analysis/code-scanner.js.map +1 -0
- package/dist/analysis/dependency-graph.d.ts +9 -0
- package/dist/analysis/dependency-graph.d.ts.map +1 -0
- package/dist/analysis/dependency-graph.js +149 -0
- package/dist/analysis/dependency-graph.js.map +1 -0
- package/dist/analysis/diff-analyzer.d.ts +9 -0
- package/dist/analysis/diff-analyzer.d.ts.map +1 -0
- package/dist/analysis/diff-analyzer.js +232 -0
- package/dist/analysis/diff-analyzer.js.map +1 -0
- package/dist/analysis/index.d.ts +5 -0
- package/dist/analysis/index.d.ts.map +1 -0
- package/dist/analysis/index.js +5 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/strategy-planner.d.ts +11 -0
- package/dist/analysis/strategy-planner.d.ts.map +1 -0
- package/dist/analysis/strategy-planner.js +384 -0
- package/dist/analysis/strategy-planner.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +288 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/executors/base-executor.d.ts +35 -0
- package/dist/executors/base-executor.d.ts.map +1 -0
- package/dist/executors/base-executor.js +138 -0
- package/dist/executors/base-executor.js.map +1 -0
- package/dist/executors/browser-runner.d.ts +24 -0
- package/dist/executors/browser-runner.d.ts.map +1 -0
- package/dist/executors/browser-runner.js +194 -0
- package/dist/executors/browser-runner.js.map +1 -0
- package/dist/executors/cloud-runner.d.ts +41 -0
- package/dist/executors/cloud-runner.d.ts.map +1 -0
- package/dist/executors/cloud-runner.js +153 -0
- package/dist/executors/cloud-runner.js.map +1 -0
- package/dist/executors/index.d.ts +12 -0
- package/dist/executors/index.d.ts.map +1 -0
- package/dist/executors/index.js +28 -0
- package/dist/executors/index.js.map +1 -0
- package/dist/executors/local-runner.d.ts +40 -0
- package/dist/executors/local-runner.d.ts.map +1 -0
- package/dist/executors/local-runner.js +395 -0
- package/dist/executors/local-runner.js.map +1 -0
- package/dist/executors/reporter.d.ts +6 -0
- package/dist/executors/reporter.d.ts.map +1 -0
- package/dist/executors/reporter.js +6 -0
- package/dist/executors/reporter.js.map +1 -0
- package/dist/executors/simulator-runner.d.ts +30 -0
- package/dist/executors/simulator-runner.d.ts.map +1 -0
- package/dist/executors/simulator-runner.js +339 -0
- package/dist/executors/simulator-runner.js.map +1 -0
- package/dist/generators/api-test.d.ts +22 -0
- package/dist/generators/api-test.d.ts.map +1 -0
- package/dist/generators/api-test.js +235 -0
- package/dist/generators/api-test.js.map +1 -0
- package/dist/generators/base-generator.d.ts +79 -0
- package/dist/generators/base-generator.d.ts.map +1 -0
- package/dist/generators/base-generator.js +234 -0
- package/dist/generators/base-generator.js.map +1 -0
- package/dist/generators/desktop-test.d.ts +22 -0
- package/dist/generators/desktop-test.d.ts.map +1 -0
- package/dist/generators/desktop-test.js +290 -0
- package/dist/generators/desktop-test.js.map +1 -0
- package/dist/generators/e2e-browser.d.ts +19 -0
- package/dist/generators/e2e-browser.d.ts.map +1 -0
- package/dist/generators/e2e-browser.js +233 -0
- package/dist/generators/e2e-browser.js.map +1 -0
- package/dist/generators/index.d.ts +21 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +66 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/mobile-test.d.ts +22 -0
- package/dist/generators/mobile-test.d.ts.map +1 -0
- package/dist/generators/mobile-test.js +286 -0
- package/dist/generators/mobile-test.js.map +1 -0
- package/dist/generators/unit-test.d.ts +23 -0
- package/dist/generators/unit-test.d.ts.map +1 -0
- package/dist/generators/unit-test.js +282 -0
- package/dist/generators/unit-test.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +217 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/types/index.d.ts +295 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/framework-detector.d.ts +28 -0
- package/dist/utils/framework-detector.d.ts.map +1 -0
- package/dist/utils/framework-detector.js +184 -0
- package/dist/utils/framework-detector.js.map +1 -0
- package/dist/utils/git.d.ts +33 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +82 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +47 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverit — Framework Detector
|
|
3
|
+
*
|
|
4
|
+
* Inspects package.json, lock files, and config files to determine
|
|
5
|
+
* the project's framework, test runner, package manager, and
|
|
6
|
+
* existing test infrastructure.
|
|
7
|
+
*/
|
|
8
|
+
import { readFile, access } from "node:fs/promises";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import fg from "fast-glob";
|
|
11
|
+
async function fileExists(filePath) {
|
|
12
|
+
try {
|
|
13
|
+
await access(filePath);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function readJson(filePath) {
|
|
21
|
+
try {
|
|
22
|
+
const raw = await readFile(filePath, "utf-8");
|
|
23
|
+
return JSON.parse(raw);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Detects the primary application framework from package.json dependencies.
|
|
31
|
+
* Checks in specificity order — more specific frameworks first.
|
|
32
|
+
*/
|
|
33
|
+
export async function detectFramework(projectRoot) {
|
|
34
|
+
const pkg = await readJson(join(projectRoot, "package.json"));
|
|
35
|
+
if (!pkg)
|
|
36
|
+
return "unknown";
|
|
37
|
+
const allDeps = {
|
|
38
|
+
...pkg.dependencies,
|
|
39
|
+
...pkg.devDependencies,
|
|
40
|
+
};
|
|
41
|
+
// Order matters: check more specific frameworks before generic ones
|
|
42
|
+
const frameworkMap = [
|
|
43
|
+
["@nestjs/core", "nestjs"],
|
|
44
|
+
["hono", "hono"],
|
|
45
|
+
["fastify", "fastify"],
|
|
46
|
+
["express", "express"],
|
|
47
|
+
["next", "next"],
|
|
48
|
+
["expo", "expo"],
|
|
49
|
+
["react-native", "react-native"],
|
|
50
|
+
["@tauri-apps/api", "tauri"],
|
|
51
|
+
["electron", "electron"],
|
|
52
|
+
["react", "react"],
|
|
53
|
+
];
|
|
54
|
+
for (const [dep, framework] of frameworkMap) {
|
|
55
|
+
if (dep in allDeps)
|
|
56
|
+
return framework;
|
|
57
|
+
}
|
|
58
|
+
return "none";
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Detects the test framework by looking for known config files,
|
|
62
|
+
* then falling back to package.json dependencies.
|
|
63
|
+
*/
|
|
64
|
+
export async function detectTestFramework(projectRoot) {
|
|
65
|
+
// Config-file detection is more reliable than dependency checks
|
|
66
|
+
const configChecks = [
|
|
67
|
+
["vitest.config.*", "vitest"],
|
|
68
|
+
["jest.config.*", "jest"],
|
|
69
|
+
["playwright.config.*", "playwright"],
|
|
70
|
+
["cypress.config.*", "cypress"],
|
|
71
|
+
[".mocharc.*", "mocha"],
|
|
72
|
+
["pytest.ini", "pytest"],
|
|
73
|
+
["pyproject.toml", "pytest"],
|
|
74
|
+
];
|
|
75
|
+
for (const [pattern, framework] of configChecks) {
|
|
76
|
+
const matches = await fg(pattern, { cwd: projectRoot, dot: true });
|
|
77
|
+
if (matches.length > 0)
|
|
78
|
+
return framework;
|
|
79
|
+
}
|
|
80
|
+
// Fallback: check package.json deps
|
|
81
|
+
const pkg = await readJson(join(projectRoot, "package.json"));
|
|
82
|
+
if (!pkg)
|
|
83
|
+
return "unknown";
|
|
84
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
85
|
+
if ("vitest" in allDeps)
|
|
86
|
+
return "vitest";
|
|
87
|
+
if ("jest" in allDeps)
|
|
88
|
+
return "jest";
|
|
89
|
+
if ("@playwright/test" in allDeps)
|
|
90
|
+
return "playwright";
|
|
91
|
+
if ("cypress" in allDeps)
|
|
92
|
+
return "cypress";
|
|
93
|
+
if ("mocha" in allDeps)
|
|
94
|
+
return "mocha";
|
|
95
|
+
return "unknown";
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Detects the package manager by checking for lock files.
|
|
99
|
+
*/
|
|
100
|
+
export async function detectPackageManager(projectRoot) {
|
|
101
|
+
const lockChecks = [
|
|
102
|
+
["bun.lockb", "bun"],
|
|
103
|
+
["bun.lock", "bun"],
|
|
104
|
+
["pnpm-lock.yaml", "pnpm"],
|
|
105
|
+
["yarn.lock", "yarn"],
|
|
106
|
+
["package-lock.json", "npm"],
|
|
107
|
+
];
|
|
108
|
+
for (const [file, pm] of lockChecks) {
|
|
109
|
+
if (await fileExists(join(projectRoot, file)))
|
|
110
|
+
return pm;
|
|
111
|
+
}
|
|
112
|
+
return "npm";
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Detects the primary language. For now, defaults to TypeScript for
|
|
116
|
+
* projects with a tsconfig, JavaScript otherwise.
|
|
117
|
+
*/
|
|
118
|
+
async function detectLanguage(projectRoot) {
|
|
119
|
+
if (await fileExists(join(projectRoot, "tsconfig.json")))
|
|
120
|
+
return "typescript";
|
|
121
|
+
if (await fileExists(join(projectRoot, "package.json")))
|
|
122
|
+
return "javascript";
|
|
123
|
+
if (await fileExists(join(projectRoot, "go.mod")))
|
|
124
|
+
return "go";
|
|
125
|
+
if (await fileExists(join(projectRoot, "Cargo.toml")))
|
|
126
|
+
return "rust";
|
|
127
|
+
if (await fileExists(join(projectRoot, "pyproject.toml")))
|
|
128
|
+
return "python";
|
|
129
|
+
if (await fileExists(join(projectRoot, "pom.xml")))
|
|
130
|
+
return "java";
|
|
131
|
+
return "unknown";
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Aggregates all detection results into a single ProjectInfo object.
|
|
135
|
+
* Also scans for existing test directories and patterns.
|
|
136
|
+
*/
|
|
137
|
+
export async function detectProjectInfo(projectRoot) {
|
|
138
|
+
const [framework, testFramework, packageManager, language] = await Promise.all([
|
|
139
|
+
detectFramework(projectRoot),
|
|
140
|
+
detectTestFramework(projectRoot),
|
|
141
|
+
detectPackageManager(projectRoot),
|
|
142
|
+
detectLanguage(projectRoot),
|
|
143
|
+
]);
|
|
144
|
+
const pkg = await readJson(join(projectRoot, "package.json"));
|
|
145
|
+
const name = pkg?.name ?? "unknown";
|
|
146
|
+
// Scan for existing test files
|
|
147
|
+
const testPatterns = [
|
|
148
|
+
"**/*.test.ts",
|
|
149
|
+
"**/*.spec.ts",
|
|
150
|
+
"**/*.test.tsx",
|
|
151
|
+
"**/*.spec.tsx",
|
|
152
|
+
"**/*.test.js",
|
|
153
|
+
"**/*.spec.js",
|
|
154
|
+
"**/__tests__/**",
|
|
155
|
+
"**/tests/**",
|
|
156
|
+
"**/test/**",
|
|
157
|
+
];
|
|
158
|
+
const existingTests = await fg(testPatterns, {
|
|
159
|
+
cwd: projectRoot,
|
|
160
|
+
ignore: ["node_modules/**", "dist/**", ".coverit/**"],
|
|
161
|
+
dot: false,
|
|
162
|
+
});
|
|
163
|
+
// Deduce pattern types from what we found
|
|
164
|
+
const existingTestPatterns = [];
|
|
165
|
+
if (existingTests.some((f) => f.includes(".test.")))
|
|
166
|
+
existingTestPatterns.push("*.test.*");
|
|
167
|
+
if (existingTests.some((f) => f.includes(".spec.")))
|
|
168
|
+
existingTestPatterns.push("*.spec.*");
|
|
169
|
+
if (existingTests.some((f) => f.includes("__tests__")))
|
|
170
|
+
existingTestPatterns.push("__tests__/");
|
|
171
|
+
if (existingTests.some((f) => /^tests?\//.test(f)))
|
|
172
|
+
existingTestPatterns.push("tests/");
|
|
173
|
+
return {
|
|
174
|
+
name,
|
|
175
|
+
root: projectRoot,
|
|
176
|
+
language,
|
|
177
|
+
framework,
|
|
178
|
+
testFramework,
|
|
179
|
+
packageManager,
|
|
180
|
+
hasExistingTests: existingTests.length > 0,
|
|
181
|
+
existingTestPatterns,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=framework-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-detector.js","sourceRoot":"","sources":["../../src/utils/framework-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,WAAW,CAAC;AAS3B,KAAK,UAAU,UAAU,CAAC,QAAgB;IACxC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,QAAQ,CAAI,QAAgB;IACzC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAM,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAQD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,WAAmB;IACvD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAc,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC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+
* Thin wrappers around simple-git for diffing, branch detection,
|
|
5
|
+
* and changed-file enumeration used by the analysis pipeline.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns files changed between the current HEAD and the given base branch.
|
|
9
|
+
* Falls back to detecting the base branch automatically.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getChangedFiles(projectRoot: string, baseBranch?: string): Promise<string[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the raw unified diff between HEAD and the base branch.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getDiff(projectRoot: string, baseBranch?: string): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the name of the currently checked-out branch.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCurrentBranch(projectRoot: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Detects the base branch by checking for main, master, develop in order.
|
|
22
|
+
* Returns the first one that exists as a local or remote ref.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getBaseBranch(projectRoot: string): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Checks whether the given path is inside a git repository.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isGitRepo(path: string): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns files currently staged in the index.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getStagedFiles(projectRoot: string): Promise<string[]>;
|
|
33
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;;GAGG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB;AAED;;GAEG;AACH,wBAAsB,OAAO,CAC3B,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI3E;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBxE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ9D;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAO3E"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverit — Git Utilities
|
|
3
|
+
*
|
|
4
|
+
* Thin wrappers around simple-git for diffing, branch detection,
|
|
5
|
+
* and changed-file enumeration used by the analysis pipeline.
|
|
6
|
+
*/
|
|
7
|
+
import simpleGit from "simple-git";
|
|
8
|
+
function git(projectRoot) {
|
|
9
|
+
return simpleGit(projectRoot);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns files changed between the current HEAD and the given base branch.
|
|
13
|
+
* Falls back to detecting the base branch automatically.
|
|
14
|
+
*/
|
|
15
|
+
export async function getChangedFiles(projectRoot, baseBranch) {
|
|
16
|
+
const base = baseBranch ?? (await getBaseBranch(projectRoot));
|
|
17
|
+
const g = git(projectRoot);
|
|
18
|
+
const diff = await g.diff(["--name-only", `${base}...HEAD`]);
|
|
19
|
+
return diff
|
|
20
|
+
.split("\n")
|
|
21
|
+
.map((f) => f.trim())
|
|
22
|
+
.filter(Boolean);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns the raw unified diff between HEAD and the base branch.
|
|
26
|
+
*/
|
|
27
|
+
export async function getDiff(projectRoot, baseBranch) {
|
|
28
|
+
const base = baseBranch ?? (await getBaseBranch(projectRoot));
|
|
29
|
+
const g = git(projectRoot);
|
|
30
|
+
return g.diff([`${base}...HEAD`]);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns the name of the currently checked-out branch.
|
|
34
|
+
*/
|
|
35
|
+
export async function getCurrentBranch(projectRoot) {
|
|
36
|
+
const g = git(projectRoot);
|
|
37
|
+
const branch = await g.revparse(["--abbrev-ref", "HEAD"]);
|
|
38
|
+
return branch.trim();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Detects the base branch by checking for main, master, develop in order.
|
|
42
|
+
* Returns the first one that exists as a local or remote ref.
|
|
43
|
+
*/
|
|
44
|
+
export async function getBaseBranch(projectRoot) {
|
|
45
|
+
const g = git(projectRoot);
|
|
46
|
+
const candidates = ["main", "master", "develop"];
|
|
47
|
+
const branchSummary = await g.branch();
|
|
48
|
+
const allBranches = new Set(branchSummary.all);
|
|
49
|
+
for (const candidate of candidates) {
|
|
50
|
+
if (allBranches.has(candidate) ||
|
|
51
|
+
allBranches.has(`remotes/origin/${candidate}`)) {
|
|
52
|
+
return candidate;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Last resort: whatever the default remote HEAD points to
|
|
56
|
+
return "main";
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Checks whether the given path is inside a git repository.
|
|
60
|
+
*/
|
|
61
|
+
export async function isGitRepo(path) {
|
|
62
|
+
try {
|
|
63
|
+
const g = git(path);
|
|
64
|
+
await g.revparse(["--is-inside-work-tree"]);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns files currently staged in the index.
|
|
73
|
+
*/
|
|
74
|
+
export async function getStagedFiles(projectRoot) {
|
|
75
|
+
const g = git(projectRoot);
|
|
76
|
+
const diff = await g.diff(["--name-only", "--cached"]);
|
|
77
|
+
return diff
|
|
78
|
+
.split("\n")
|
|
79
|
+
.map((f) =>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AE,UAAU,CAAC,CAAC,CAAC;IACvD,OAAO,IAAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverit — Logger Utility
|
|
3
|
+
*
|
|
4
|
+
* Structured logging with colored output for CLI and internal use.
|
|
5
|
+
* Debug logging gated behind COVERIT_DEBUG=1 environment variable.
|
|
6
|
+
*/
|
|
7
|
+
import { type Ora } from "ora";
|
|
8
|
+
export declare const logger: {
|
|
9
|
+
debug(...args: unknown[]): void;
|
|
10
|
+
info(...args: unknown[]): void;
|
|
11
|
+
warn(...args: unknown[]): void;
|
|
12
|
+
error(...args: unknown[]): void;
|
|
13
|
+
success(...args: unknown[]): void;
|
|
14
|
+
spinner(text: string): Ora;
|
|
15
|
+
table(data: Record<string, unknown>[] | Record<string, unknown>): void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAQpC,eAAO,MAAM,MAAM;mBACF,OAAO,EAAE,GAAG,IAAI;kBAMjB,OAAO,EAAE,GAAG,IAAI;kBAIhB,OAAO,EAAE,GAAG,IAAI;mBAIf,OAAO,EAAE,GAAG,IAAI;qBAId,OAAO,EAAE,GAAG,IAAI;kBAInB,MAAM,GAAG,GAAG;gBAId,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAavE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverit — Logger Utility
|
|
3
|
+
*
|
|
4
|
+
* Structured logging with colored output for CLI and internal use.
|
|
5
|
+
* Debug logging gated behind COVERIT_DEBUG=1 environment variable.
|
|
6
|
+
*/
|
|
7
|
+
import chalk from "chalk";
|
|
8
|
+
import ora from "ora";
|
|
9
|
+
const PREFIX = "[coverit]";
|
|
10
|
+
function isDebug() {
|
|
11
|
+
return process.env["COVERIT_DEBUG"] === "1";
|
|
12
|
+
}
|
|
13
|
+
export const logger = {
|
|
14
|
+
debug(...args) {
|
|
15
|
+
if (isDebug()) {
|
|
16
|
+
console.debug(chalk.gray(`${PREFIX} [debug]`), ...args);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
info(...args) {
|
|
20
|
+
console.log(chalk.cyan(PREFIX), ...args);
|
|
21
|
+
},
|
|
22
|
+
warn(...args) {
|
|
23
|
+
console.warn(chalk.yellow(PREFIX), ...args);
|
|
24
|
+
},
|
|
25
|
+
error(...args) {
|
|
26
|
+
console.error(chalk.red(PREFIX), ...args);
|
|
27
|
+
},
|
|
28
|
+
success(...args) {
|
|
29
|
+
console.log(chalk.green(`${PREFIX} ✓`), ...args);
|
|
30
|
+
},
|
|
31
|
+
spinner(text) {
|
|
32
|
+
return ora({ text, prefixText: chalk.cyan(PREFIX) }).start();
|
|
33
|
+
},
|
|
34
|
+
table(data) {
|
|
35
|
+
if (Array.isArray(data)) {
|
|
36
|
+
console.table(data);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const entries = Object.entries(data);
|
|
40
|
+
const maxKey = Math.max(...entries.map(([k]) => k.length));
|
|
41
|
+
for (const [key, value] of entries) {
|
|
42
|
+
console.log(` ${chalk.gray(key.padEnd(maxKey))} ${chalk.white(String(value))}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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AAE,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,IAAyD;QAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YAC3D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;gBACnC,OAAO,CAAC,GAAG,CACT,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CACrE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@devness/coverit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI-powered test generation and execution platform. Analyze features, generate tests, run them — one command.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"coverit": "./dist/cli/index.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/**/*",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"dev": "tsc --watch",
|
|
25
|
+
"start": "node dist/index.js",
|
|
26
|
+
"cli": "bun run src/cli/index.ts",
|
|
27
|
+
"mcp": "bun run src/mcp/server.ts",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"lint": "eslint src/",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"format": "prettier --write src/",
|
|
33
|
+
"prepublishOnly": "npm run build && chmod +x dist/cli/index.js",
|
|
34
|
+
"publish:patch": "./scripts/publish.sh patch",
|
|
35
|
+
"publish:minor": "./scripts/publish.sh minor",
|
|
36
|
+
"publish:major": "./scripts/publish.sh major",
|
|
37
|
+
"release": "./scripts/publish.sh patch"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"coverit",
|
|
41
|
+
"test-generation",
|
|
42
|
+
"ai-testing",
|
|
43
|
+
"test-automation",
|
|
44
|
+
"coverage",
|
|
45
|
+
"vitest",
|
|
46
|
+
"jest",
|
|
47
|
+
"playwright",
|
|
48
|
+
"e2e-testing",
|
|
49
|
+
"unit-testing",
|
|
50
|
+
"api-testing",
|
|
51
|
+
"claude",
|
|
52
|
+
"ai",
|
|
53
|
+
"cli"
|
|
54
|
+
],
|
|
55
|
+
"author": "Coverit",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"homepage": "https://coverit.dev",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/niceguydave/coverit/issues"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/niceguydave/coverit.git"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=18.0.0"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
70
|
+
"ts-morph": "^25.0.0",
|
|
71
|
+
"commander": "^13.1.0",
|
|
72
|
+
"chalk": "^5.4.1",
|
|
73
|
+
"ora": "^8.2.0",
|
|
74
|
+
"zod": "^3.24.2",
|
|
75
|
+
"simple-git": "^3.27.0",
|
|
76
|
+
"glob": "^11.0.1",
|
|
77
|
+
"fast-glob": "^3.3.3"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@types/node": "^22.0.0",
|
|
81
|
+
"typescript": "^5.7.3",
|
|
82
|
+
"vitest": "^3.0.5",
|
|
83
|
+
"eslint": "^9.20.0",
|
|
84
|
+
"prettier": "^3.5.1"
|
|
85
|
+
}
|
|
86
|
+
}
|