qodfy 0.1.2 → 0.1.4
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/dist/index.js +24 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import { Command } from "commander";
|
|
|
7
7
|
import pc from "picocolors";
|
|
8
8
|
import { scanProject } from "@qodfy/core";
|
|
9
9
|
var program = new Command();
|
|
10
|
-
program.name("qodfy").description("Launch readiness scanner for AI-built apps.").version("0.1.
|
|
11
|
-
program.command("scan").description("Scan a project for launch readiness issues.").option("-p, --path <path>", "Project path to scan", process.cwd()).action(async (options) => {
|
|
10
|
+
program.name("qodfy").description("Launch readiness scanner for AI-built apps.").version("0.1.4");
|
|
11
|
+
program.command("scan").description("Scan a project for launch readiness issues.").option("-p, --path <path>", "Project path to scan", process.cwd()).option("--max-issues <number>", "Maximum number of issues to display", "50").action(async (options) => {
|
|
12
12
|
const pathResult = await resolveProjectPath(options.path);
|
|
13
13
|
if (!pathResult.ok) {
|
|
14
14
|
printScanError(pathResult.reason);
|
|
@@ -18,7 +18,7 @@ program.command("scan").description("Scan a project for launch readiness issues.
|
|
|
18
18
|
try {
|
|
19
19
|
console.log(pc.cyan("Qodfy is scanning your project...\n"));
|
|
20
20
|
const report = await scanProject(pathResult.projectPath);
|
|
21
|
-
printReport(report);
|
|
21
|
+
printReport(report, parseMaxIssues(options.maxIssues));
|
|
22
22
|
} catch (error) {
|
|
23
23
|
printScanError(getErrorMessage(error));
|
|
24
24
|
process.exitCode = 1;
|
|
@@ -60,7 +60,7 @@ async function resolveProjectPath(projectPath) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function printReport(report) {
|
|
63
|
+
function printReport(report, maxIssues) {
|
|
64
64
|
console.log(pc.bold("Qodfy Report"));
|
|
65
65
|
console.log("");
|
|
66
66
|
const scoreColor = report.score >= 80 ? pc.green : report.score >= 60 ? pc.yellow : pc.red;
|
|
@@ -71,13 +71,19 @@ function printReport(report) {
|
|
|
71
71
|
console.log(`API routes: ${report.stats.apiRoutes}`);
|
|
72
72
|
console.log(`AI-related files: ${report.stats.aiFiles}`);
|
|
73
73
|
console.log(`Large files: ${report.stats.largeFiles}`);
|
|
74
|
+
console.log(`Scan duration: ${formatDuration(report.stats.durationMs)}`);
|
|
74
75
|
console.log("");
|
|
75
76
|
if (report.issues.length === 0) {
|
|
76
77
|
console.log(pc.green("No issues found. Your project looks clean."));
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
80
|
console.log(pc.bold("Issues"));
|
|
80
|
-
|
|
81
|
+
const issuesToShow = report.issues.slice(0, maxIssues);
|
|
82
|
+
if (report.issues.length > maxIssues) {
|
|
83
|
+
console.log(`Showing ${maxIssues} of ${report.issues.length} issues.`);
|
|
84
|
+
console.log(`Use --max-issues <number> to show more.`);
|
|
85
|
+
}
|
|
86
|
+
for (const issue of issuesToShow) {
|
|
81
87
|
const label = issue.severity === "critical" ? pc.red("CRITICAL") : issue.severity === "warning" ? pc.yellow("WARNING") : pc.blue("INFO");
|
|
82
88
|
console.log(`
|
|
83
89
|
${label} ${pc.bold(issue.title)}`);
|
|
@@ -108,6 +114,19 @@ function getErrorMessage(error) {
|
|
|
108
114
|
}
|
|
109
115
|
return "An unexpected error occurred while scanning the project.";
|
|
110
116
|
}
|
|
117
|
+
function parseMaxIssues(maxIssues) {
|
|
118
|
+
const parsedMaxIssues = Number.parseInt(maxIssues, 10);
|
|
119
|
+
if (!Number.isFinite(parsedMaxIssues) || parsedMaxIssues <= 0) {
|
|
120
|
+
return 50;
|
|
121
|
+
}
|
|
122
|
+
return parsedMaxIssues;
|
|
123
|
+
}
|
|
124
|
+
function formatDuration(durationMs) {
|
|
125
|
+
if (durationMs < 1e3) {
|
|
126
|
+
return `${durationMs}ms`;
|
|
127
|
+
}
|
|
128
|
+
return `${(durationMs / 1e3).toFixed(1)}s`;
|
|
129
|
+
}
|
|
111
130
|
function getErrorCode(error) {
|
|
112
131
|
if (error && typeof error === "object" && "code" in error && typeof error.code === "string") {
|
|
113
132
|
return error.code;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qodfy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Open-source launch readiness scanner for AI-built apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"qodfy",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"commander": "^14.0.3",
|
|
53
53
|
"picocolors": "^1.1.1",
|
|
54
|
-
"@qodfy/core": "^0.1.
|
|
54
|
+
"@qodfy/core": "^0.1.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^25.7.0",
|