@aiready/testability 0.1.11 → 0.1.12
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/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-test.log +4 -4
- package/dist/cli.js +4 -34
- package/dist/cli.mjs +8 -35
- package/package.json +2 -2
- package/src/cli.ts +7 -42
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/testability@0.1.
|
|
3
|
+
> @aiready/testability@0.1.12 build /Users/pengcao/projects/aiready/packages/testability
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm --dts
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m5.75 KB[39m
|
|
12
13
|
[32mESM[39m [1mdist/index.mjs [22m[32m152.00 B[39m
|
|
13
14
|
[32mESM[39m [1mdist/chunk-DDNB7FI4.mjs [22m[32m10.93 KB[39m
|
|
14
|
-
[32mESM[39m
|
|
15
|
-
[
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 1004ms
|
|
16
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m18.21 KB[39m
|
|
16
17
|
[32mCJS[39m [1mdist/index.js [22m[32m12.12 KB[39m
|
|
17
|
-
[32mCJS[39m
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in 47ms
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 1051ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 14091ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
22
|
DTS dist/index.d.ts 2.64 KB
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/testability@0.1.
|
|
3
|
+
> @aiready/testability@0.1.12 test /Users/pengcao/projects/aiready/packages/testability
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
7
7
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/testability[39m
|
|
8
8
|
|
|
9
|
-
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
9
|
+
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 204[2mms[22m[39m
|
|
10
10
|
|
|
11
11
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
12
|
[2m Tests [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
13
|
-
[2m Start at [22m
|
|
14
|
-
[2m Duration [22m
|
|
13
|
+
[2m Start at [22m 23:46:49
|
|
14
|
+
[2m Duration [22m 1.43s[2m (transform 167ms, setup 0ms, import 793ms, tests 204ms, environment 0ms)[22m
|
|
15
15
|
|
|
16
16
|
[?25h
|
package/dist/cli.js
CHANGED
|
@@ -424,37 +424,6 @@ EXAMPLES:
|
|
|
424
424
|
}
|
|
425
425
|
});
|
|
426
426
|
program.parse();
|
|
427
|
-
function safetyColor(rating) {
|
|
428
|
-
switch (rating) {
|
|
429
|
-
case "safe":
|
|
430
|
-
return import_chalk.default.green;
|
|
431
|
-
case "moderate-risk":
|
|
432
|
-
return import_chalk.default.yellow;
|
|
433
|
-
case "high-risk":
|
|
434
|
-
return import_chalk.default.red;
|
|
435
|
-
case "blind-risk":
|
|
436
|
-
return import_chalk.default.bgRed.white;
|
|
437
|
-
default:
|
|
438
|
-
return import_chalk.default.white;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
function safetyIcon(rating) {
|
|
442
|
-
switch (rating) {
|
|
443
|
-
case "safe":
|
|
444
|
-
return "\u2705";
|
|
445
|
-
case "moderate-risk":
|
|
446
|
-
return "\u26A0\uFE0F ";
|
|
447
|
-
case "high-risk":
|
|
448
|
-
return "\u{1F534}";
|
|
449
|
-
case "blind-risk":
|
|
450
|
-
return "\u{1F480}";
|
|
451
|
-
default:
|
|
452
|
-
return "\u2753";
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
function scoreBar(val) {
|
|
456
|
-
return "\u2588".repeat(Math.round(val / 10)).padEnd(10, "\u2591");
|
|
457
|
-
}
|
|
458
427
|
function displayConsoleReport(report, scoring, elapsed) {
|
|
459
428
|
const { summary, rawData, issues, recommendations } = report;
|
|
460
429
|
const safetyRating = summary.aiChangeSafetyRating;
|
|
@@ -474,8 +443,9 @@ function displayConsoleReport(report, scoring, elapsed) {
|
|
|
474
443
|
);
|
|
475
444
|
console.log();
|
|
476
445
|
}
|
|
446
|
+
const safetyColor = (0, import_core2.getSeverityColor)(safetyRating, import_chalk.default);
|
|
477
447
|
console.log(
|
|
478
|
-
`AI Change Safety: ${safetyColor(
|
|
448
|
+
`AI Change Safety: ${safetyColor(`${(0, import_core2.getSafetyIcon)(safetyRating)} ${safetyRating.toUpperCase()}`)}`
|
|
479
449
|
);
|
|
480
450
|
console.log(
|
|
481
451
|
`Score: ${import_chalk.default.bold(summary.score + "/100")} (${summary.rating})`
|
|
@@ -498,12 +468,12 @@ function displayConsoleReport(report, scoring, elapsed) {
|
|
|
498
468
|
];
|
|
499
469
|
for (const [name, val] of dims) {
|
|
500
470
|
const color = val >= 70 ? import_chalk.default.green : val >= 50 ? import_chalk.default.yellow : import_chalk.default.red;
|
|
501
|
-
console.log(` ${name.padEnd(22)} ${color(
|
|
471
|
+
console.log(` ${name.padEnd(22)} ${color((0, import_core2.getScoreBar)(val))} ${val}/100`);
|
|
502
472
|
}
|
|
503
473
|
if (issues.length > 0) {
|
|
504
474
|
console.log(import_chalk.default.bold("\n\u26A0\uFE0F Issues\n"));
|
|
505
475
|
for (const issue of issues) {
|
|
506
|
-
const sev =
|
|
476
|
+
const sev = (0, import_core2.getSeverityColor)(issue.severity, import_chalk.default);
|
|
507
477
|
console.log(`${sev(issue.severity.toUpperCase())} ${issue.message}`);
|
|
508
478
|
if (issue.suggestion)
|
|
509
479
|
console.log(
|
package/dist/cli.mjs
CHANGED
|
@@ -12,7 +12,10 @@ import { dirname } from "path";
|
|
|
12
12
|
import {
|
|
13
13
|
loadConfig,
|
|
14
14
|
mergeConfigWithDefaults,
|
|
15
|
-
resolveOutputPath
|
|
15
|
+
resolveOutputPath,
|
|
16
|
+
getScoreBar,
|
|
17
|
+
getSafetyIcon,
|
|
18
|
+
getSeverityColor
|
|
16
19
|
} from "@aiready/core";
|
|
17
20
|
var program = new Command();
|
|
18
21
|
program.name("aiready-testability").description(
|
|
@@ -78,37 +81,6 @@ EXAMPLES:
|
|
|
78
81
|
}
|
|
79
82
|
});
|
|
80
83
|
program.parse();
|
|
81
|
-
function safetyColor(rating) {
|
|
82
|
-
switch (rating) {
|
|
83
|
-
case "safe":
|
|
84
|
-
return chalk.green;
|
|
85
|
-
case "moderate-risk":
|
|
86
|
-
return chalk.yellow;
|
|
87
|
-
case "high-risk":
|
|
88
|
-
return chalk.red;
|
|
89
|
-
case "blind-risk":
|
|
90
|
-
return chalk.bgRed.white;
|
|
91
|
-
default:
|
|
92
|
-
return chalk.white;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function safetyIcon(rating) {
|
|
96
|
-
switch (rating) {
|
|
97
|
-
case "safe":
|
|
98
|
-
return "\u2705";
|
|
99
|
-
case "moderate-risk":
|
|
100
|
-
return "\u26A0\uFE0F ";
|
|
101
|
-
case "high-risk":
|
|
102
|
-
return "\u{1F534}";
|
|
103
|
-
case "blind-risk":
|
|
104
|
-
return "\u{1F480}";
|
|
105
|
-
default:
|
|
106
|
-
return "\u2753";
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function scoreBar(val) {
|
|
110
|
-
return "\u2588".repeat(Math.round(val / 10)).padEnd(10, "\u2591");
|
|
111
|
-
}
|
|
112
84
|
function displayConsoleReport(report, scoring, elapsed) {
|
|
113
85
|
const { summary, rawData, issues, recommendations } = report;
|
|
114
86
|
const safetyRating = summary.aiChangeSafetyRating;
|
|
@@ -128,8 +100,9 @@ function displayConsoleReport(report, scoring, elapsed) {
|
|
|
128
100
|
);
|
|
129
101
|
console.log();
|
|
130
102
|
}
|
|
103
|
+
const safetyColor = getSeverityColor(safetyRating, chalk);
|
|
131
104
|
console.log(
|
|
132
|
-
`AI Change Safety: ${safetyColor(
|
|
105
|
+
`AI Change Safety: ${safetyColor(`${getSafetyIcon(safetyRating)} ${safetyRating.toUpperCase()}`)}`
|
|
133
106
|
);
|
|
134
107
|
console.log(
|
|
135
108
|
`Score: ${chalk.bold(summary.score + "/100")} (${summary.rating})`
|
|
@@ -152,12 +125,12 @@ function displayConsoleReport(report, scoring, elapsed) {
|
|
|
152
125
|
];
|
|
153
126
|
for (const [name, val] of dims) {
|
|
154
127
|
const color = val >= 70 ? chalk.green : val >= 50 ? chalk.yellow : chalk.red;
|
|
155
|
-
console.log(` ${name.padEnd(22)} ${color(
|
|
128
|
+
console.log(` ${name.padEnd(22)} ${color(getScoreBar(val))} ${val}/100`);
|
|
156
129
|
}
|
|
157
130
|
if (issues.length > 0) {
|
|
158
131
|
console.log(chalk.bold("\n\u26A0\uFE0F Issues\n"));
|
|
159
132
|
for (const issue of issues) {
|
|
160
|
-
const sev = issue.severity
|
|
133
|
+
const sev = getSeverityColor(issue.severity, chalk);
|
|
161
134
|
console.log(`${sev(issue.severity.toUpperCase())} ${issue.message}`);
|
|
162
135
|
if (issue.suggestion)
|
|
163
136
|
console.log(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/testability",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Measures how safely and verifiably AI-generated changes can be made to your codebase",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"chalk": "^5.3.0",
|
|
41
41
|
"commander": "^14.0.0",
|
|
42
42
|
"glob": "^13.0.0",
|
|
43
|
-
"@aiready/core": "0.9.
|
|
43
|
+
"@aiready/core": "0.9.39"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^24.0.0",
|
package/src/cli.ts
CHANGED
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
loadConfig,
|
|
12
12
|
mergeConfigWithDefaults,
|
|
13
13
|
resolveOutputPath,
|
|
14
|
+
getScoreBar,
|
|
15
|
+
getSafetyIcon,
|
|
16
|
+
getSeverityColor,
|
|
14
17
|
} from '@aiready/core';
|
|
15
18
|
|
|
16
19
|
const program = new Command();
|
|
@@ -98,40 +101,6 @@ EXAMPLES:
|
|
|
98
101
|
|
|
99
102
|
program.parse();
|
|
100
103
|
|
|
101
|
-
function safetyColor(rating: string) {
|
|
102
|
-
switch (rating) {
|
|
103
|
-
case 'safe':
|
|
104
|
-
return chalk.green;
|
|
105
|
-
case 'moderate-risk':
|
|
106
|
-
return chalk.yellow;
|
|
107
|
-
case 'high-risk':
|
|
108
|
-
return chalk.red;
|
|
109
|
-
case 'blind-risk':
|
|
110
|
-
return chalk.bgRed.white;
|
|
111
|
-
default:
|
|
112
|
-
return chalk.white;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function safetyIcon(rating: string) {
|
|
117
|
-
switch (rating) {
|
|
118
|
-
case 'safe':
|
|
119
|
-
return '✅';
|
|
120
|
-
case 'moderate-risk':
|
|
121
|
-
return '⚠️ ';
|
|
122
|
-
case 'high-risk':
|
|
123
|
-
return '🔴';
|
|
124
|
-
case 'blind-risk':
|
|
125
|
-
return '💀';
|
|
126
|
-
default:
|
|
127
|
-
return '❓';
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function scoreBar(val: number): string {
|
|
132
|
-
return '█'.repeat(Math.round(val / 10)).padEnd(10, '░');
|
|
133
|
-
}
|
|
134
|
-
|
|
135
104
|
function displayConsoleReport(report: any, scoring: any, elapsed: string) {
|
|
136
105
|
const { summary, rawData, issues, recommendations } = report;
|
|
137
106
|
|
|
@@ -155,8 +124,9 @@ function displayConsoleReport(report: any, scoring: any, elapsed: string) {
|
|
|
155
124
|
console.log();
|
|
156
125
|
}
|
|
157
126
|
|
|
127
|
+
const safetyColor = getSeverityColor(safetyRating, chalk);
|
|
158
128
|
console.log(
|
|
159
|
-
`AI Change Safety: ${safetyColor(
|
|
129
|
+
`AI Change Safety: ${safetyColor(`${getSafetyIcon(safetyRating)} ${safetyRating.toUpperCase()}`)}`
|
|
160
130
|
);
|
|
161
131
|
console.log(
|
|
162
132
|
`Score: ${chalk.bold(summary.score + '/100')} (${summary.rating})`
|
|
@@ -180,18 +150,13 @@ function displayConsoleReport(report: any, scoring: any, elapsed: string) {
|
|
|
180
150
|
for (const [name, val] of dims) {
|
|
181
151
|
const color =
|
|
182
152
|
val >= 70 ? chalk.green : val >= 50 ? chalk.yellow : chalk.red;
|
|
183
|
-
console.log(` ${name.padEnd(22)} ${color(
|
|
153
|
+
console.log(` ${name.padEnd(22)} ${color(getScoreBar(val))} ${val}/100`);
|
|
184
154
|
}
|
|
185
155
|
|
|
186
156
|
if (issues.length > 0) {
|
|
187
157
|
console.log(chalk.bold('\n⚠️ Issues\n'));
|
|
188
158
|
for (const issue of issues) {
|
|
189
|
-
const sev =
|
|
190
|
-
issue.severity === 'critical'
|
|
191
|
-
? chalk.red
|
|
192
|
-
: issue.severity === 'major'
|
|
193
|
-
? chalk.yellow
|
|
194
|
-
: chalk.blue;
|
|
159
|
+
const sev = getSeverityColor(issue.severity, chalk);
|
|
195
160
|
console.log(`${sev(issue.severity.toUpperCase())} ${issue.message}`);
|
|
196
161
|
if (issue.suggestion)
|
|
197
162
|
console.log(
|