@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.
- package/.turbo/turbo-build.log +8 -50
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +3 -3
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +62 -0
- package/dist/index.mjs +64 -0
- package/package.json +4 -4
- package/src/index.ts +7 -0
- package/src/provider.ts +74 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/deps@0.
|
|
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
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,58 +9,16 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
|
|
13
|
-
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json] [90m7:57:09 pm[39m
|
|
14
|
-
|
|
15
|
-
package.json:32:6:
|
|
16
|
-
[37m 32 │ [32m"types"[37m: "./dist/index.d.ts"
|
|
17
|
-
╵ [32m~~~~~~~[0m
|
|
18
|
-
|
|
19
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
20
|
-
|
|
21
|
-
package.json:30:6:
|
|
22
|
-
[37m 30 │ [32m"import"[37m: "./dist/index.mjs",
|
|
23
|
-
╵ [32m~~~~~~~~[0m
|
|
24
|
-
|
|
25
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
26
|
-
|
|
27
|
-
package.json:31:6:
|
|
28
|
-
[37m 31 │ [32m"require"[37m: "./dist/index.js",
|
|
29
|
-
╵ [32m~~~~~~~~~[0m
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json] [90m7:57:09 pm[39m
|
|
35
|
-
|
|
36
|
-
package.json:32:6:
|
|
37
|
-
[37m 32 │ [32m"types"[37m: "./dist/index.d.ts"
|
|
38
|
-
╵ [32m~~~~~~~[0m
|
|
39
|
-
|
|
40
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
41
|
-
|
|
42
|
-
package.json:30:6:
|
|
43
|
-
[37m 30 │ [32m"import"[37m: "./dist/index.mjs",
|
|
44
|
-
╵ [32m~~~~~~~~[0m
|
|
45
|
-
|
|
46
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
47
|
-
|
|
48
|
-
package.json:31:6:
|
|
49
|
-
[37m 31 │ [32m"require"[37m: "./dist/index.js",
|
|
50
|
-
╵ [32m~~~~~~~~~[0m
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m5.53 KB[39m
|
|
54
13
|
[32mCJS[39m [1mdist/cli.js [22m[32m5.87 KB[39m
|
|
55
|
-
[32mCJS[39m
|
|
56
|
-
[32mCJS[39m ⚡️ Build success in 147ms
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 145ms
|
|
57
15
|
[32mESM[39m [1mdist/cli.mjs [22m[32m1.33 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m1.64 KB[39m
|
|
58
17
|
[32mESM[39m [1mdist/chunk-4D7DCOHZ.mjs [22m[32m3.18 KB[39m
|
|
59
|
-
[32mESM[39m
|
|
60
|
-
[32mESM[39m ⚡️ Build success in 147ms
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 145ms
|
|
61
19
|
DTS Build start
|
|
62
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 2509ms
|
|
63
21
|
DTS dist/cli.d.ts 108.00 B
|
|
64
|
-
DTS dist/index.d.ts
|
|
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
|
|
24
|
+
DTS dist/index.d.mts 971.00 B
|
package/.turbo/turbo-lint.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/deps@0.
|
|
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
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
12
|
[2m Tests [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
13
|
-
[2m Start at [22m
|
|
14
|
-
[2m Duration [22m
|
|
13
|
+
[2m Start at [22m 09:33:04
|
|
14
|
+
[2m Duration [22m 738ms[2m (transform 123ms, setup 0ms, import 433ms, tests 3ms, environment 0ms)[22m
|
|
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.
|
|
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.
|
|
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
package/src/provider.ts
ADDED
|
@@ -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
|
+
};
|