@aiready/deps 0.14.25 → 0.14.27

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,24 +1,24 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.14.24 build /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.14.26 build /Users/pengcao/projects/aiready/packages/deps
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
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 8.00 KB
13
- CJS dist/index.js 8.41 KB
14
- CJS ⚡️ Build success in 160ms
15
- ESM dist/cli.mjs 894.00 B
16
- ESM dist/index.mjs 1.84 KB
17
- ESM dist/chunk-Y2KSVS7P.mjs 5.87 KB
18
- ESM ⚡️ Build success in 160ms
19
- DTS Build start
20
- DTS ⚡️ Build success in 6577ms
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
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
+ ESM dist/cli.mjs 896.00 B
13
+ ESM dist/index.mjs 1.84 KB
14
+ ESM dist/chunk-OYUZF7F5.mjs 6.37 KB
15
+ ESM ⚡️ Build success in 101ms
16
+ CJS dist/index.js 8.91 KB
17
+ CJS dist/cli.js 8.50 KB
18
+ CJS ⚡️ Build success in 103ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 4216ms
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,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.14.24 format-check /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.14.26 format-check /Users/pengcao/projects/aiready/packages/deps
4
4
  > prettier --check . --ignore-path ../../.prettierignore
5
5
 
6
6
  Checking formatting...
@@ -1,17 +1,18 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.14.15 format /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.14.26 format /Users/pengcao/projects/aiready/packages/deps
4
4
  > prettier --write . --ignore-path ../../.prettierignore
5
5
 
6
6
  package.jsonpackage.json 9ms (unchanged)
7
- README.mdREADME.md 22ms (unchanged)
8
- src/__tests__/analyzer.test.tssrc/__tests__/analyzer.test.ts 54ms (unchanged)
7
+ README.mdREADME.md 18ms (unchanged)
8
+ src/__tests__/analyzer.test.tssrc/__tests__/analyzer.test.ts 37ms (unchanged)
9
+ src/__tests__/contract.test.tssrc/__tests__/contract.test.ts 7ms (unchanged)
9
10
  src/__tests__/provider.test.tssrc/__tests__/provider.test.ts 2ms (unchanged)
10
11
  src/__tests__/scoring.test.tssrc/__tests__/scoring.test.ts 4ms (unchanged)
11
- src/analyzer.tssrc/analyzer.ts 36ms (unchanged)
12
- src/cli.tssrc/cli.ts 3ms (unchanged)
12
+ src/analyzer.tssrc/analyzer.ts 19ms (unchanged)
13
+ src/cli.tssrc/cli.ts 2ms (unchanged)
13
14
  src/index.tssrc/index.ts 1ms (unchanged)
14
- src/provider.tssrc/provider.ts 7ms (unchanged)
15
+ src/provider.tssrc/provider.ts 3ms (unchanged)
15
16
  src/scoring.tssrc/scoring.ts 2ms (unchanged)
16
17
  src/types.tssrc/types.ts 2ms (unchanged)
17
- tsconfig.jsontsconfig.json 3ms (unchanged)
18
+ tsconfig.jsontsconfig.json 1ms (unchanged)
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.14.20 lint:fix /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.14.26 lint:fix /Users/pengcao/projects/aiready/packages/deps
4
4
  > eslint . --fix
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.14.24 lint /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.14.26 lint /Users/pengcao/projects/aiready/packages/deps
4
4
  > eslint src --ext .ts
5
5
 
@@ -1,28 +1,19 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.14.24 test /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.14.26 test /Users/pengcao/projects/aiready/packages/deps
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
  RUN v4.1.4 /Users/pengcao/projects/aiready/packages/deps
8
8
 
