@aiready/deps 0.9.3 → 0.11.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.9.2 build /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.10.0 build /Users/pengcao/projects/aiready/packages/deps
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,58 +9,16 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
-
13
-  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 7:57:09 pm
14
-
15
- package.json:32:6:
16
-  32 │ "types": "./dist/index.d.ts"
17
- ╵ ~~~~~~~
18
-
19
- The "import" condition comes earlier and will be used for all "import" statements:
20
-
21
- package.json:30:6:
22
-  30 │ "import": "./dist/index.mjs",
23
- ╵ ~~~~~~~~
24
-
25
- The "require" condition comes earlier and will be used for all "require" calls:
26
-
27
- package.json:31:6:
28
-  31 │ "require": "./dist/index.js",
29
- ╵ ~~~~~~~~~
30
-
31
-
32
-
33
-
34
-  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 7:57:09 pm
35
-
36
- package.json:32:6:
37
-  32 │ "types": "./dist/index.d.ts"
38
- ╵ ~~~~~~~
39
-
40
- The "import" condition comes earlier and will be used for all "import" statements:
41
-
42
- package.json:30:6:
43
-  30 │ "import": "./dist/index.mjs",
44
- ╵ ~~~~~~~~
45
-
46
- The "require" condition comes earlier and will be used for all "require" calls:
47
-
48
- package.json:31:6:
49
-  31 │ "require": "./dist/index.js",
50
- ╵ ~~~~~~~~~
51
-
52
-
53
-
12
+ CJS dist/index.js 5.53 KB
54
13
  CJS dist/cli.js 5.87 KB
55
- CJS dist/index.js 3.89 KB
56
- CJS ⚡️ Build success in 147ms
14
+ CJS ⚡️ Build success in 145ms
57
15
  ESM dist/cli.mjs 1.33 KB
16
+ ESM dist/index.mjs 1.64 KB
58
17
  ESM dist/chunk-4D7DCOHZ.mjs 3.18 KB
59
- ESM dist/index.mjs 80.00 B
60
- ESM ⚡️ Build success in 147ms
18
+ ESM ⚡️ Build success in 145ms
61
19
  DTS Build start
62
- DTS ⚡️ Build success in 1591ms
20
+ DTS ⚡️ Build success in 2509ms
63
21
  DTS dist/cli.d.ts 108.00 B
64
- DTS dist/index.d.ts 857.00 B
22
+ DTS dist/index.d.ts 971.00 B
65
23
  DTS dist/cli.d.mts 108.00 B
66
- DTS dist/index.d.mts 857.00 B
24
+ DTS dist/index.d.mts 971.00 B
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.1.6 lint /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.9.5 lint /Users/pengcao/projects/aiready/packages/deps
4
4
  > eslint src --ext .ts
5
5
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.9.2 test /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.10.0 test /Users/pengcao/projects/aiready/packages/deps
4
4
  > vitest run
5
5
 
