@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.
@@ -1,24 +1,23 @@
1
-
2
- 
3
- > @aiready/consistency@0.8.22 build /Users/pengcao/projects/aiready/packages/consistency
4
- > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
-
6
- CLI Building entry: src/cli.ts, src/index.ts
7
- CLI Using tsconfig: tsconfig.json
8
- CLI tsup v8.5.1
9
- CLI Target: es2020
10
- CJS Build start
11
- ESM Build start
12
- CJS dist/index.js 55.33 KB
13
- CJS dist/cli.js 50.90 KB
14
- CJS ⚡️ Build success in 51ms
15
- ESM dist/index.mjs 12.69 KB
16
- ESM dist/chunk-YEHXYHGY.mjs 40.95 KB
17
- ESM dist/cli.mjs 8.76 KB
18
- ESM ⚡️ Build success in 53ms
19
- DTS Build start
20
- DTS ⚡️ Build success in 1753ms
21
- DTS dist/cli.d.ts 20.00 B
22
- DTS dist/index.d.ts 3.27 KB
23
- DTS dist/cli.d.mts 20.00 B
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
@@ -1,21 +1,21 @@
1
-
2
- 
3
- > @aiready/consistency@0.8.22 test /Users/pengcao/projects/aiready/packages/consistency
4
- > vitest run
5
-
6
- [?25l
7
-  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/consistency
8
-
9
- ✓ src/__tests__/scoring.test.ts (8 tests) 3ms
10
- ✓ dist/__tests__/scoring.test.js (8 tests) 3ms
11
- ✓ dist/__tests__/language-filter.test.js (3 tests) 11ms
12
- ✓ src/__tests__/language-filter.test.ts (3 tests) 8ms
13
- ✓ src/__tests__/analyzer.test.ts (18 tests) 517ms
14
- ✓ dist/__tests__/analyzer.test.js (18 tests) 413ms
15
-
16
-  Test Files  6 passed (6)
17
-  Tests  58 passed (58)
18
-  Start at  00:46:20
19
-  Duration  2.32s (transform 2.08s, setup 0ms, import 5.70s, tests 956ms, environment 1ms)
20
-
21
- [?25h
1
+
2
+ > @aiready/consistency@0.8.25 test /Users/pengcao/projects/aiready/packages/consistency
3
+ > vitest run
4
+
5
+
6
+  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/consistency
7
+
8
+ ✓ dist/__tests__/scoring.test.js (8 tests) 3ms
9
+ ✓ dist/__tests__/language-filter.test.js (3 tests) 6ms
10
+ ✓ src/__tests__/language-filter.test.ts (3 tests) 3ms
11
+ ✓ src/__tests__/scoring.test.ts (8 tests) 3ms
12
+ ✓ dist/__tests__/analyzer.test.js (18 tests) 752ms
13
+ ✓ should analyze naming issues  312ms
14
+ ✓ src/__tests__/analyzer.test.ts (18 tests) 517ms
15
+ ✓ should analyze naming issues  319ms
16
+
17
+  Test Files  6 passed (6)
18
+  Tests  58 passed (58)
19
+  Start at  14:37:39
20
+  Duration  2.06s (transform 703ms, setup 0ms, import 5.25s, tests 1.28s, environment 0ms)
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
- function calculateConsistencyScore2(issues, totalFilesAnalyzed) {
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
- function calculateConsistencyScore(issues, totalFilesAnalyzed) {
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.22",
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.22"
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,