@aiready/cli 0.3.1 → 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.
- package/.turbo/turbo-build.log +8 -8
- package/dist/chunk-KZKXZKES.mjs +54 -0
- package/dist/cli.js +8 -4
- package/dist/cli.mjs +6 -3
- package/dist/index.js +3 -2
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/src/cli.ts +5 -2
- package/src/index.ts +3 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.3.
|
|
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
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[32m2.
|
|
13
|
-
[32mCJS[39m [1mdist/cli.js [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m2.57 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m11.02 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 56ms
|
|
15
|
+
[32mESM[39m [1mdist/chunk-KZKXZKES.mjs [22m[32m1.45 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m8.12 KB[39m
|
|
16
17
|
[32mESM[39m [1mdist/index.mjs [22m[32m138.00 B[39m
|
|
17
|
-
[32mESM[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in 78ms
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 56ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
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
|
-
|
|
44
|
-
result.
|
|
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);
|
|
@@ -78,9 +79,12 @@ function generateUnifiedSummary(result) {
|
|
|
78
79
|
// src/cli.ts
|
|
79
80
|
var import_chalk = __toESM(require("chalk"));
|
|
80
81
|
var import_fs = require("fs");
|
|
82
|
+
var import_path = require("path");
|
|
81
83
|
var import_core = require("@aiready/core");
|
|
84
|
+
var import_fs2 = require("fs");
|
|
85
|
+
var packageJson = JSON.parse((0, import_fs2.readFileSync)((0, import_path.join)(__dirname, "../package.json"), "utf8"));
|
|
82
86
|
var program = new import_commander.Command();
|
|
83
|
-
program.name("aiready").description("AIReady - Unified AI-readiness analysis tools").version(
|
|
87
|
+
program.name("aiready").description("AIReady - Unified AI-readiness analysis tools").version(packageJson.version).addHelpText("after", "\nCONFIGURATION:\n Supports config files: aiready.json, aiready.config.json, .aiready.json, .aireadyrc.json, aiready.config.js, .aireadyrc.js\n CLI options override config file settings");
|
|
84
88
|
program.command("scan").description("Run unified analysis on a codebase").argument("<directory>", "Directory to analyze").option("-t, --tools <tools>", "Tools to run (comma-separated: patterns,context)", "patterns,context").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").action(async (directory, options) => {
|
|
85
89
|
console.log(import_chalk.default.blue("\u{1F680} Starting AIReady unified analysis...\n"));
|
|
86
90
|
const startTime = Date.now();
|
|
@@ -152,7 +156,7 @@ program.command("patterns").description("Run pattern detection analysis").argume
|
|
|
152
156
|
exclude: options.exclude?.split(",") || mergedConfig.exclude
|
|
153
157
|
};
|
|
154
158
|
const { analyzePatterns: analyzePatterns2, generateSummary } = await import("@aiready/pattern-detect");
|
|
155
|
-
const results = await analyzePatterns2(finalOptions);
|
|
159
|
+
const { results } = await analyzePatterns2(finalOptions);
|
|
156
160
|
const elapsedTime = ((Date.now() - startTime) / 1e3).toFixed(2);
|
|
157
161
|
const summary = generateSummary(results);
|
|
158
162
|
const outputFormat = options.output || mergedConfig.output?.format || "console";
|
package/dist/cli.mjs
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
analyzeUnified,
|
|
4
4
|
generateUnifiedSummary
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KZKXZKES.mjs";
|
|
6
6
|
|
|
7
7
|
// src/cli.ts
|
|
8
8
|
import { Command } from "commander";
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
import { writeFileSync } from "fs";
|
|
11
|
+
import { join } from "path";
|
|
11
12
|
import { loadConfig, mergeConfigWithDefaults } from "@aiready/core";
|
|
13
|
+
import { readFileSync } from "fs";
|
|
14
|
+
var packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf8"));
|
|
12
15
|
var program = new Command();
|
|
13
|
-
program.name("aiready").description("AIReady - Unified AI-readiness analysis tools").version(
|
|
16
|
+
program.name("aiready").description("AIReady - Unified AI-readiness analysis tools").version(packageJson.version).addHelpText("after", "\nCONFIGURATION:\n Supports config files: aiready.json, aiready.config.json, .aiready.json, .aireadyrc.json, aiready.config.js, .aireadyrc.js\n CLI options override config file settings");
|
|
14
17
|
program.command("scan").description("Run unified analysis on a codebase").argument("<directory>", "Directory to analyze").option("-t, --tools <tools>", "Tools to run (comma-separated: patterns,context)", "patterns,context").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").action(async (directory, options) => {
|
|
15
18
|
console.log(chalk.blue("\u{1F680} Starting AIReady unified analysis...\n"));
|
|
16
19
|
const startTime = Date.now();
|
|
@@ -82,7 +85,7 @@ program.command("patterns").description("Run pattern detection analysis").argume
|
|
|
82
85
|
exclude: options.exclude?.split(",") || mergedConfig.exclude
|
|
83
86
|
};
|
|
84
87
|
const { analyzePatterns, generateSummary } = await import("@aiready/pattern-detect");
|
|
85
|
-
const results = await analyzePatterns(finalOptions);
|
|
88
|
+
const { results } = await analyzePatterns(finalOptions);
|
|
86
89
|
const elapsedTime = ((Date.now() - startTime) / 1e3).toFixed(2);
|
|
87
90
|
const summary = generateSummary(results);
|
|
88
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
|
-
|
|
41
|
-
result.
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.3.
|
|
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/
|
|
15
|
-
"@aiready/core": "0.3.
|
|
16
|
-
"@aiready/
|
|
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
|
@@ -6,13 +6,16 @@ import chalk from 'chalk';
|
|
|
6
6
|
import { writeFileSync } from 'fs';
|
|
7
7
|
import { join } from 'path';
|
|
8
8
|
import { loadConfig, mergeConfigWithDefaults } from '@aiready/core';
|
|
9
|
+
import { readFileSync } from 'fs';
|
|
10
|
+
|
|
11
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
|
|
9
12
|
|
|
10
13
|
const program = new Command();
|
|
11
14
|
|
|
12
15
|
program
|
|
13
16
|
.name('aiready')
|
|
14
17
|
.description('AIReady - Unified AI-readiness analysis tools')
|
|
15
|
-
.version(
|
|
18
|
+
.version(packageJson.version)
|
|
16
19
|
.addHelpText('after', '\nCONFIGURATION:\n Supports config files: aiready.json, aiready.config.json, .aiready.json, .aireadyrc.json, aiready.config.js, .aireadyrc.js\n CLI options override config file settings');
|
|
17
20
|
|
|
18
21
|
program
|
|
@@ -133,7 +136,7 @@ program
|
|
|
133
136
|
|
|
134
137
|
const { analyzePatterns, generateSummary } = await import('@aiready/pattern-detect');
|
|
135
138
|
|
|
136
|
-
const results = await analyzePatterns(finalOptions);
|
|
139
|
+
const { results } = await analyzePatterns(finalOptions);
|
|
137
140
|
|
|
138
141
|
const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
139
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
|
-
|
|
36
|
-
result.
|
|
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
|