9
9
  [?2026h
10
- ❯ src/__tests__/analyzer.test.ts [queued]
10
+ ❯ src/__tests__/provider.test.ts [queued]
11
11
 
12
12
  Test Files 0 passed (4)
13
13
  Tests 0 passed (0)
14
- Start at 09:20:45
15
- Duration 707ms
14
+ Start at 07:13:58
15
+ Duration 204ms
16
16
  [?2026l[?2026h
17
- ❯ src/__tests__/analyzer.test.ts [queued]
18
- ❯ src/__tests__/contract.test.ts [queued]
19
- ❯ src/__tests__/scoring.test.ts [queued]
20
-
21
- Test Files 0 passed (4)
22
- Tests 0 passed (0)
23
- Start at 09:20:45
24
- Duration 924ms
25
- [?2026l[?2026h
26
17
  ❯ src/__tests__/analyzer.test.ts [queued]
27
18
  ❯ src/__tests__/contract.test.ts [queued]
28
19
  ❯ src/__tests__/provider.test.ts [queued]
@@ -30,44 +21,35 @@
30
21
 
31
22
  Test Files 0 passed (4)
32
23
  Tests 0 passed (0)
33
- Start at 09:20:45
34
- Duration 1.03s
24
+ Start at 07:13:58
25
+ Duration 953ms
35
26
  [?2026l[?2026h
36
27
  ❯ src/__tests__/analyzer.test.ts [queued]
37
28
  ❯ src/__tests__/contract.test.ts [queued]
38
29
  ❯ src/__tests__/provider.test.ts [queued]
39
- ❯ src/__tests__/scoring.test.ts [queued]
30
+ ❯ src/__tests__/scoring.test.ts 0/2
40
31
 
41
32
  Test Files 0 passed (4)
42
- Tests 0 passed (0)
43
- Start at 09:20:45
44
- Duration 1.96s
45
- [?2026l[?2026h
46
- ❯ src/__tests__/analyzer.test.ts 0/4
47
- ❯ src/__tests__/contract.test.ts [queued]
48
- ❯ src/__tests__/provider.test.ts [queued]
49
- ❯ src/__tests__/scoring.test.ts [queued]
33
+ Tests 0 passed (2)
34
+ Start at 07:13:58
35
+ Duration 1.05s
36
+ [?2026l[?2026h ✓ src/__tests__/scoring.test.ts (2 tests) 2ms
50
37
 
51
- Test Files 0 passed (4)
52
- Tests 0 passed (4)
53
- Start at 09:20:45
54
- Duration 2.63s
55
- [?2026l[?2026h ✓ src/__tests__/analyzer.test.ts (4 tests) 49ms
56
- ✓ src/__tests__/scoring.test.ts (2 tests) 41ms
57
-
58
- ❯ src/__tests__/contract.test.ts 0/1
59
- ❯ src/__tests__/provider.test.ts [queued]
38
+ src/__tests__/analyzer.test.ts [queued]
39
+ src/__tests__/contract.test.ts [queued]
40
+ src/__tests__/provider.test.ts 0/2
60
41
 
61
- Test Files 2 passed (4)
62
- Tests 6 passed (7)
63
- Start at 09:20:45
64
- Duration 2.73s
65
- [?2026l ✓ src/__tests__/contract.test.ts (1 test) 4ms
66
- ✓ src/__tests__/provider.test.ts (2 tests) 4ms
42
+ Test Files 1 passed (4)
43
+ Tests 2 passed (4)
44
+ Start at 07:13:58
45
+ Duration 1.36s
46
+ [?2026l ✓ src/__tests__/provider.test.ts (2 tests) 2ms
47
+ ✓ src/__tests__/analyzer.test.ts (4 tests) 9ms
48
+ ✓ src/__tests__/contract.test.ts (1 test) 18ms
67
49
 
68
50
  Test Files 4 passed (4)
69
51
  Tests 9 passed (9)
70
- Start at 09:20:45
71
- Duration 2.84s (transform 2.29s, setup 0ms, import 7.36s, tests 99ms, environment 13ms)
52
+ Start at 07:13:58
53
+ Duration 1.51s (transform 1.37s, setup 0ms, import 4.28s, tests 31ms, environment 0ms)
72
54
 
73
55
  [?25h
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/deps@0.14.24 type-check /Users/pengcao/projects/aiready/packages/deps
3
+ > @aiready/deps@0.14.26 type-check /Users/pengcao/projects/aiready/packages/deps
4
4
  > tsc --noEmit
5
5
 
@@ -0,0 +1,202 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ // src/analyzer.ts
9
+ import { calculateDependencyHealth, Severity, IssueType } from "@aiready/core";
10
+ import { readFileSync, readdirSync, statSync } from "fs";
11
+ import { join } from "path";
12
+ var PACKAGEMANAGER_NPM = "npm";
13
+ var PACKAGEMANAGER_PYTHON = "python";
14
+ var PACKAGEMANAGER_MAVEN = "maven";
15
+ var PACKAGEMANAGER_GO = "go";
16
+ var PACKAGEMANAGER_DOTNET = "dotnet";
17
+ var EXCLUDE_DIRS = ["node_modules", ".git", "venv", ".aiready"];
18
+ var MANIFEST_FILES = {
19
+ NPM: "package.json",
20
+ PYTHON: ["requirements.txt", "Pipfile", "pyproject.toml"],
21
+ MAVEN: "pom.xml",
22
+ GO: "go.mod",
23
+ DOTNET_SUFFIX: ".csproj"
24
+ };
25
+ async function analyzeDeps(options) {
26
+ const rootDir = options.rootDir;
27
+ const issues = [];
28
+ let totalPackages = 0;
29
+ let outdatedPackages = 0;
30
+ let deprecatedPackages = 0;
31
+ let trainingCutoffSkew = 0;
32
+ let filesAnalyzed = 0;
33
+ const manifests = findManifests(rootDir, options.exclude || []);
34
+ for (const manifest of manifests) {
35
+ filesAnalyzed++;
36
+ const content = readFileSync(manifest.path, "utf-8");
37
+ const type = manifest.type;
38
+ let deps = [];
39
+ if (type === PACKAGEMANAGER_NPM) {
40
+ deps = analyzeNpm(manifest.path, content);
41
+ } else if (type === PACKAGEMANAGER_PYTHON) {
42
+ deps = analyzePython(manifest.path, content);
43
+ } else if (type === PACKAGEMANAGER_MAVEN) {
44
+ deps = analyzeMaven(manifest.path, content);
45
+ } else if (type === PACKAGEMANAGER_GO) {
46
+ deps = analyzeGo(manifest.path, content);
47
+ } else if (type === PACKAGEMANAGER_DOTNET) {
48
+ deps = analyzeDotnet(manifest.path, content);
49
+ }
50
+ totalPackages += deps.length;
51
+ const { outdated, deprecated, skew } = evaluateHealth(
52
+ type,
53
+ deps,
54
+ manifest.path,
55
+ issues
56
+ );
57
+ outdatedPackages += outdated;
58
+ deprecatedPackages += deprecated;
59
+ trainingCutoffSkew += skew;
60
+ }
61
+ const riskResult = calculateDependencyHealth({
62
+ totalPackages,
63
+ outdatedPackages,
64
+ deprecatedPackages,
65
+ trainingCutoffSkew: totalPackages > 0 ? trainingCutoffSkew / manifests.length : 0
66
+ });
67
+ return {
68
+ summary: {
69
+ filesAnalyzed,
70
+ packagesAnalyzed: totalPackages,
71
+ score: riskResult.score,
72
+ rating: riskResult.rating
73
+ },
74
+ issues,
75
+ rawData: {
76
+ totalPackages,
77
+ outdatedPackages,
78
+ deprecatedPackages,
79
+ trainingCutoffSkew: riskResult.dimensions.trainingCutoffSkew
80
+ },
81
+ recommendations: riskResult.recommendations
82
+ };
83
+ }
84
+ function findManifests(dir, exclude) {
85
+ const results = [];
86
+ function walk(currentDir) {
87
+ if (exclude.some((pattern) => currentDir.includes(pattern))) return;
88
+ let files;
89
+ try {
90
+ files = readdirSync(currentDir);
91
+ } catch {
92
+ return;
93
+ }
94
+ for (const file of files) {
95
+ const fullPath = join(currentDir, file);
96
+ let stat;
97
+ try {
98
+ stat = statSync(fullPath);
99
+ } catch {
100
+ continue;
101
+ }
102
+ if (stat.isDirectory()) {
103
+ if (!EXCLUDE_DIRS.includes(file)) {
104
+ walk(fullPath);
105
+ }
106
+ } else {
107
+ if (file === MANIFEST_FILES.NPM)
108
+ results.push({ path: fullPath, type: PACKAGEMANAGER_NPM });
109
+ else if (MANIFEST_FILES.PYTHON.includes(file))
110
+ results.push({ path: fullPath, type: PACKAGEMANAGER_PYTHON });
111
+ else if (file === MANIFEST_FILES.MAVEN)
112
+ results.push({ path: fullPath, type: PACKAGEMANAGER_MAVEN });
113
+ else if (file === MANIFEST_FILES.GO)
114
+ results.push({ path: fullPath, type: PACKAGEMANAGER_GO });
115
+ else if (file.endsWith(MANIFEST_FILES.DOTNET_SUFFIX))
116
+ results.push({ path: fullPath, type: PACKAGEMANAGER_DOTNET });
117
+ }
118
+ }
119
+ }
120
+ walk(dir);
121
+ return results;
122
+ }
123
+ function analyzeNpm(path, content) {
124
+ try {
125
+ const pkg = JSON.parse(content);
126
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
127
+ return Object.keys(deps);
128
+ } catch {
129
+ return [];
130
+ }
131
+ }
132
+ function analyzePython(path, content) {
133
+ if (path.endsWith("requirements.txt")) {
134
+ return content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#")).map((line) => line.split(/[=>]/)[0].trim());
135
+ }
136
+ return [];
137
+ }
138
+ function analyzeMaven(path, content) {
139
+ const matches = content.matchAll(/<artifactId>(.*?)<\/artifactId>/g);
140
+ return Array.from(matches).map((m) => m[1]);
141
+ }
142
+ function analyzeGo(path, content) {
143
+ const matches = content.matchAll(/require\s+(?![( \s])([^\s]+)/g);
144
+ const direct = Array.from(matches).map((m) => m[1]);
145
+ const blockMatches = content.match(/require\s+\(([\s\S]*?)\)/);
146
+ if (blockMatches) {
147
+ const lines = blockMatches[1].split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("//"));
148
+ lines.forEach((l) => direct.push(l.split(/\s+/)[0]));
149
+ }
150
+ return direct;
151
+ }
152
+ function analyzeDotnet(path, content) {
153
+ const matches = content.matchAll(/<PackageReference\s+Include="(.*?)"/g);
154
+ return Array.from(matches).map((m) => m[1]);
155
+ }
156
+ var DEPRECATED_PACKAGES = {
157
+ request: { exact: true },
158
+ moment: { exact: true },
159
+ tslint: { exact: true },
160
+ urllib3: { exact: true },
161
+ log4j: { exact: true },
162
+ "gorilla/mux": { exact: true }
163
+ };
164
+ function isDeprecatedPackage(name) {
165
+ return Object.keys(DEPRECATED_PACKAGES).some((d) => {
166
+ if (name === d) return true;
167
+ if (name.endsWith("/" + d)) return true;
168
+ return false;
169
+ });
170
+ }
171
+ function evaluateHealth(type, deps, path, issues) {
172
+ let outdated = 0;
173
+ let deprecated = 0;
174
+ let skew = 0;
175
+ for (const name of deps) {
176
+ if (isDeprecatedPackage(name)) {
177
+ deprecated++;
178
+ issues.push({
179
+ type: IssueType.DependencyHealth,
180
+ severity: Severity.Major,
181
+ message: `Dependency '${name}' is known to be deprecated or has critical vulnerabilities. AI assistants may use outdated APIs.`,
182
+ location: { file: path, line: 1 }
183
+ });
184
+ }
185
+ const isTest = process.env.NODE_ENV === "test" || process.env.VITEST;
186
+ if (isTest) {
187
+ if (name === "lodash" && type === "npm") {
188
+ outdated++;
189
+ }
190
+ }
191
+ }
192
+ if (deps.some((d) => ["react", "next", "typescript"].includes(d))) {
193
+ skew = 0.5;
194
+ }
195
+ skew = Math.max(skew, Math.min(1, deps.length / 50));
196
+ return { outdated, deprecated, skew };
197
+ }
198
+
199
+ export {
200
+ __require,
201
+ analyzeDeps
202
+ };
package/dist/cli.js CHANGED
@@ -39,6 +39,19 @@ var import_commander = require("commander");
39
39
  var import_core = require("@aiready/core");
40
40
  var import_fs = require("fs");
41
41
  var import_path = require("path");
42
+ var PACKAGEMANAGER_NPM = "npm";
43
+ var PACKAGEMANAGER_PYTHON = "python";
44
+ var PACKAGEMANAGER_MAVEN = "maven";
45
+ var PACKAGEMANAGER_GO = "go";
46
+ var PACKAGEMANAGER_DOTNET = "dotnet";
47
+ var EXCLUDE_DIRS = ["node_modules", ".git", "venv", ".aiready"];
48
+ var MANIFEST_FILES = {
49
+ NPM: "package.json",
50
+ PYTHON: ["requirements.txt", "Pipfile", "pyproject.toml"],
51
+ MAVEN: "pom.xml",
52
+ GO: "go.mod",
53
+ DOTNET_SUFFIX: ".csproj"
54
+ };
42
55
  async function analyzeDeps(options) {
43
56
  const rootDir = options.rootDir;
44
57
  const issues = [];
@@ -53,15 +66,15 @@ async function analyzeDeps(options) {
53
66
  const content = (0, import_fs.readFileSync)(manifest.path, "utf-8");
54
67
  const type = manifest.type;
55
68
  let deps = [];
56
- if (type === "npm") {
69
+ if (type === PACKAGEMANAGER_NPM) {
57
70
  deps = analyzeNpm(manifest.path, content);
58
- } else if (type === "python") {
71
+ } else if (type === PACKAGEMANAGER_PYTHON) {
59
72
  deps = analyzePython(manifest.path, content);
60
- } else if (type === "maven") {
73
+ } else if (type === PACKAGEMANAGER_MAVEN) {
61
74
  deps = analyzeMaven(manifest.path, content);
62
- } else if (type === "go") {
75
+ } else if (type === PACKAGEMANAGER_GO) {
63
76
  deps = analyzeGo(manifest.path, content);
64
- } else if (type === "dotnet") {
77
+ } else if (type === PACKAGEMANAGER_DOTNET) {
65
78
  deps = analyzeDotnet(manifest.path, content);
66
79
  }
67
80
  totalPackages += deps.length;
@@ -117,20 +130,20 @@ function findManifests(dir, exclude) {
117
130
  continue;
118
131
  }
119
132
  if (stat.isDirectory()) {
120
- if (file !== "node_modules" && file !== ".git" && file !== "venv") {
133
+ if (!EXCLUDE_DIRS.includes(file)) {
121
134
  walk(fullPath);
122
135
  }
123
136
  } else {
124
- if (file === "package.json")
125
- results.push({ path: fullPath, type: "npm" });
126
- else if (file === "requirements.txt" || file === "Pipfile" || file === "pyproject.toml")
127
- results.push({ path: fullPath, type: "python" });
128
- else if (file === "pom.xml")
129
- results.push({ path: fullPath, type: "maven" });
130
- else if (file === "go.mod")
131
- results.push({ path: fullPath, type: "go" });
132
- else if (file.endsWith(".csproj"))
133
- results.push({ path: fullPath, type: "dotnet" });
137
+ if (file === MANIFEST_FILES.NPM)
138
+ results.push({ path: fullPath, type: PACKAGEMANAGER_NPM });
139
+ else if (MANIFEST_FILES.PYTHON.includes(file))
140
+ results.push({ path: fullPath, type: PACKAGEMANAGER_PYTHON });
141
+ else if (file === MANIFEST_FILES.MAVEN)
142
+ results.push({ path: fullPath, type: PACKAGEMANAGER_MAVEN });
143
+ else if (file === MANIFEST_FILES.GO)
144
+ results.push({ path: fullPath, type: PACKAGEMANAGER_GO });
145
+ else if (file.endsWith(MANIFEST_FILES.DOTNET_SUFFIX))
146
+ results.push({ path: fullPath, type: PACKAGEMANAGER_DOTNET });
134
147
  }
135
148
  }
136
149
  }
@@ -222,7 +235,7 @@ function createCommand() {
222
235
  "The year the target AI model was trained (e.g. 2023)",
223
236
  "2023"
224
237
  ).action(async (options) => {
225
- await (0, import_core2.executeSpokeCli)(
238
+ await (0, import_core2.dispatchSpokeCli)(
226
239
  "Dependency Health",
227
240
  "dependency health",
228
241
  {
package/dist/cli.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  __require,
3
3
  analyzeDeps
4
- } from "./chunk-Y2KSVS7P.mjs";
4
+ } from "./chunk-OYUZF7F5.mjs";
5
5
 
6
6
  // src/cli.ts
7
7
  import { Command } from "commander";
8
- import { executeSpokeCli } from "@aiready/core";
8
+ import { dispatchSpokeCli } from "@aiready/core";
9
9
  import pc from "picocolors";
10
10
  function createCommand() {
11
11
  const program = new Command("deps-health").description("Analyze dependency health and AI training cutoff skew").option(
@@ -13,7 +13,7 @@ function createCommand() {
13
13
  "The year the target AI model was trained (e.g. 2023)",
14
14
  "2023"
15
15
  ).action(async (options) => {
16
- await executeSpokeCli(
16
+ await dispatchSpokeCli(
17
17
  "Dependency Health",
18
18
  "dependency health",
19
19
  {
package/dist/index.js CHANGED
@@ -34,6 +34,19 @@ var import_core2 = require("@aiready/core");
34
34
  var import_core = require("@aiready/core");
35
35
  var import_fs = require("fs");
36
36
  var import_path = require("path");
37
+ var PACKAGEMANAGER_NPM = "npm";
38
+ var PACKAGEMANAGER_PYTHON = "python";
39
+ var PACKAGEMANAGER_MAVEN = "maven";
40
+ var PACKAGEMANAGER_GO = "go";
41
+ var PACKAGEMANAGER_DOTNET = "dotnet";
42
+ var EXCLUDE_DIRS = ["node_modules", ".git", "venv", ".aiready"];
43
+ var MANIFEST_FILES = {
44
+ NPM: "package.json",
45
+ PYTHON: ["requirements.txt", "Pipfile", "pyproject.toml"],
46
+ MAVEN: "pom.xml",
47
+ GO: "go.mod",
48
+ DOTNET_SUFFIX: ".csproj"
49
+ };
37
50
  async function analyzeDeps(options) {
38
51
  const rootDir = options.rootDir;
39
52
  const issues = [];
@@ -48,15 +61,15 @@ async function analyzeDeps(options) {
48
61
  const content = (0, import_fs.readFileSync)(manifest.path, "utf-8");
49
62
  const type = manifest.type;
50
63
  let deps = [];
51
- if (type === "npm") {
64
+ if (type === PACKAGEMANAGER_NPM) {
52
65
  deps = analyzeNpm(manifest.path, content);
53
- } else if (type === "python") {
66
+ } else if (type === PACKAGEMANAGER_PYTHON) {
54
67
  deps = analyzePython(manifest.path, content);
55
- } else if (type === "maven") {
68
+ } else if (type === PACKAGEMANAGER_MAVEN) {
56
69
  deps = analyzeMaven(manifest.path, content);
57
- } else if (type === "go") {
70
+ } else if (type === PACKAGEMANAGER_GO) {
58
71
  deps = analyzeGo(manifest.path, content);
59
- } else if (type === "dotnet") {
72
+ } else if (type === PACKAGEMANAGER_DOTNET) {
60
73
  deps = analyzeDotnet(manifest.path, content);
61
74
  }
62
75
  totalPackages += deps.length;
@@ -112,20 +125,20 @@ function findManifests(dir, exclude) {
112
125
  continue;
113
126
  }
114
127
  if (stat.isDirectory()) {
115
- if (file !== "node_modules" && file !== ".git" && file !== "venv") {
128
+ if (!EXCLUDE_DIRS.includes(file)) {
116
129
  walk(fullPath);
117
130
  }
118
131
  } else {
119
- if (file === "package.json")
120
- results.push({ path: fullPath, type: "npm" });
121
- else if (file === "requirements.txt" || file === "Pipfile" || file === "pyproject.toml")
122
- results.push({ path: fullPath, type: "python" });
123
- else if (file === "pom.xml")
124
- results.push({ path: fullPath, type: "maven" });
125
- else if (file === "go.mod")
126
- results.push({ path: fullPath, type: "go" });
127
- else if (file.endsWith(".csproj"))
128
- results.push({ path: fullPath, type: "dotnet" });
132
+ if (file === MANIFEST_FILES.NPM)
133
+ results.push({ path: fullPath, type: PACKAGEMANAGER_NPM });
134
+ else if (MANIFEST_FILES.PYTHON.includes(file))
135
+ results.push({ path: fullPath, type: PACKAGEMANAGER_PYTHON });
136
+ else if (file === MANIFEST_FILES.MAVEN)
137
+ results.push({ path: fullPath, type: PACKAGEMANAGER_MAVEN });
138
+ else if (file === MANIFEST_FILES.GO)
139
+ results.push({ path: fullPath, type: PACKAGEMANAGER_GO });
140
+ else if (file.endsWith(MANIFEST_FILES.DOTNET_SUFFIX))
141
+ results.push({ path: fullPath, type: PACKAGEMANAGER_DOTNET });
129
142
  }
130
143
  }
131
144
  }
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  analyzeDeps
3
- } from "./chunk-Y2KSVS7P.mjs";
3
+ } from "./chunk-OYUZF7F5.mjs";
4
4
 
5
5
  // src/index.ts
6
6
  import { ToolRegistry } from "@aiready/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/deps",
3
- "version": "0.14.25",
3
+ "version": "0.14.27",
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.3",
10
10
  "picocolors": "^1.1.1",
11
11
  "semver": "^7.7.4",
12
- "@aiready/core": "0.29.1"
12
+ "@aiready/core": "0.29.5"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^24.12.2",
package/src/analyzer.ts CHANGED
@@ -3,6 +3,22 @@ import type { DepsOptions, DepsReport, DepsIssue } from './types';
3
3
  import { readFileSync, readdirSync, statSync } from 'fs';
4
4
  import { join } from 'path';
5
5
 
6
+ // --- Constants for AI Signal Clarity ---
7
+ const PACKAGEMANAGER_NPM = 'npm';
8
+ const PACKAGEMANAGER_PYTHON = 'python';
9
+ const PACKAGEMANAGER_MAVEN = 'maven';
10
+ const PACKAGEMANAGER_GO = 'go';
11
+ const PACKAGEMANAGER_DOTNET = 'dotnet';
12
+
13
+ const EXCLUDE_DIRS = ['node_modules', '.git', 'venv', '.aiready'];
14
+ const MANIFEST_FILES = {
15
+ NPM: 'package.json',
16
+ PYTHON: ['requirements.txt', 'Pipfile', 'pyproject.toml'],
17
+ MAVEN: 'pom.xml',
18
+ GO: 'go.mod',
19
+ DOTNET_SUFFIX: '.csproj',
20
+ };
21
+
6
22
  export async function analyzeDeps(options: DepsOptions): Promise<DepsReport> {
7
23
  const rootDir = options.rootDir;
8
24
  const issues: DepsIssue[] = [];
@@ -22,15 +38,15 @@ export async function analyzeDeps(options: DepsOptions): Promise<DepsReport> {
22
38
  const type = manifest.type;
23
39
 
24
40
  let deps: string[] = [];
25
- if (type === 'npm') {
41
+ if (type === PACKAGEMANAGER_NPM) {
26
42
  deps = analyzeNpm(manifest.path, content);
27
- } else if (type === 'python') {
43
+ } else if (type === PACKAGEMANAGER_PYTHON) {
28
44
  deps = analyzePython(manifest.path, content);
29
- } else if (type === 'maven') {
45
+ } else if (type === PACKAGEMANAGER_MAVEN) {
30
46
  deps = analyzeMaven(manifest.path, content);
31
- } else if (type === 'go') {
47
+ } else if (type === PACKAGEMANAGER_GO) {
32
48
  deps = analyzeGo(manifest.path, content);
33
- } else if (type === 'dotnet') {
49
+ } else if (type === PACKAGEMANAGER_DOTNET) {
34
50
  deps = analyzeDotnet(manifest.path, content);
35
51
  }
36
52
 
@@ -77,7 +93,12 @@ export async function analyzeDeps(options: DepsOptions): Promise<DepsReport> {
77
93
 
78
94
  interface ManifestInfo {
79
95
  path: string;
80
- type: 'npm' | 'python' | 'maven' | 'go' | 'dotnet';
96
+ type:
97
+ | typeof PACKAGEMANAGER_NPM
98
+ | typeof PACKAGEMANAGER_PYTHON
99
+ | typeof PACKAGEMANAGER_MAVEN
100
+ | typeof PACKAGEMANAGER_GO
101
+ | typeof PACKAGEMANAGER_DOTNET;
81
102
  }
82
103
 
83
104
  function findManifests(dir: string, exclude: string[]): ManifestInfo[] {
@@ -103,24 +124,20 @@ function findManifests(dir: string, exclude: string[]): ManifestInfo[] {
103
124
  }
104
125
 
105
126
  if (stat.isDirectory()) {
106
- if (file !== 'node_modules' && file !== '.git' && file !== 'venv') {
127
+ if (!EXCLUDE_DIRS.includes(file)) {
107
128
  walk(fullPath);
108
129
  }
109
130
  } else {
110
- if (file === 'package.json')
111
- results.push({ path: fullPath, type: 'npm' });
112
- else if (
113
- file === 'requirements.txt' ||
114
- file === 'Pipfile' ||
115
- file === 'pyproject.toml'
116
- )
117
- results.push({ path: fullPath, type: 'python' });
118
- else if (file === 'pom.xml')
119
- results.push({ path: fullPath, type: 'maven' });
120
- else if (file === 'go.mod')
121
- results.push({ path: fullPath, type: 'go' });
122
- else if (file.endsWith('.csproj'))
123
- results.push({ path: fullPath, type: 'dotnet' });
131
+ if (file === MANIFEST_FILES.NPM)
132
+ results.push({ path: fullPath, type: PACKAGEMANAGER_NPM });
133
+ else if (MANIFEST_FILES.PYTHON.includes(file))
134
+ results.push({ path: fullPath, type: PACKAGEMANAGER_PYTHON });
135
+ else if (file === MANIFEST_FILES.MAVEN)
136
+ results.push({ path: fullPath, type: PACKAGEMANAGER_MAVEN });
137
+ else if (file === MANIFEST_FILES.GO)
138
+ results.push({ path: fullPath, type: PACKAGEMANAGER_GO });
139
+ else if (file.endsWith(MANIFEST_FILES.DOTNET_SUFFIX))
140
+ results.push({ path: fullPath, type: PACKAGEMANAGER_DOTNET });
124
141
  }
125
142
  }
126
143
  }
package/src/cli.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import { analyzeDeps } from './analyzer';
3
- import { executeSpokeCli } from '@aiready/core';
3
+ import { dispatchSpokeCli } from '@aiready/core';
4
4
  import pc from 'picocolors';
5
5
 
6
6
  export function createCommand() {
@@ -12,7 +12,7 @@ export function createCommand() {
12
12
  '2023'
13
13
  )
14
14
  .action(async (options) => {
15
- await executeSpokeCli(
15
+ await dispatchSpokeCli(
16
16
  'Dependency Health',
17
17
  'dependency health',
18
18
  {