@aiready/cli 0.3.2 → 0.3.3

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/cli@0.3.2 build /Users/pengcao/projects/aiready/packages/cli
3
+ > @aiready/cli@0.3.3 build /Users/pengcao/projects/aiready/packages/cli
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,15 +9,15 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/chunk-S6JWNLN7.mjs 1.40 KB
12
+ CJS dist/index.js 2.57 KB
13
+ CJS dist/cli.js 11.02 KB
14
+ CJS ⚡️ Build success in 56ms
15
+ ESM dist/chunk-KZKXZKES.mjs 1.45 KB
16
+ ESM dist/cli.mjs 8.12 KB
13
17
  ESM dist/index.mjs 138.00 B
14
- ESM dist/cli.mjs 8.11 KB
15
- ESM ⚡️ Build success in 18ms
16
- CJS dist/index.js 2.51 KB
17
- CJS dist/cli.js 10.97 KB
18
- CJS ⚡️ Build success in 18ms
18
+ ESM ⚡️ Build success in 56ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 492ms
20
+ DTS ⚡️ Build success in 513ms
21
21
  DTS dist/cli.d.ts 20.00 B
22
22
  DTS dist/index.d.ts 731.00 B
23
23
  DTS dist/cli.d.mts 20.00 B
@@ -0,0 +1,54 @@
1
+ // src/index.ts
2
+ import { analyzePatterns } from "@aiready/pattern-detect";
3
+ import { analyzeContext } from "@aiready/context-analyzer";
4
+ async function analyzeUnified(options) {
5
+ const startTime = Date.now();
6
+ const tools = options.tools || ["patterns", "context"];
7
+ const result = {
8
+ summary: {
9
+ totalIssues: 0,
10
+ toolsRun: tools,
11
+ executionTime: 0
12
+ }
13
+ };
14
+ if (tools.includes("patterns")) {
15
+ const patternResult = await analyzePatterns(options);
16
+ result.patterns = patternResult.results;
17
+ result.summary.totalIssues += patternResult.results.length;
18
+ }
19
+ if (tools.includes("context")) {
20
+ result.context = await analyzeContext(options);
21
+ result.summary.totalIssues += result.context?.length || 0;
22
+ }
23
+ result.summary.executionTime = Date.now() - startTime;
24
+ return result;
25
+ }
26
+ function generateUnifiedSummary(result) {
27
+ const { summary } = result;
28
+ let output = `\u{1F680} AIReady Analysis Complete
29
+
30
+ `;
31
+ output += `\u{1F4CA} Summary:
32
+ `;
33
+ output += ` Tools run: ${summary.toolsRun.join(", ")}
34
+ `;
35
+ output += ` Total issues found: ${summary.totalIssues}
36
+ `;
37
+ output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
38
+
39
+ `;
40
+ if (result.patterns?.length) {
41
+ output += `\u{1F50D} Pattern Analysis: ${result.patterns.length} issues
42
+ `;
43
+ }
44
+ if (result.context?.length) {
45
+ output += `\u{1F9E0} Context Analysis: ${result.context.length} issues
46
+ `;
47
+ }
48
+ return output;
49
+ }
50
+
51
+ export {
52
+ analyzeUnified,
53
+ generateUnifiedSummary
54
+ };
package/dist/cli.js CHANGED
@@ -40,8 +40,9 @@ async function analyzeUnified(options) {
40
40
  }
41
41
  };
42
42
  if (tools.includes("patterns")) {
43
- result.patterns = await (0, import_pattern_detect.analyzePatterns)(options);
44
- result.summary.totalIssues += result.patterns.length;
43
+ const patternResult = await (0, import_pattern_detect.analyzePatterns)(options);
44
+ result.patterns = patternResult.results;
45
+ result.summary.totalIssues += patternResult.results.length;
45
46
  }
46
47
  if (tools.includes("context")) {
47
48
  result.context = await (0, import_context_analyzer.analyzeContext)(options);
@@ -155,7 +156,7 @@ program.command("patterns").description("Run pattern detection analysis").argume
155
156
  exclude: options.exclude?.split(",") || mergedConfig.exclude
156
157
  };
157
158
  const { analyzePatterns: analyzePatterns2, generateSummary } = await import("@aiready/pattern-detect");
158
- const results = await analyzePatterns2(finalOptions);
159
+ const { results } = await analyzePatterns2(finalOptions);
159
160
  const elapsedTime = ((Date.now() - startTime) / 1e3).toFixed(2);
160
161
  const summary = generateSummary(results);
161
162
  const outputFormat = options.output || mergedConfig.output?.format || "console";
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  analyzeUnified,
4
4
  generateUnifiedSummary
5
- } from "./chunk-S6JWNLN7.mjs";
5
+ } from "./chunk-KZKXZKES.mjs";
6
6
 
7
7
  // src/cli.ts
8
8
  import { Command } from "commander";
@@ -85,7 +85,7 @@ program.command("patterns").description("Run pattern detection analysis").argume
85
85
  exclude: options.exclude?.split(",") || mergedConfig.exclude
86
86
  };
87
87
  const { analyzePatterns, generateSummary } = await import("@aiready/pattern-detect");
88
- const results = await analyzePatterns(finalOptions);
88
+ const { results } = await analyzePatterns(finalOptions);
89
89
  const elapsedTime = ((Date.now() - startTime) / 1e3).toFixed(2);
90
90
  const summary = generateSummary(results);
91
91
  const outputFormat = options.output || mergedConfig.output?.format || "console";
package/dist/index.js CHANGED
@@ -37,8 +37,9 @@ async function analyzeUnified(options) {
37
37
  }
38
38
  };
39
39
  if (tools.includes("patterns")) {
40
- result.patterns = await (0, import_pattern_detect.analyzePatterns)(options);
41
- result.summary.totalIssues += result.patterns.length;
40
+ const patternResult = await (0, import_pattern_detect.analyzePatterns)(options);
41
+ result.patterns = patternResult.results;
42
+ result.summary.totalIssues += patternResult.results.length;
42
43
  }
43
44
  if (tools.includes("context")) {
44
45
  result.context = await (0, import_context_analyzer.analyzeContext)(options);
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  analyzeUnified,
3
3
  generateUnifiedSummary
4
- } from "./chunk-S6JWNLN7.mjs";
4
+ } from "./chunk-KZKXZKES.mjs";
5
5
  export {
6
6
  analyzeUnified,
7
7
  generateUnifiedSummary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/cli",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Unified CLI for AIReady analysis tools",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -11,9 +11,9 @@
11
11
  "dependencies": {
12
12
  "commander": "^12.1.0",
13
13
  "chalk": "^5.3.0",
14
- "@aiready/core": "0.3.0",
15
- "@aiready/pattern-detect": "0.7.0",
16
- "@aiready/context-analyzer": "0.3.0"
14
+ "@aiready/pattern-detect": "0.7.5",
15
+ "@aiready/core": "0.3.1",
16
+ "@aiready/context-analyzer": "0.3.3"
17
17
  },
18
18
  "devDependencies": {
19
19
  "tsup": "^8.3.5",
package/src/cli.ts CHANGED
@@ -136,7 +136,7 @@ program
136
136
 
137
137
  const { analyzePatterns, generateSummary } = await import('@aiready/pattern-detect');
138
138
 
139
- const results = await analyzePatterns(finalOptions);
139
+ const { results } = await analyzePatterns(finalOptions);
140
140
 
141
141
  const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
142
142
  const summary = generateSummary(results);
package/src/index.ts CHANGED
@@ -32,8 +32,9 @@ export async function analyzeUnified(
32
32
 
33
33
  // Run pattern detection
34
34
  if (tools.includes('patterns')) {
35
- result.patterns = await analyzePatterns(options);
36
- result.summary.totalIssues += result.patterns.length;
35
+ const patternResult = await analyzePatterns(options);
36
+ result.patterns = patternResult.results;
37
+ result.summary.totalIssues += patternResult.results.length;
37
38
  }
38
39
 
39
40
  // Run context analysis