@aiready/deps 0.13.23 → 0.14.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/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-test.log +6 -6
- package/dist/cli.js +8 -19
- package/dist/cli.mjs +8 -19
- package/dist/index.js +10 -35
- package/dist/index.mjs +15 -36
- package/package.json +2 -2
- package/src/cli.ts +8 -20
- package/src/scoring.ts +15 -43
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @aiready/deps@0.
|
|
2
|
+
> @aiready/deps@0.14.0 build /Users/pengcao/projects/aiready/packages/deps
|
|
3
3
|
> tsup src/index.ts src/cli.ts --format cjs,esm --dts
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/cli.ts, src/index.ts
|
|
@@ -8,15 +8,15 @@ CLI tsup v8.5.1
|
|
|
8
8
|
CLI Target: es2020
|
|
9
9
|
CJS Build start
|
|
10
10
|
ESM Build start
|
|
11
|
-
ESM dist/cli.mjs
|
|
12
|
-
ESM dist/index.mjs
|
|
11
|
+
ESM dist/cli.mjs 894.00 B
|
|
12
|
+
ESM dist/index.mjs 1.82 KB
|
|
13
13
|
ESM dist/chunk-QTMAUA24.mjs 5.70 KB
|
|
14
|
-
ESM ⚡️ Build success in
|
|
15
|
-
CJS dist/index.js 8.
|
|
16
|
-
CJS dist/cli.js
|
|
17
|
-
CJS ⚡️ Build success in
|
|
14
|
+
ESM ⚡️ Build success in 167ms
|
|
15
|
+
CJS dist/index.js 8.21 KB
|
|
16
|
+
CJS dist/cli.js 7.82 KB
|
|
17
|
+
CJS ⚡️ Build success in 179ms
|
|
18
18
|
DTS Build start
|
|
19
|
-
DTS ⚡️ Build success in
|
|
19
|
+
DTS ⚡️ Build success in 6997ms
|
|
20
20
|
DTS dist/cli.d.ts 108.00 B
|
|
21
21
|
DTS dist/index.d.ts 1.18 KB
|
|
22
22
|
DTS dist/cli.d.mts 108.00 B
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
> @aiready/deps@0.13.
|
|
2
|
+
> @aiready/deps@0.13.24 test /Users/pengcao/projects/aiready/packages/deps
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/deps[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m src/__tests__/
|
|
9
|
-
[32m✓[39m src/__tests__/
|
|
10
|
-
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
8
|
+
[32m✓[39m src/__tests__/scoring.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/__tests__/provider.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
10
|
+
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
11
11
|
|
|
12
12
|
[2m Test Files [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
13
13
|
[2m Tests [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
14
|
-
[2m Start at [22m
|
|
15
|
-
[2m Duration [22m
|
|
14
|
+
[2m Start at [22m 15:17:55
|
|
15
|
+
[2m Duration [22m 1.24s[2m (transform 697ms, setup 0ms, import 2.59s, tests 19ms, environment 0ms)[22m
|
|
16
16
|
|
package/dist/cli.js
CHANGED
|
@@ -209,6 +209,7 @@ function evaluateHealth(type, deps, path, issues) {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
// src/cli.ts
|
|
212
|
+
var import_core2 = require("@aiready/core");
|
|
212
213
|
var import_picocolors = __toESM(require("picocolors"));
|
|
213
214
|
function createCommand() {
|
|
214
215
|
const program = new import_commander.Command("deps-health").description("Analyze dependency health and AI training cutoff skew").option(
|
|
@@ -216,26 +217,14 @@ function createCommand() {
|
|
|
216
217
|
"The year the target AI model was trained (e.g. 2023)",
|
|
217
218
|
"2023"
|
|
218
219
|
).action(async (options) => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
`Rating: ${report.summary.rating.toUpperCase()} (Score: ${report.summary.score})`
|
|
220
|
+
await (0, import_core2.executeSpokeCli)(
|
|
221
|
+
"Dependency Health",
|
|
222
|
+
"dependency health",
|
|
223
|
+
{
|
|
224
|
+
trainingCutoffYear: parseInt(options.trainingCutoffYear, 10)
|
|
225
|
+
},
|
|
226
|
+
analyzeDeps
|
|
227
227
|
);
|
|
228
|
-
console.log(
|
|
229
|
-
`Total packages analyzed: ${report.summary.packagesAnalyzed}`
|
|
230
|
-
);
|
|
231
|
-
if (report.issues.length > 0) {
|
|
232
|
-
console.log(
|
|
233
|
-
import_picocolors.default.red(`
|
|
234
|
-
Found ${report.issues.length} dependency health issues.`)
|
|
235
|
-
);
|
|
236
|
-
} else {
|
|
237
|
-
console.log(import_picocolors.default.green("\nDependencies are healthy for AI assistance."));
|
|
238
|
-
}
|
|
239
228
|
});
|
|
240
229
|
return program;
|
|
241
230
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
import { Command } from "commander";
|
|
8
|
+
import { executeSpokeCli } from "@aiready/core";
|
|
8
9
|
import pc from "picocolors";
|
|
9
10
|
function createCommand() {
|
|
10
11
|
const program = new Command("deps-health").description("Analyze dependency health and AI training cutoff skew").option(
|
|
@@ -12,26 +13,14 @@ function createCommand() {
|
|
|
12
13
|
"The year the target AI model was trained (e.g. 2023)",
|
|
13
14
|
"2023"
|
|
14
15
|
).action(async (options) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`Rating: ${report.summary.rating.toUpperCase()} (Score: ${report.summary.score})`
|
|
16
|
+
await executeSpokeCli(
|
|
17
|
+
"Dependency Health",
|
|
18
|
+
"dependency health",
|
|
19
|
+
{
|
|
20
|
+
trainingCutoffYear: parseInt(options.trainingCutoffYear, 10)
|
|
21
|
+
},
|
|
22
|
+
analyzeDeps
|
|
23
23
|
);
|
|
24
|
-
console.log(
|
|
25
|
-
`Total packages analyzed: ${report.summary.packagesAnalyzed}`
|
|
26
|
-
);
|
|
27
|
-
if (report.issues.length > 0) {
|
|
28
|
-
console.log(
|
|
29
|
-
pc.red(`
|
|
30
|
-
Found ${report.issues.length} dependency health issues.`)
|
|
31
|
-
);
|
|
32
|
-
} else {
|
|
33
|
-
console.log(pc.green("\nDependencies are healthy for AI assistance."));
|
|
34
|
-
}
|
|
35
24
|
});
|
|
36
25
|
return program;
|
|
37
26
|
}
|
package/dist/index.js
CHANGED
|
@@ -242,44 +242,19 @@ function calculateDepsScore(report) {
|
|
|
242
242
|
deprecatedPackages: rawData.deprecatedPackages,
|
|
243
243
|
trainingCutoffSkew: rawData.trainingCutoffSkew
|
|
244
244
|
});
|
|
245
|
-
|
|
246
|
-
{
|
|
247
|
-
name: "Outdated Packages",
|
|
248
|
-
impact: -Math.min(
|
|
249
|
-
30,
|
|
250
|
-
rawData.outdatedPackages / Math.max(1, rawData.totalPackages) * 100 * 0.3
|
|
251
|
-
),
|
|
252
|
-
description: `${rawData.outdatedPackages} outdated packages`
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
name: "Deprecated Packages",
|
|
256
|
-
impact: -Math.min(
|
|
257
|
-
40,
|
|
258
|
-
rawData.deprecatedPackages / Math.max(1, rawData.totalPackages) * 100 * 0.4
|
|
259
|
-
),
|
|
260
|
-
description: `${rawData.deprecatedPackages} deprecated packages`
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
name: "Training Cutoff Skew",
|
|
264
|
-
impact: -Math.min(30, rawData.trainingCutoffSkew * 100 * 0.3),
|
|
265
|
-
description: `Training cutoff skew of ${rawData.trainingCutoffSkew.toFixed(1)} years`
|
|
266
|
-
}
|
|
267
|
-
];
|
|
268
|
-
const recommendations = riskResult.recommendations.map((rec) => ({
|
|
269
|
-
action: rec,
|
|
270
|
-
estimatedImpact: 6,
|
|
271
|
-
priority: summary.score < 50 ? "high" : "medium"
|
|
272
|
-
}));
|
|
273
|
-
return {
|
|
245
|
+
return (0, import_core3.buildStandardToolScore)({
|
|
274
246
|
toolName: import_core3.ToolName.DependencyHealth,
|
|
275
247
|
score: summary.score,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
248
|
+
rawData,
|
|
249
|
+
dimensions: riskResult.dimensions,
|
|
250
|
+
dimensionNames: {
|
|
251
|
+
outdatedScore: "Outdated Packages",
|
|
252
|
+
deprecatedScore: "Deprecated Packages",
|
|
253
|
+
skewScore: "Training Cutoff Skew"
|
|
279
254
|
},
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
};
|
|
255
|
+
recommendations: riskResult.recommendations,
|
|
256
|
+
rating: summary.rating
|
|
257
|
+
});
|
|
283
258
|
}
|
|
284
259
|
|
|
285
260
|
// src/index.ts
|
package/dist/index.mjs
CHANGED
|
@@ -41,7 +41,11 @@ var DepsProvider = createProvider({
|
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
// src/scoring.ts
|
|
44
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
calculateDependencyHealth,
|
|
46
|
+
ToolName as ToolName2,
|
|
47
|
+
buildStandardToolScore
|
|
48
|
+
} from "@aiready/core";
|
|
45
49
|
function calculateDepsScore(report) {
|
|
46
50
|
const { rawData, summary } = report;
|
|
47
51
|
const riskResult = calculateDependencyHealth({
|
|
@@ -50,44 +54,19 @@ function calculateDepsScore(report) {
|
|
|
50
54
|
deprecatedPackages: rawData.deprecatedPackages,
|
|
51
55
|
trainingCutoffSkew: rawData.trainingCutoffSkew
|
|
52
56
|
});
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
name: "Outdated Packages",
|
|
56
|
-
impact: -Math.min(
|
|
57
|
-
30,
|
|
58
|
-
rawData.outdatedPackages / Math.max(1, rawData.totalPackages) * 100 * 0.3
|
|
59
|
-
),
|
|
60
|
-
description: `${rawData.outdatedPackages} outdated packages`
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: "Deprecated Packages",
|
|
64
|
-
impact: -Math.min(
|
|
65
|
-
40,
|
|
66
|
-
rawData.deprecatedPackages / Math.max(1, rawData.totalPackages) * 100 * 0.4
|
|
67
|
-
),
|
|
68
|
-
description: `${rawData.deprecatedPackages} deprecated packages`
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: "Training Cutoff Skew",
|
|
72
|
-
impact: -Math.min(30, rawData.trainingCutoffSkew * 100 * 0.3),
|
|
73
|
-
description: `Training cutoff skew of ${rawData.trainingCutoffSkew.toFixed(1)} years`
|
|
74
|
-
}
|
|
75
|
-
];
|
|
76
|
-
const recommendations = riskResult.recommendations.map((rec) => ({
|
|
77
|
-
action: rec,
|
|
78
|
-
estimatedImpact: 6,
|
|
79
|
-
priority: summary.score < 50 ? "high" : "medium"
|
|
80
|
-
}));
|
|
81
|
-
return {
|
|
57
|
+
return buildStandardToolScore({
|
|
82
58
|
toolName: ToolName2.DependencyHealth,
|
|
83
59
|
score: summary.score,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
60
|
+
rawData,
|
|
61
|
+
dimensions: riskResult.dimensions,
|
|
62
|
+
dimensionNames: {
|
|
63
|
+
outdatedScore: "Outdated Packages",
|
|
64
|
+
deprecatedScore: "Deprecated Packages",
|
|
65
|
+
skewScore: "Training Cutoff Skew"
|
|
87
66
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
};
|
|
67
|
+
recommendations: riskResult.recommendations,
|
|
68
|
+
rating: summary.rating
|
|
69
|
+
});
|
|
91
70
|
}
|
|
92
71
|
|
|
93
72
|
// src/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/deps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "AI-Readiness: Dependency Health & Cutoff Skew",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"commander": "^14.0.0",
|
|
10
10
|
"picocolors": "^1.0.0",
|
|
11
11
|
"semver": "^7.6.0",
|
|
12
|
-
"@aiready/core": "0.
|
|
12
|
+
"@aiready/core": "0.24.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@types/node": "^24.0.0",
|
package/src/cli.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { analyzeDeps } from './analyzer';
|
|
3
|
+
import { executeSpokeCli } from '@aiready/core';
|
|
3
4
|
import pc from 'picocolors';
|
|
4
5
|
|
|
5
6
|
export function createCommand() {
|
|
@@ -11,27 +12,14 @@ export function createCommand() {
|
|
|
11
12
|
'2023'
|
|
12
13
|
)
|
|
13
14
|
.action(async (options) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
console.log(
|
|
22
|
-
`Rating: ${report.summary.rating.toUpperCase()} (Score: ${report.summary.score})`
|
|
23
|
-
);
|
|
24
|
-
console.log(
|
|
25
|
-
`Total packages analyzed: ${report.summary.packagesAnalyzed}`
|
|
15
|
+
await executeSpokeCli(
|
|
16
|
+
'Dependency Health',
|
|
17
|
+
'dependency health',
|
|
18
|
+
{
|
|
19
|
+
trainingCutoffYear: parseInt(options.trainingCutoffYear, 10),
|
|
20
|
+
},
|
|
21
|
+
analyzeDeps
|
|
26
22
|
);
|
|
27
|
-
|
|
28
|
-
if (report.issues.length > 0) {
|
|
29
|
-
console.log(
|
|
30
|
-
pc.red(`\nFound ${report.issues.length} dependency health issues.`)
|
|
31
|
-
);
|
|
32
|
-
} else {
|
|
33
|
-
console.log(pc.green('\nDependencies are healthy for AI assistance.'));
|
|
34
|
-
}
|
|
35
23
|
});
|
|
36
24
|
|
|
37
25
|
return program;
|
package/src/scoring.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
calculateDependencyHealth,
|
|
3
|
+
ToolName,
|
|
4
|
+
buildStandardToolScore,
|
|
5
|
+
} from '@aiready/core';
|
|
2
6
|
import type { ToolScoringOutput } from '@aiready/core';
|
|
3
7
|
import type { DepsReport } from './types';
|
|
4
8
|
|
|
@@ -16,49 +20,17 @@ export function calculateDepsScore(report: DepsReport): ToolScoringOutput {
|
|
|
16
20
|
trainingCutoffSkew: rawData.trainingCutoffSkew,
|
|
17
21
|
});
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
name: 'Outdated Packages',
|
|
22
|
-
impact: -Math.min(
|
|
23
|
-
30,
|
|
24
|
-
(rawData.outdatedPackages / Math.max(1, rawData.totalPackages)) *
|
|
25
|
-
100 *
|
|
26
|
-
0.3
|
|
27
|
-
),
|
|
28
|
-
description: `${rawData.outdatedPackages} outdated packages`,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'Deprecated Packages',
|
|
32
|
-
impact: -Math.min(
|
|
33
|
-
40,
|
|
34
|
-
(rawData.deprecatedPackages / Math.max(1, rawData.totalPackages)) *
|
|
35
|
-
100 *
|
|
36
|
-
0.4
|
|
37
|
-
),
|
|
38
|
-
description: `${rawData.deprecatedPackages} deprecated packages`,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'Training Cutoff Skew',
|
|
42
|
-
impact: -Math.min(30, rawData.trainingCutoffSkew * 100 * 0.3),
|
|
43
|
-
description: `Training cutoff skew of ${rawData.trainingCutoffSkew.toFixed(1)} years`,
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
const recommendations: ToolScoringOutput['recommendations'] =
|
|
48
|
-
riskResult.recommendations.map((rec) => ({
|
|
49
|
-
action: rec,
|
|
50
|
-
estimatedImpact: 6,
|
|
51
|
-
priority: summary.score < 50 ? 'high' : 'medium',
|
|
52
|
-
}));
|
|
53
|
-
|
|
54
|
-
return {
|
|
23
|
+
return buildStandardToolScore({
|
|
55
24
|
toolName: ToolName.DependencyHealth,
|
|
56
25
|
score: summary.score,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
26
|
+
rawData,
|
|
27
|
+
dimensions: riskResult.dimensions,
|
|
28
|
+
dimensionNames: {
|
|
29
|
+
outdatedScore: 'Outdated Packages',
|
|
30
|
+
deprecatedScore: 'Deprecated Packages',
|
|
31
|
+
skewScore: 'Training Cutoff Skew',
|
|
60
32
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
33
|
+
recommendations: riskResult.recommendations,
|
|
34
|
+
rating: summary.rating,
|
|
35
|
+
});
|
|
64
36
|
}
|