@aiready/consistency 0.8.22 → 0.8.25
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 +23 -24
- package/.turbo/turbo-test.log +21 -21
- 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,24 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
DTS Build
|
|
20
|
-
DTS
|
|
21
|
-
DTS dist/
|
|
22
|
-
DTS dist/
|
|
23
|
-
DTS dist/
|
|
24
|
-
DTS dist/index.d.mts 3.27 KB
|
|
1
|
+
|
|
2
|
+
> @aiready/consistency@0.8.25 build /Users/pengcao/projects/aiready/packages/consistency
|
|
3
|
+
> tsup src/index.ts src/cli.ts --format cjs,esm --dts
|
|
4
|
+
|
|
5
|
+
CLI Building entry: src/cli.ts, src/index.ts
|
|
6
|
+
CLI Using tsconfig: tsconfig.json
|
|
7
|
+
CLI tsup v8.5.1
|
|
8
|
+
CLI Target: es2020
|
|
9
|
+
CJS Build start
|
|
10
|
+
ESM Build start
|
|
11
|
+
CJS dist/index.js 55.56 KB
|
|
12
|
+
CJS dist/cli.js 50.90 KB
|
|
13
|
+
CJS ⚡️ Build success in 94ms
|
|
14
|
+
ESM dist/cli.mjs 8.76 KB
|
|
15
|
+
ESM dist/chunk-YEHXYHGY.mjs 40.95 KB
|
|
16
|
+
ESM dist/index.mjs 12.92 KB
|
|
17
|
+
ESM ⚡️ Build success in 95ms
|
|
18
|
+
DTS Build start
|
|
19
|
+
DTS ⚡️ Build success in 1886ms
|
|
20
|
+
DTS dist/cli.d.ts 20.00 B
|
|
21
|
+
DTS dist/index.d.ts 3.41 KB
|
|
22
|
+
DTS dist/cli.d.mts 20.00 B
|
|
23
|
+
DTS dist/index.d.mts 3.41 KB
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[32m✓[39m
|
|
10
|
-
[32m✓[39m
|
|
11
|
-
[32m✓[39m
|
|
12
|
-
[32m✓[39m
|
|
13
|
-
|
|
14
|
-
[32m✓[39m
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[2m
|
|
18
|
-
[2m
|
|
19
|
-
[2m
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
> @aiready/consistency@0.8.25 test /Users/pengcao/projects/aiready/packages/consistency
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/consistency[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m dist/__tests__/scoring.test.js [2m([22m[2m8 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
9
|
+
[32m✓[39m dist/__tests__/language-filter.test.js [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
10
|
+
[32m✓[39m src/__tests__/language-filter.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
11
|
+
[32m✓[39m src/__tests__/scoring.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
12
|
+
[32m✓[39m dist/__tests__/analyzer.test.js [2m([22m[2m18 tests[22m[2m)[22m[33m 752[2mms[22m[39m
|
|
13
|
+
[33m[2m✓[22m[39m should analyze naming issues [33m 312[2mms[22m[39m
|
|
14
|
+
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m 517[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m should analyze naming issues [33m 319[2mms[22m[39m
|
|
16
|
+
|
|
17
|
+
[2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
18
|
+
[2m Tests [22m [1m[32m58 passed[39m[22m[90m (58)[39m
|
|
19
|
+
[2m Start at [22m 14:37:39
|
|
20
|
+
[2m Duration [22m 2.06s[2m (transform 703ms, setup 0ms, import 5.25s, tests 1.28s, environment 0ms)[22m
|
|
21
|
+
|
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.25",
|
|
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.26"
|
|
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,
|