@aiready/deps 0.13.23 → 0.13.24

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.
@@ -1,23 +1,24 @@
1
-
2
- > @aiready/deps@0.13.23 build /Users/pengcao/projects/aiready/packages/deps
3
- > tsup src/index.ts src/cli.ts --format cjs,esm --dts
4
-
5
- CLI Building entry: src/cli.ts, src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.1
8
- CLI Target: es2020
9
- CJS Build start
10
- ESM Build start
11
- ESM dist/cli.mjs 1.33 KB
12
- ESM dist/index.mjs 2.46 KB
13
- ESM dist/chunk-QTMAUA24.mjs 5.70 KB
14
- ESM ⚡️ Build success in 129ms
15
- CJS dist/index.js 8.86 KB
16
- CJS dist/cli.js 8.36 KB
17
- CJS ⚡️ Build success in 130ms
18
- DTS Build start
19
- DTS ⚡️ Build success in 3828ms
20
- DTS dist/cli.d.ts 108.00 B
21
- DTS dist/index.d.ts 1.18 KB
22
- DTS dist/cli.d.mts 108.00 B
23
- DTS dist/index.d.mts 1.18 KB
1
+
2
+ 
3
+ > @aiready/deps@0.13.24 build /Users/pengcao/projects/aiready/packages/deps
4
+ > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
+
6
+ CLI Building entry: src/cli.ts, src/index.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.1
9
+ CLI Target: es2020
10
+ CJS Build start
11
+ ESM Build start
12
+ CJS dist/cli.js 7.82 KB
13
+ CJS dist/index.js 8.21 KB
14
+ CJS ⚡️ Build success in 60ms
15
+ ESM dist/index.mjs 1.82 KB
16
+ ESM dist/cli.mjs 894.00 B
17
+ ESM dist/chunk-QTMAUA24.mjs 5.70 KB
18
+ ESM ⚡️ Build success in 61ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 1268ms
21
+ DTS dist/cli.d.ts 108.00 B
22
+ DTS dist/index.d.ts 1.18 KB
23
+ DTS dist/cli.d.mts 108.00 B
24
+ DTS dist/index.d.mts 1.18 KB
@@ -1,16 +1,18 @@
1
-
2
- > @aiready/deps@0.13.22 test /Users/pengcao/projects/aiready/packages/deps
3
- > vitest run
4
-
5
-
6
-  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/deps
7
-
8
- ✓ src/__tests__/provider.test.ts (2 tests) 5ms
9
- ✓ src/__tests__/scoring.test.ts (2 tests) 4ms
10
- ✓ src/__tests__/analyzer.test.ts (2 tests) 8ms
11
-
12
-  Test Files  3 passed (3)
13
-  Tests  6 passed (6)
14
-  Start at  19:39:18
15
-  Duration  2.98s (transform 1.28s, setup 0ms, import 6.48s, tests 17ms, environment 0ms)
16
-
1
+
2
+ 
3
+ > @aiready/deps@0.13.23 test /Users/pengcao/projects/aiready/packages/deps
4
+ > vitest run
5
+
6
+ [?25l
7
+  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/deps
8
+
9
+ ✓ src/__tests__/scoring.test.ts (2 tests) 3ms
10
+ ✓ src/__tests__/provider.test.ts (2 tests) 6ms
11
+ ✓ src/__tests__/analyzer.test.ts (2 tests) 12ms
12
+
13
+  Test Files  3 passed (3)
14
+  Tests  6 passed (6)
15
+  Start at  01:34:01
16
+  Duration  1.48s (transform 623ms, setup 0ms, import 2.89s, tests 20ms, environment 4ms)
17
+
18
+ [?25h
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
- console.log(import_picocolors.default.cyan("Analyzing dependency health..."));
220
- const report = await analyzeDeps({
221
- rootDir: process.cwd(),
222
- trainingCutoffYear: parseInt(options.trainingCutoffYear, 10)
223
- });
224
- console.log(import_picocolors.default.bold("\nDependency Health Analysis Results:"));
225
- console.log(
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
- console.log(pc.cyan("Analyzing dependency health..."));
16
- const report = await analyzeDeps({
17
- rootDir: process.cwd(),
18
- trainingCutoffYear: parseInt(options.trainingCutoffYear, 10)
19
- });
20
- console.log(pc.bold("\nDependency Health Analysis Results:"));
21
- console.log(
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
- const factors = [
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
- rawMetrics: {
277
- ...rawData,
278
- rating: summary.rating
248
+ rawData,
249
+ dimensions: riskResult.dimensions,
250
+ dimensionNames: {
251
+ outdatedScore: "Outdated Packages",
252
+ deprecatedScore: "Deprecated Packages",
253
+ skewScore: "Training Cutoff Skew"
279
254
  },
280
- factors,
281
- recommendations
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 { calculateDependencyHealth, ToolName as ToolName2 } from "@aiready/core";
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
- const factors = [
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
- rawMetrics: {
85
- ...rawData,
86
- rating: summary.rating
60
+ rawData,
61
+ dimensions: riskResult.dimensions,
62
+ dimensionNames: {
63
+ outdatedScore: "Outdated Packages",
64
+ deprecatedScore: "Deprecated Packages",
65
+ skewScore: "Training Cutoff Skew"
87
66
  },
88
- factors,
89
- recommendations
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.13.23",
3
+ "version": "0.13.24",
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.23.23"
12
+ "@aiready/core": "0.23.24"
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
- console.log(pc.cyan('Analyzing dependency health...'));
15
- const report = await analyzeDeps({
16
- rootDir: process.cwd(),
17
- trainingCutoffYear: parseInt(options.trainingCutoffYear, 10),
18
- });
19
-
20
- console.log(pc.bold('\nDependency Health Analysis Results:'));
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 { calculateDependencyHealth, ToolName } from '@aiready/core';
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
- const factors: ToolScoringOutput['factors'] = [
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
- rawMetrics: {
58
- ...rawData,
59
- rating: summary.rating,
26
+ rawData,
27
+ dimensions: riskResult.dimensions,
28
+ dimensionNames: {
29
+ outdatedScore: 'Outdated Packages',
30
+ deprecatedScore: 'Deprecated Packages',
31
+ skewScore: 'Training Cutoff Skew',
60
32
  },
61
- factors,
62
- recommendations,
63
- };
33
+ recommendations: riskResult.recommendations,
34
+ rating: summary.rating,
35
+ });
64
36
  }