@aiready/consistency 0.8.22 → 0.8.24
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/.turbo/turbo-test.log +15 -9
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +6 -2
- package/dist/index.mjs +8 -2
- package/package.json +2 -2
- package/src/scoring.ts +15 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/consistency@0.8.
|
|
3
|
+
> @aiready/consistency@0.8.24 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,16 +9,16 @@
|
|
|
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[32m55.
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m55.56 KB[39m
|
|
13
13
|
[32mCJS[39m [1mdist/cli.js [22m[32m50.90 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m12.69 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 223ms
|
|
16
15
|
[32mESM[39m [1mdist/chunk-YEHXYHGY.mjs [22m[32m40.95 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m12.92 KB[39m
|
|
17
17
|
[32mESM[39m [1mdist/cli.mjs [22m[32m8.76 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 223ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 5231ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
|
-
DTS dist/index.d.ts 3.
|
|
22
|
+
DTS dist/index.d.ts 3.41 KB
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
|
24
|
-
DTS dist/index.d.mts 3.
|
|
24
|
+
DTS dist/index.d.mts 3.41 KB
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/consistency@0.8.
|
|
3
|
+
> @aiready/consistency@0.8.24 test /Users/pengcao/projects/aiready/packages/consistency
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
7
7
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/consistency[39m
|
|
8
8
|
|
|
9
|
-
[32m✓[39m
|
|
10
|
-
[32m✓[39m
|
|
11
|
-
[32m✓[39m dist/__tests__/language-filter.test.js [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
12
|
-
[32m✓[39m src/__tests__/language-filter.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
13
|
-
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m
|
|
14
|
-
|
|
9
|
+
[32m✓[39m dist/__tests__/scoring.test.js [2m([22m[2m8 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
10
|
+
[32m✓[39m src/__tests__/scoring.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 91[2mms[22m[39m
|
|
11
|
+
[32m✓[39m dist/__tests__/language-filter.test.js [2m([22m[2m3 tests[22m[2m)[22m[32m 136[2mms[22m[39m
|
|
12
|
+
[32m✓[39m src/__tests__/language-filter.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 104[2mms[22m[39m
|
|
13
|
+
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m 2338[2mms[22m[39m
|
|
14
|
+
[33m[2m✓[22m[39m should analyze naming issues [33m 1367[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m should detect minimum severity filtering [33m 429[2mms[22m[39m
|
|
16
|
+
[33m[2m✓[22m[39m should generate relevant recommendations [33m 535[2mms[22m[39m
|
|
17
|
+
[32m✓[39m dist/__tests__/analyzer.test.js [2m([22m[2m18 tests[22m[2m)[22m[33m 1945[2mms[22m[39m
|
|
18
|
+
[33m[2m✓[22m[39m should analyze naming issues [33m 1162[2mms[22m[39m
|
|
19
|
+
[33m[2m✓[22m[39m should detect minimum severity filtering [33m 432[2mms[22m[39m
|
|
20
|
+
[33m[2m✓[22m[39m should generate relevant recommendations [33m 342[2mms[22m[39m
|
|
15
21
|
|
|
16
22
|
[2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
17
23
|
[2m Tests [22m [1m[32m58 passed[39m[22m[90m (58)[39m
|
|
18
|
-
[2m Start at [22m
|
|
19
|
-
[2m Duration [22m
|
|
24
|
+
[2m Start at [22m 18:31:35
|
|
25
|
+
[2m Duration [22m 8.61s[2m (transform 8.44s, setup 0ms, import 26.06s, tests 4.62s, environment 1ms)[22m
|
|
20
26
|
|
|
21
27
|
[?25h
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
|
|
1
|
+
import { Issue, ScanOptions, AnalysisResult, CostConfig, ToolScoringOutput } from '@aiready/core';
|
|
2
2
|
|
|
3
3
|
interface ConsistencyOptions extends ScanOptions {
|
|
4
4
|
/** Check naming conventions and quality */
|
|
@@ -92,7 +92,10 @@ declare function analyzePatterns(files: string[]): Promise<PatternIssue[]>;
|
|
|
92
92
|
* - Issue density (issues per file)
|
|
93
93
|
* - Weighted severity (critical: 10pts, major: 3pts, minor: 0.5pts)
|
|
94
94
|
* - Pattern consistency across codebase
|
|
95
|
+
*
|
|
96
|
+
* Includes business value metrics:
|
|
97
|
+
* - Estimated developer hours to fix consistency issues
|
|
95
98
|
*/
|
|
96
|
-
declare function calculateConsistencyScore(issues: ConsistencyIssue[], totalFilesAnalyzed: number): ToolScoringOutput;
|
|
99
|
+
declare function calculateConsistencyScore(issues: ConsistencyIssue[], totalFilesAnalyzed: number, costConfig?: Partial<CostConfig>): ToolScoringOutput;
|
|
97
100
|
|
|
98
101
|
export { type ArchitectureIssue, type ConsistencyIssue, type ConsistencyOptions, type ConsistencyReport, type NamingIssue, type PatternIssue, analyzeConsistency, analyzeNaming, analyzeNamingAST, analyzePatterns, calculateConsistencyScore, detectNamingConventions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
|
|
1
|
+
import { Issue, ScanOptions, AnalysisResult, CostConfig, ToolScoringOutput } from '@aiready/core';
|
|
2
2
|
|
|
3
3
|
interface ConsistencyOptions extends ScanOptions {
|
|
4
4
|
/** Check naming conventions and quality */
|
|
@@ -92,7 +92,10 @@ declare function analyzePatterns(files: string[]): Promise<PatternIssue[]>;
|
|
|
92
92
|
* - Issue density (issues per file)
|
|
93
93
|
* - Weighted severity (critical: 10pts, major: 3pts, minor: 0.5pts)
|
|
94
94
|
* - Pattern consistency across codebase
|
|
95
|
+
*
|
|
96
|
+
* Includes business value metrics:
|
|
97
|
+
* - Estimated developer hours to fix consistency issues
|
|
95
98
|
*/
|
|
96
|
-
declare function calculateConsistencyScore(issues: ConsistencyIssue[], totalFilesAnalyzed: number): ToolScoringOutput;
|
|
99
|
+
declare function calculateConsistencyScore(issues: ConsistencyIssue[], totalFilesAnalyzed: number, costConfig?: Partial<CostConfig>): ToolScoringOutput;
|
|
97
100
|
|
|
98
101
|
export { type ArchitectureIssue, type ConsistencyIssue, type ConsistencyOptions, type ConsistencyReport, type NamingIssue, type PatternIssue, analyzeConsistency, analyzeNaming, analyzeNamingAST, analyzePatterns, calculateConsistencyScore, detectNamingConventions };
|
package/dist/index.js
CHANGED
|
@@ -1707,7 +1707,8 @@ function analyzeFileNaming(file, content, customAbbreviations, customShortWords,
|
|
|
1707
1707
|
}
|
|
1708
1708
|
|
|
1709
1709
|
// src/scoring.ts
|
|
1710
|
-
|
|
1710
|
+
var import_core6 = require("@aiready/core");
|
|
1711
|
+
function calculateConsistencyScore2(issues, totalFilesAnalyzed, costConfig) {
|
|
1711
1712
|
const criticalIssues = issues.filter((i) => i.severity === "critical").length;
|
|
1712
1713
|
const majorIssues = issues.filter((i) => i.severity === "major").length;
|
|
1713
1714
|
const minorIssues = issues.filter((i) => i.severity === "minor").length;
|
|
@@ -1781,6 +1782,7 @@ function calculateConsistencyScore2(issues, totalFilesAnalyzed) {
|
|
|
1781
1782
|
priority: "low"
|
|
1782
1783
|
});
|
|
1783
1784
|
}
|
|
1785
|
+
const productivityImpact = (0, import_core6.calculateProductivityImpact)(issues);
|
|
1784
1786
|
return {
|
|
1785
1787
|
toolName: "consistency",
|
|
1786
1788
|
score,
|
|
@@ -1790,7 +1792,9 @@ function calculateConsistencyScore2(issues, totalFilesAnalyzed) {
|
|
|
1790
1792
|
majorIssues,
|
|
1791
1793
|
minorIssues,
|
|
1792
1794
|
issuesPerFile: Math.round(issuesPerFile * 100) / 100,
|
|
1793
|
-
avgWeightedIssuesPerFile: Math.round(avgWeightedIssuesPerFile * 100) / 100
|
|
1795
|
+
avgWeightedIssuesPerFile: Math.round(avgWeightedIssuesPerFile * 100) / 100,
|
|
1796
|
+
// Business value metrics
|
|
1797
|
+
estimatedDeveloperHours: productivityImpact.totalHours
|
|
1794
1798
|
},
|
|
1795
1799
|
factors,
|
|
1796
1800
|
recommendations
|
package/dist/index.mjs
CHANGED
|
@@ -188,7 +188,10 @@ function analyzeFileNaming(file, content, customAbbreviations, customShortWords,
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// src/scoring.ts
|
|
191
|
-
|
|
191
|
+
import {
|
|
192
|
+
calculateProductivityImpact
|
|
193
|
+
} from "@aiready/core";
|
|
194
|
+
function calculateConsistencyScore(issues, totalFilesAnalyzed, costConfig) {
|
|
192
195
|
const criticalIssues = issues.filter((i) => i.severity === "critical").length;
|
|
193
196
|
const majorIssues = issues.filter((i) => i.severity === "major").length;
|
|
194
197
|
const minorIssues = issues.filter((i) => i.severity === "minor").length;
|
|
@@ -262,6 +265,7 @@ function calculateConsistencyScore(issues, totalFilesAnalyzed) {
|
|
|
262
265
|
priority: "low"
|
|
263
266
|
});
|
|
264
267
|
}
|
|
268
|
+
const productivityImpact = calculateProductivityImpact(issues);
|
|
265
269
|
return {
|
|
266
270
|
toolName: "consistency",
|
|
267
271
|
score,
|
|
@@ -271,7 +275,9 @@ function calculateConsistencyScore(issues, totalFilesAnalyzed) {
|
|
|
271
275
|
majorIssues,
|
|
272
276
|
minorIssues,
|
|
273
277
|
issuesPerFile: Math.round(issuesPerFile * 100) / 100,
|
|
274
|
-
avgWeightedIssuesPerFile: Math.round(avgWeightedIssuesPerFile * 100) / 100
|
|
278
|
+
avgWeightedIssuesPerFile: Math.round(avgWeightedIssuesPerFile * 100) / 100,
|
|
279
|
+
// Business value metrics
|
|
280
|
+
estimatedDeveloperHours: productivityImpact.totalHours
|
|
275
281
|
},
|
|
276
282
|
factors,
|
|
277
283
|
recommendations
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/consistency",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.24",
|
|
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",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@typescript-eslint/typescript-estree": "^8.53.0",
|
|
44
44
|
"chalk": "^5.3.0",
|
|
45
45
|
"commander": "^14.0.0",
|
|
46
|
-
"@aiready/core": "0.9.
|
|
46
|
+
"@aiready/core": "0.9.25"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^24.0.0",
|
package/src/scoring.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
calculateProductivityImpact,
|
|
3
|
+
DEFAULT_COST_CONFIG,
|
|
4
|
+
type CostConfig
|
|
5
|
+
} from '@aiready/core';
|
|
1
6
|
import type { ToolScoringOutput } from '@aiready/core';
|
|
2
7
|
import type { ConsistencyIssue } from './types';
|
|
3
8
|
|
|
@@ -8,10 +13,14 @@ import type { ConsistencyIssue } from './types';
|
|
|
8
13
|
* - Issue density (issues per file)
|
|
9
14
|
* - Weighted severity (critical: 10pts, major: 3pts, minor: 0.5pts)
|
|
10
15
|
* - Pattern consistency across codebase
|
|
16
|
+
*
|
|
17
|
+
* Includes business value metrics:
|
|
18
|
+
* - Estimated developer hours to fix consistency issues
|
|
11
19
|
*/
|
|
12
20
|
export function calculateConsistencyScore(
|
|
13
21
|
issues: ConsistencyIssue[],
|
|
14
|
-
totalFilesAnalyzed: number
|
|
22
|
+
totalFilesAnalyzed: number,
|
|
23
|
+
costConfig?: Partial<CostConfig>
|
|
15
24
|
): ToolScoringOutput {
|
|
16
25
|
const criticalIssues = issues.filter(i => i.severity === 'critical').length;
|
|
17
26
|
const majorIssues = issues.filter(i => i.severity === 'major').length;
|
|
@@ -111,6 +120,9 @@ export function calculateConsistencyScore(
|
|
|
111
120
|
});
|
|
112
121
|
}
|
|
113
122
|
|
|
123
|
+
// Calculate business value metrics
|
|
124
|
+
const productivityImpact = calculateProductivityImpact(issues);
|
|
125
|
+
|
|
114
126
|
return {
|
|
115
127
|
toolName: 'consistency',
|
|
116
128
|
score,
|
|
@@ -121,6 +133,8 @@ export function calculateConsistencyScore(
|
|
|
121
133
|
minorIssues,
|
|
122
134
|
issuesPerFile: Math.round(issuesPerFile * 100) / 100,
|
|
123
135
|
avgWeightedIssuesPerFile: Math.round(avgWeightedIssuesPerFile * 100) / 100,
|
|
136
|
+
// Business value metrics
|
|
137
|
+
estimatedDeveloperHours: productivityImpact.totalHours,
|
|
124
138
|
},
|
|
125
139
|
factors,
|
|
126
140
|
recommendations,
|