@aiready/consistency 0.2.1 → 0.2.2
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 +7 -7
- package/README.md +10 -4
- package/dist/cli.js +21 -10
- package/dist/cli.mjs +23 -12
- package/package.json +2 -2
- package/src/cli.ts +27 -13
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/consistency@0.2.
|
|
3
|
+
> @aiready/consistency@0.2.2 build /Users/pengcao/projects/aiready/packages/consistency
|
|
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
|
-
[
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m14.13 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in 54ms
|
|
15
|
-
[32mESM[39m [1mdist/cli.mjs [22m[32m8.08 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m8.54 KB[39m
|
|
16
13
|
[32mESM[39m [1mdist/index.mjs [22m[32m220.00 B[39m
|
|
17
14
|
[32mESM[39m [1mdist/chunk-CF4LU7KE.mjs [22m[32m12.90 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 46ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.js [22m[32m14.13 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m23.02 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 46ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 544ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
22
|
DTS dist/index.d.ts 2.60 KB
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
package/README.md
CHANGED
|
@@ -91,13 +91,19 @@ aiready-consistency ./src --no-patterns
|
|
|
91
91
|
# Show only major issues
|
|
92
92
|
aiready-consistency ./src --min-severity major
|
|
93
93
|
|
|
94
|
-
# Export to JSON
|
|
95
|
-
aiready-consistency ./src --output json
|
|
94
|
+
# Export to JSON (saved to .aiready/ by default)
|
|
95
|
+
aiready-consistency ./src --output json
|
|
96
96
|
|
|
97
|
-
# Export to Markdown
|
|
98
|
-
aiready-consistency ./src --output markdown
|
|
97
|
+
# Export to Markdown (saved to .aiready/ by default)
|
|
98
|
+
aiready-consistency ./src --output markdown
|
|
99
|
+
|
|
100
|
+
# Or specify custom paths
|
|
101
|
+
aiready-consistency ./src --output json --output-file custom-report.json
|
|
102
|
+
aiready-consistency ./src --output markdown --output-file custom-report.md
|
|
99
103
|
```
|
|
100
104
|
|
|
105
|
+
> **📁 Output Files:** By default, all output files are saved to the `.aiready/` directory in your project root with timestamped filenames. You can override this with `--output-file`.
|
|
106
|
+
|
|
101
107
|
## 🎛️ Options
|
|
102
108
|
|
|
103
109
|
| Option | Description | Default |
|
package/dist/cli.js
CHANGED
|
@@ -409,6 +409,7 @@ function generateRecommendations(namingIssues, patternIssues) {
|
|
|
409
409
|
// src/cli.ts
|
|
410
410
|
var import_chalk = __toESM(require("chalk"));
|
|
411
411
|
var import_fs = require("fs");
|
|
412
|
+
var import_path = require("path");
|
|
412
413
|
var import_core4 = require("@aiready/core");
|
|
413
414
|
var program = new import_commander.Command();
|
|
414
415
|
program.name("aiready-consistency").description("Detect consistency issues in naming, patterns, and architecture").version("0.1.0").addHelpText("after", `
|
|
@@ -452,20 +453,30 @@ EXAMPLES:
|
|
|
452
453
|
const elapsedTime = ((Date.now() - startTime) / 1e3).toFixed(2);
|
|
453
454
|
if (options.output === "json") {
|
|
454
455
|
const output = JSON.stringify(report, null, 2);
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
456
|
+
const outputPath = (0, import_core4.resolveOutputPath)(
|
|
457
|
+
options.outputFile,
|
|
458
|
+
`consistency-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.json`,
|
|
459
|
+
directory
|
|
460
|
+
);
|
|
461
|
+
const dir = (0, import_path.dirname)(outputPath);
|
|
462
|
+
if (!(0, import_fs.existsSync)(dir)) {
|
|
463
|
+
(0, import_fs.mkdirSync)(dir, { recursive: true });
|
|
460
464
|
}
|
|
465
|
+
(0, import_fs.writeFileSync)(outputPath, output);
|
|
466
|
+
console.log(import_chalk.default.green(`\u2713 Report saved to ${outputPath}`));
|
|
461
467
|
} else if (options.output === "markdown") {
|
|
462
468
|
const markdown = generateMarkdownReport(report, elapsedTime);
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
469
|
+
const outputPath = (0, import_core4.resolveOutputPath)(
|
|
470
|
+
options.outputFile,
|
|
471
|
+
`consistency-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.md`,
|
|
472
|
+
directory
|
|
473
|
+
);
|
|
474
|
+
const dir = (0, import_path.dirname)(outputPath);
|
|
475
|
+
if (!(0, import_fs.existsSync)(dir)) {
|
|
476
|
+
(0, import_fs.mkdirSync)(dir, { recursive: true });
|
|
468
477
|
}
|
|
478
|
+
(0, import_fs.writeFileSync)(outputPath, markdown);
|
|
479
|
+
console.log(import_chalk.default.green(`\u2713 Report saved to ${outputPath}`));
|
|
469
480
|
} else {
|
|
470
481
|
displayConsoleReport(report, elapsedTime);
|
|
471
482
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import chalk from "chalk";
|
|
9
|
-
import { writeFileSync } from "fs";
|
|
10
|
-
import {
|
|
9
|
+
import { writeFileSync, mkdirSync, existsSync } from "fs";
|
|
10
|
+
import { dirname } from "path";
|
|
11
|
+
import { loadConfig, mergeConfigWithDefaults, resolveOutputPath } from "@aiready/core";
|
|
11
12
|
var program = new Command();
|
|
12
13
|
program.name("aiready-consistency").description("Detect consistency issues in naming, patterns, and architecture").version("0.1.0").addHelpText("after", `
|
|
13
14
|
CONFIGURATION:
|
|
@@ -50,20 +51,30 @@ EXAMPLES:
|
|
|
50
51
|
const elapsedTime = ((Date.now() - startTime) / 1e3).toFixed(2);
|
|
51
52
|
if (options.output === "json") {
|
|
52
53
|
const output = JSON.stringify(report, null, 2);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
const outputPath = resolveOutputPath(
|
|
55
|
+
options.outputFile,
|
|
56
|
+
`consistency-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.json`,
|
|
57
|
+
directory
|
|
58
|
+
);
|
|
59
|
+
const dir = dirname(outputPath);
|
|
60
|
+
if (!existsSync(dir)) {
|
|
61
|
+
mkdirSync(dir, { recursive: true });
|
|
58
62
|
}
|
|
63
|
+
writeFileSync(outputPath, output);
|
|
64
|
+
console.log(chalk.green(`\u2713 Report saved to ${outputPath}`));
|
|
59
65
|
} else if (options.output === "markdown") {
|
|
60
66
|
const markdown = generateMarkdownReport(report, elapsedTime);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
const outputPath = resolveOutputPath(
|
|
68
|
+
options.outputFile,
|
|
69
|
+
`consistency-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.md`,
|
|
70
|
+
directory
|
|
71
|
+
);
|
|
72
|
+
const dir = dirname(outputPath);
|
|
73
|
+
if (!existsSync(dir)) {
|
|
74
|
+
mkdirSync(dir, { recursive: true });
|
|
66
75
|
}
|
|
76
|
+
writeFileSync(outputPath, markdown);
|
|
77
|
+
console.log(chalk.green(`\u2713 Report saved to ${outputPath}`));
|
|
67
78
|
} else {
|
|
68
79
|
displayConsoleReport(report, elapsedTime);
|
|
69
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/consistency",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Detects consistency issues in naming, patterns, and architecture that confuse AI models",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"chalk": "^5.3.0",
|
|
43
43
|
"commander": "^12.1.0",
|
|
44
|
-
"@aiready/core": "0.5.
|
|
44
|
+
"@aiready/core": "0.5.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^22.10.5",
|
package/src/cli.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { analyzeConsistency } from './analyzer';
|
|
5
5
|
import type { ConsistencyOptions } from './types';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
|
-
import { writeFileSync } from 'fs';
|
|
8
|
-
import { join } from 'path';
|
|
9
|
-
import { loadConfig, mergeConfigWithDefaults } from '@aiready/core';
|
|
7
|
+
import { writeFileSync, mkdirSync, existsSync } from 'fs';
|
|
8
|
+
import { join, dirname } from 'path';
|
|
9
|
+
import { loadConfig, mergeConfigWithDefaults, resolveOutputPath } from '@aiready/core';
|
|
10
10
|
|
|
11
11
|
const program = new Command();
|
|
12
12
|
|
|
@@ -80,20 +80,34 @@ EXAMPLES:
|
|
|
80
80
|
// Output based on format
|
|
81
81
|
if (options.output === 'json') {
|
|
82
82
|
const output = JSON.stringify(report, null, 2);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
const outputPath = resolveOutputPath(
|
|
84
|
+
options.outputFile,
|
|
85
|
+
`consistency-report-${new Date().toISOString().split('T')[0]}.json`,
|
|
86
|
+
directory
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const dir = dirname(outputPath);
|
|
90
|
+
if (!existsSync(dir)) {
|
|
91
|
+
mkdirSync(dir, { recursive: true });
|
|
88
92
|
}
|
|
93
|
+
|
|
94
|
+
writeFileSync(outputPath, output);
|
|
95
|
+
console.log(chalk.green(`✓ Report saved to ${outputPath}`));
|
|
89
96
|
} else if (options.output === 'markdown') {
|
|
90
97
|
const markdown = generateMarkdownReport(report, elapsedTime);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
const outputPath = resolveOutputPath(
|
|
99
|
+
options.outputFile,
|
|
100
|
+
`consistency-report-${new Date().toISOString().split('T')[0]}.md`,
|
|
101
|
+
directory
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const dir = dirname(outputPath);
|
|
105
|
+
if (!existsSync(dir)) {
|
|
106
|
+
mkdirSync(dir, { recursive: true });
|
|
96
107
|
}
|
|
108
|
+
|
|
109
|
+
writeFileSync(outputPath, markdown);
|
|
110
|
+
console.log(chalk.green(`✓ Report saved to ${outputPath}`));
|
|
97
111
|
} else {
|
|
98
112
|
// Console output
|
|
99
113
|
displayConsoleReport(report, elapsedTime);
|