6
6
  [?25l
@@ -10,7 +10,7 @@
10
10
 
11
11
   Test Files  1 passed (1)
12
12
   Tests  1 passed (1)
13
-  Start at  20:00:26
14
-  Duration  2.00s (transform 322ms, setup 0ms, import 1.39s, tests 3ms, environment 0ms)
13
+  Start at  09:33:04
14
+  Duration  738ms (transform 123ms, setup 0ms, import 433ms, tests 3ms, environment 0ms)
15
15
 
16
16
  [?25h
package/dist/index.d.mts CHANGED
@@ -1,4 +1,9 @@
1
- import { Issue, IssueType, ScanOptions } from '@aiready/core';
1
+ import { ToolProvider, Issue, IssueType, ScanOptions } from '@aiready/core';
2
+
3
+ /**
4
+ * Dependency Health Tool Provider
5
+ */
6
+ declare const DepsProvider: ToolProvider;
2
7
 
3
8
  interface DepsOptions extends ScanOptions {
4
9
  /** The year the AI model was trained. Defaults to 2023. */
@@ -26,4 +31,4 @@ interface DepsReport {
26
31
 
27
32
  declare function analyzeDeps(options: DepsOptions): Promise<DepsReport>;
28
33
 
29
- export { type DepsIssue, type DepsOptions, type DepsReport, analyzeDeps };
34
+ export { type DepsIssue, type DepsOptions, DepsProvider, type DepsReport, analyzeDeps };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import { Issue, IssueType, ScanOptions } from '@aiready/core';
1
+ import { ToolProvider, Issue, IssueType, ScanOptions } from '@aiready/core';
2
+
3
+ /**
4
+ * Dependency Health Tool Provider
5
+ */
6
+ declare const DepsProvider: ToolProvider;
2
7
 
3
8
  interface DepsOptions extends ScanOptions {
4
9
  /** The year the AI model was trained. Defaults to 2023. */
@@ -26,4 +31,4 @@ interface DepsReport {
26
31
 
27
32
  declare function analyzeDeps(options: DepsOptions): Promise<DepsReport>;
28
33
 
29
- export { type DepsIssue, type DepsOptions, type DepsReport, analyzeDeps };
34
+ export { type DepsIssue, type DepsOptions, DepsProvider, type DepsReport, analyzeDeps };
package/dist/index.js CHANGED
@@ -20,9 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ DepsProvider: () => DepsProvider,
23
24
  analyzeDeps: () => analyzeDeps
24
25
  });
25
26
  module.exports = __toCommonJS(index_exports);
27
+ var import_core3 = require("@aiready/core");
28
+
29
+ // src/provider.ts
30
+ var import_core2 = require("@aiready/core");
26
31
 
27
32
  // src/analyzer.ts
28
33
  var import_core = require("@aiready/core");
@@ -109,7 +114,64 @@ async function analyzeDeps(options) {
109
114
  recommendations: riskResult.recommendations
110
115
  };
111
116
  }
117
+
118
+ // src/provider.ts
119
+ var DepsProvider = {
120
+ id: import_core2.ToolName.DependencyHealth,
121
+ alias: ["deps", "deps-health", "packages"],
122
+ async analyze(options) {
123
+ const report = await analyzeDeps(options);
124
+ const fileIssuesMap = /* @__PURE__ */ new Map();
125
+ for (const issue of report.issues) {
126
+ const file = issue.location.file;
127
+ if (!fileIssuesMap.has(file)) fileIssuesMap.set(file, []);
128
+ fileIssuesMap.get(file).push(issue);
129
+ }
130
+ const results = Array.from(fileIssuesMap.entries()).map(
131
+ ([fileName, issues]) => ({
132
+ fileName,
133
+ issues,
134
+ metrics: {}
135
+ })
136
+ );
137
+ return import_core2.SpokeOutputSchema.parse({
138
+ results,
139
+ summary: report.summary,
140
+ metadata: {
141
+ toolName: import_core2.ToolName.DependencyHealth,
142
+ version: "0.9.5",
143
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
144
+ rawData: report.rawData
145
+ }
146
+ });
147
+ },
148
+ score(output, options) {
149
+ const summary = output.summary;
150
+ const rawData = output.metadata?.rawData || {};
151
+ return {
152
+ toolName: import_core2.ToolName.DependencyHealth,
153
+ score: summary.score || 0,
154
+ rawMetrics: {
155
+ ...summary,
156
+ ...rawData
157
+ },
158
+ factors: [],
159
+ recommendations: (summary.recommendations || []).map(
160
+ (action) => ({
161
+ action,
162
+ estimatedImpact: 5,
163
+ priority: "medium"
164
+ })
165
+ )
166
+ };
167
+ },
168
+ defaultWeight: 6
169
+ };
170
+
171
+ // src/index.ts
172
+ import_core3.ToolRegistry.register(DepsProvider);
112
173
  // Annotate the CommonJS export names for ESM import in node:
113
174
  0 && (module.exports = {
175
+ DepsProvider,
114
176
  analyzeDeps
115
177
  });
package/dist/index.mjs CHANGED
@@ -1,6 +1,70 @@
1
1
  import {
2
2
  analyzeDeps
3
3
  } from "./chunk-4D7DCOHZ.mjs";
4
+
5
+ // src/index.ts
6
+ import { ToolRegistry } from "@aiready/core";
7
+
8
+ // src/provider.ts
9
+ import {
10
+ ToolName,
11
+ SpokeOutputSchema
12
+ } from "@aiready/core";
13
+ var DepsProvider = {
14
+ id: ToolName.DependencyHealth,
15
+ alias: ["deps", "deps-health", "packages"],
16
+ async analyze(options) {
17
+ const report = await analyzeDeps(options);
18
+ const fileIssuesMap = /* @__PURE__ */ new Map();
19
+ for (const issue of report.issues) {
20
+ const file = issue.location.file;
21
+ if (!fileIssuesMap.has(file)) fileIssuesMap.set(file, []);
22
+ fileIssuesMap.get(file).push(issue);
23
+ }
24
+ const results = Array.from(fileIssuesMap.entries()).map(
25
+ ([fileName, issues]) => ({
26
+ fileName,
27
+ issues,
28
+ metrics: {}
29
+ })
30
+ );
31
+ return SpokeOutputSchema.parse({
32
+ results,
33
+ summary: report.summary,
34
+ metadata: {
35
+ toolName: ToolName.DependencyHealth,
36
+ version: "0.9.5",
37
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
38
+ rawData: report.rawData
39
+ }
40
+ });
41
+ },
42
+ score(output, options) {
43
+ const summary = output.summary;
44
+ const rawData = output.metadata?.rawData || {};
45
+ return {
46
+ toolName: ToolName.DependencyHealth,
47
+ score: summary.score || 0,
48
+ rawMetrics: {
49
+ ...summary,
50
+ ...rawData
51
+ },
52
+ factors: [],
53
+ recommendations: (summary.recommendations || []).map(
54
+ (action) => ({
55
+ action,
56
+ estimatedImpact: 5,
57
+ priority: "medium"
58
+ })
59
+ )
60
+ };
61
+ },
62
+ defaultWeight: 6
63
+ };
64
+
65
+ // src/index.ts
66
+ ToolRegistry.register(DepsProvider);
4
67
  export {
68
+ DepsProvider,
5
69
  analyzeDeps
6
70
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/deps",
3
- "version": "0.9.3",
3
+ "version": "0.11.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.19.3"
12
+ "@aiready/core": "0.21.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^24.0.0",
@@ -20,9 +20,9 @@
20
20
  },
21
21
  "exports": {
22
22
  ".": {
23
+ "types": "./dist/index.d.ts",
23
24
  "import": "./dist/index.mjs",
24
- "require": "./dist/index.js",
25
- "types": "./dist/index.d.ts"
25
+ "require": "./dist/index.js"
26
26
  }
27
27
  },
28
28
  "scripts": {
package/src/index.ts CHANGED
@@ -1,2 +1,9 @@
1
+ import { ToolRegistry } from '@aiready/core';
2
+ import { DepsProvider } from './provider';
3
+
4
+ // Register with global registry
5
+ ToolRegistry.register(DepsProvider);
6
+
1
7
  export * from './types';
2
8
  export * from './analyzer';
9
+ export { DepsProvider };
@@ -0,0 +1,74 @@
1
+ import {
2
+ ToolProvider,
3
+ ToolName,
4
+ SpokeOutput,
5
+ ScanOptions,
6
+ ToolScoringOutput,
7
+ AnalysisResult,
8
+ SpokeOutputSchema,
9
+ } from '@aiready/core';
10
+ import { analyzeDeps } from './analyzer';
11
+ import { DepsOptions, DepsIssue } from './types';
12
+
13
+ /**
14
+ * Dependency Health Tool Provider
15
+ */
16
+ export const DepsProvider: ToolProvider = {
17
+ id: ToolName.DependencyHealth,
18
+ alias: ['deps', 'deps-health', 'packages'],
19
+
20
+ async analyze(options: ScanOptions): Promise<SpokeOutput> {
21
+ const report = await analyzeDeps(options as DepsOptions);
22
+
23
+ // Group issues by file for AnalysisResult format
24
+ const fileIssuesMap = new Map<string, DepsIssue[]>();
25
+ for (const issue of report.issues) {
26
+ const file = issue.location.file;
27
+ if (!fileIssuesMap.has(file)) fileIssuesMap.set(file, []);
28
+ fileIssuesMap.get(file)!.push(issue);
29
+ }
30
+
31
+ const results: AnalysisResult[] = Array.from(fileIssuesMap.entries()).map(
32
+ ([fileName, issues]) => ({
33
+ fileName,
34
+ issues: issues as any[],
35
+ metrics: {},
36
+ })
37
+ );
38
+
39
+ return SpokeOutputSchema.parse({
40
+ results,
41
+ summary: report.summary,
42
+ metadata: {
43
+ toolName: ToolName.DependencyHealth,
44
+ version: '0.9.5',
45
+ timestamp: new Date().toISOString(),
46
+ rawData: report.rawData,
47
+ },
48
+ });
49
+ },
50
+
51
+ score(output: SpokeOutput, options: ScanOptions): ToolScoringOutput {
52
+ const summary = output.summary as any;
53
+ const rawData = (output.metadata as any)?.rawData || {};
54
+
55
+ return {
56
+ toolName: ToolName.DependencyHealth,
57
+ score: summary.score || 0,
58
+ rawMetrics: {
59
+ ...summary,
60
+ ...rawData,
61
+ },
62
+ factors: [],
63
+ recommendations: (summary.recommendations || []).map(
64
+ (action: string) => ({
65
+ action,
66
+ estimatedImpact: 5,
67
+ priority: 'medium',
68
+ })
69
+ ),
70
+ };
71
+ },
72
+
73
+ defaultWeight: 6,
74
+ };