@vibecodeqa/cli 0.9.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 +174 -0
- package/dist/check-meta.d.ts +15 -0
- package/dist/check-meta.js +166 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +140 -0
- package/dist/detect.d.ts +8 -0
- package/dist/detect.js +67 -0
- package/dist/fs-utils.d.ts +23 -0
- package/dist/fs-utils.js +77 -0
- package/dist/report/html.d.ts +12 -0
- package/dist/report/html.js +400 -0
- package/dist/runners/architecture.d.ts +28 -0
- package/dist/runners/architecture.js +272 -0
- package/dist/runners/complexity.d.ts +3 -0
- package/dist/runners/complexity.js +152 -0
- package/dist/runners/confusion.d.ts +16 -0
- package/dist/runners/confusion.js +198 -0
- package/dist/runners/context.d.ts +15 -0
- package/dist/runners/context.js +200 -0
- package/dist/runners/coverage.d.ts +3 -0
- package/dist/runners/coverage.js +65 -0
- package/dist/runners/dependencies.d.ts +3 -0
- package/dist/runners/dependencies.js +106 -0
- package/dist/runners/docs.d.ts +3 -0
- package/dist/runners/docs.js +97 -0
- package/dist/runners/duplication.d.ts +3 -0
- package/dist/runners/duplication.js +100 -0
- package/dist/runners/exec.d.ts +6 -0
- package/dist/runners/exec.js +25 -0
- package/dist/runners/lint.d.ts +3 -0
- package/dist/runners/lint.js +78 -0
- package/dist/runners/secrets.d.ts +3 -0
- package/dist/runners/secrets.js +108 -0
- package/dist/runners/security.d.ts +3 -0
- package/dist/runners/security.js +121 -0
- package/dist/runners/standards.d.ts +3 -0
- package/dist/runners/standards.js +153 -0
- package/dist/runners/structure.d.ts +3 -0
- package/dist/runners/structure.js +110 -0
- package/dist/runners/testing.d.ts +12 -0
- package/dist/runners/testing.js +401 -0
- package/dist/runners/tests.d.ts +3 -0
- package/dist/runners/tests.js +54 -0
- package/dist/runners/type-safety.d.ts +3 -0
- package/dist/runners/type-safety.js +74 -0
- package/dist/runners/types-check.d.ts +3 -0
- package/dist/runners/types-check.js +44 -0
- package/dist/score.d.ts +6 -0
- package/dist/score.js +19 -0
- package/dist/trend.d.ts +19 -0
- package/dist/trend.js +63 -0
- package/dist/types.d.ts +40 -0
- package/dist/types.js +12 -0
- package/package.json +53 -0
package/dist/trend.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Trend comparison — compares current report to previous run. */
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
export function computeTrend(report, outputDir) {
|
|
5
|
+
const prevPath = join(outputDir, "report.json");
|
|
6
|
+
if (!existsSync(prevPath))
|
|
7
|
+
return null;
|
|
8
|
+
let prev;
|
|
9
|
+
try {
|
|
10
|
+
prev = JSON.parse(readFileSync(prevPath, "utf-8"));
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (!prev.score && prev.score !== 0)
|
|
16
|
+
return null;
|
|
17
|
+
const scoreDelta = report.score - prev.score;
|
|
18
|
+
const checkDeltas = [];
|
|
19
|
+
for (const curr of report.checks) {
|
|
20
|
+
const prevCheck = prev.checks.find((c) => c.name === curr.name);
|
|
21
|
+
const prevScore = prevCheck?.score ?? 0;
|
|
22
|
+
checkDeltas.push({
|
|
23
|
+
name: curr.name,
|
|
24
|
+
prev: prevScore,
|
|
25
|
+
curr: curr.score,
|
|
26
|
+
delta: curr.score - prevScore,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const currIssueCount = report.checks.reduce((s, c) => s + c.issues.length, 0);
|
|
30
|
+
const prevIssueCount = prev.checks.reduce((s, c) => s + c.issues.length, 0);
|
|
31
|
+
const newIssues = Math.max(0, currIssueCount - prevIssueCount);
|
|
32
|
+
const fixedIssues = Math.max(0, prevIssueCount - currIssueCount);
|
|
33
|
+
return { scoreDelta, checkDeltas, newIssues, fixedIssues, prevTimestamp: prev.timestamp };
|
|
34
|
+
}
|
|
35
|
+
/** Render trend delta as terminal-friendly string. */
|
|
36
|
+
export function formatTrend(trend) {
|
|
37
|
+
const arrow = trend.scoreDelta > 0 ? "↑" : trend.scoreDelta < 0 ? "↓" : "=";
|
|
38
|
+
const color = trend.scoreDelta > 0 ? "\x1b[32m" : trend.scoreDelta < 0 ? "\x1b[31m" : "\x1b[2m";
|
|
39
|
+
let out = ` ${color}${arrow} ${Math.abs(trend.scoreDelta)} pts${trend.scoreDelta > 0 ? " improved" : trend.scoreDelta < 0 ? " declined" : " unchanged"}\x1b[0m`;
|
|
40
|
+
out += ` \x1b[2mvs ${trend.prevTimestamp.split("T")[0]}\x1b[0m`;
|
|
41
|
+
if (trend.fixedIssues > 0)
|
|
42
|
+
out += ` \x1b[32m${trend.fixedIssues} fixed\x1b[0m`;
|
|
43
|
+
if (trend.newIssues > 0)
|
|
44
|
+
out += ` \x1b[31m${trend.newIssues} new\x1b[0m`;
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
/** Render trend HTML for the report. */
|
|
48
|
+
export function trendHTML(trend) {
|
|
49
|
+
const arrow = trend.scoreDelta > 0 ? "▲" : trend.scoreDelta < 0 ? "▼" : "▬";
|
|
50
|
+
const color = trend.scoreDelta > 0 ? "var(--pass)" : trend.scoreDelta < 0 ? "var(--fail)" : "var(--muted)";
|
|
51
|
+
let deltas = "";
|
|
52
|
+
for (const d of trend.checkDeltas) {
|
|
53
|
+
if (d.delta === 0)
|
|
54
|
+
continue;
|
|
55
|
+
const c = d.delta > 0 ? "var(--pass)" : "var(--fail)";
|
|
56
|
+
deltas += `<span class="td-item" style="color:${c}">${d.name} ${d.delta > 0 ? "+" : ""}${d.delta}</span>`;
|
|
57
|
+
}
|
|
58
|
+
return `<div class="trend">
|
|
59
|
+
<div class="trend-head"><span class="trend-arrow" style="color:${color}">${arrow}</span><span style="color:${color};font-weight:700">${trend.scoreDelta > 0 ? "+" : ""}${trend.scoreDelta} pts</span><span class="trend-vs">vs ${trend.prevTimestamp.split("T")[0]}</span></div>
|
|
60
|
+
<div class="trend-stats">${trend.fixedIssues > 0 ? `<span style="color:var(--pass)">${trend.fixedIssues} fixed</span>` : ""}${trend.newIssues > 0 ? `<span style="color:var(--fail)">${trend.newIssues} new</span>` : ""}</div>
|
|
61
|
+
${deltas ? `<div class="trend-deltas">${deltas}</div>` : ""}
|
|
62
|
+
</div>`;
|
|
63
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Shared types for vibe-check */
|
|
2
|
+
export interface CheckResult {
|
|
3
|
+
name: string;
|
|
4
|
+
score: number;
|
|
5
|
+
grade: "A" | "B" | "C" | "D" | "F";
|
|
6
|
+
details: Record<string, unknown>;
|
|
7
|
+
issues: Issue[];
|
|
8
|
+
duration: number;
|
|
9
|
+
}
|
|
10
|
+
export interface Issue {
|
|
11
|
+
severity: "error" | "warning" | "info";
|
|
12
|
+
message: string;
|
|
13
|
+
file?: string;
|
|
14
|
+
line?: number;
|
|
15
|
+
rule?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface VibeReport {
|
|
18
|
+
version: string;
|
|
19
|
+
timestamp: string;
|
|
20
|
+
score: number;
|
|
21
|
+
grade: "A" | "B" | "C" | "D" | "F";
|
|
22
|
+
checks: CheckResult[];
|
|
23
|
+
meta: {
|
|
24
|
+
cwd: string;
|
|
25
|
+
node: string;
|
|
26
|
+
duration: number;
|
|
27
|
+
stack: StackInfo;
|
|
28
|
+
repoUrl: string | null;
|
|
29
|
+
branch: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface StackInfo {
|
|
33
|
+
language: "typescript" | "javascript" | "unknown";
|
|
34
|
+
framework: "react" | "vue" | "svelte" | "none" | "unknown";
|
|
35
|
+
bundler: "vite" | "webpack" | "esbuild" | "none" | "unknown";
|
|
36
|
+
testRunner: "vitest" | "jest" | "none" | "unknown";
|
|
37
|
+
linter: "biome" | "eslint" | "none" | "unknown";
|
|
38
|
+
packageManager: "pnpm" | "npm" | "yarn" | "bun" | "unknown";
|
|
39
|
+
}
|
|
40
|
+
export declare function gradeFromScore(score: number): "A" | "B" | "C" | "D" | "F";
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vibecodeqa/cli",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Code health scanner for the AI coding era. 15 checks, zero config, full report.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"vcqa": "./dist/cli.js",
|
|
8
|
+
"vibe-check": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"code-quality",
|
|
17
|
+
"code-health",
|
|
18
|
+
"lint",
|
|
19
|
+
"coverage",
|
|
20
|
+
"complexity",
|
|
21
|
+
"duplication",
|
|
22
|
+
"security",
|
|
23
|
+
"architecture",
|
|
24
|
+
"llm",
|
|
25
|
+
"ai",
|
|
26
|
+
"vibe-coding",
|
|
27
|
+
"typescript",
|
|
28
|
+
"react",
|
|
29
|
+
"vite"
|
|
30
|
+
],
|
|
31
|
+
"author": "VibeCode QA <hello@vibecodeqa.online>",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/freeappstore-online/vibe-check"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://vibecodeqa.online",
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=20"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@biomejs/biome": "^2.4.15",
|
|
43
|
+
"@types/node": "^25.8.0",
|
|
44
|
+
"typescript": "^5.8.3",
|
|
45
|
+
"vitest": "^4.1.6"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc",
|
|
49
|
+
"dev": "tsc --watch",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"lint": "biome check src/"
|
|
52
|
+
}
|
|
53
|
+
}
|