@aiready/consistency 0.8.38 → 0.15.0

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,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/consistency@0.8.38 build /Users/pengcao/projects/aiready/packages/consistency
3
+ > @aiready/consistency@0.15.0 build /Users/pengcao/projects/aiready/packages/consistency
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,15 +9,15 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/index.mjs 13.46 KB
13
- ESM dist/cli.mjs 8.83 KB
14
- ESM dist/chunk-J5IFYDVU.mjs 41.75 KB
15
- ESM ⚡️ Build success in 40ms
16
12
  CJS dist/index.js 56.89 KB
17
13
  CJS dist/cli.js 51.74 KB
18
- CJS ⚡️ Build success in 40ms
14
+ CJS ⚡️ Build success in 45ms
15
+ ESM dist/cli.mjs 8.83 KB
16
+ ESM dist/chunk-J5IFYDVU.mjs 41.75 KB
17
+ ESM dist/index.mjs 13.46 KB
18
+ ESM ⚡️ Build success in 45ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 3481ms
20
+ DTS ⚡️ Build success in 2529ms
21
21
  DTS dist/cli.d.ts 20.00 B
22
22
  DTS dist/index.d.ts 3.43 KB
23
23
  DTS dist/cli.d.mts 20.00 B
@@ -1,25 +1,24 @@
1
1
 
2
2
  
3
- > @aiready/consistency@0.8.38 test /Users/pengcao/projects/aiready/packages/consistency
3
+ > @aiready/consistency@0.15.0 test /Users/pengcao/projects/aiready/packages/consistency
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/consistency
8
8
 
9
- ✓ dist/__tests__/scoring.test.js (8 tests) 13ms
10
- ✓ src/__tests__/scoring.test.ts (8 tests) 120ms
11
- ✓ src/__tests__/language-filter.test.ts (3 tests) 59ms
9
+ ✓ dist/__tests__/scoring.test.js (8 tests) 7ms
10
+ ✓ src/__tests__/language-filter.test.ts (3 tests) 10ms
11
+ ✓ src/__tests__/contract.test.ts (1 test) 2ms
12
12
  ✓ dist/__tests__/language-filter.test.js (3 tests) 10ms
13
- ✓ src/__tests__/analyzer.test.ts (18 tests) 892ms
14
- ✓ should analyze naming issues  405ms
15
- ✓ should detect minimum severity filtering  366ms
16
- ✓ dist/__tests__/analyzer.test.js (18 tests) 1208ms
17
- ✓ should analyze naming issues  581ms
18
- ✓ should detect minimum severity filtering  421ms
13
+ ✓ src/__tests__/scoring.test.ts (8 tests) 4ms
14
+ ✓ dist/__tests__/analyzer.test.js (18 tests) 632ms
15
+ ✓ should analyze naming issues  333ms
16
+ ✓ src/__tests__/analyzer.test.ts (18 tests) 632ms
17
+ ✓ should analyze naming issues  310ms
19
18
 
20
-  Test Files  6 passed (6)
21
-  Tests  58 passed (58)
22
-  Start at  23:46:50
23
-  Duration  4.00s (transform 1.68s, setup 0ms, import 8.87s, tests 2.30s, environment 1ms)
19
+  Test Files  7 passed (7)
20
+  Tests  59 passed (59)
21
+  Start at  15:41:04
22
+  Duration  3.60s (transform 2.43s, setup 0ms, import 10.60s, tests 1.30s, environment 1ms)
24
23
 
25
24
  [?25h
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/consistency",
3
- "version": "0.8.38",
3
+ "version": "0.15.0",
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.39"
46
+ "@aiready/core": "0.18.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^24.0.0",
@@ -0,0 +1,34 @@
1
+ import { describe, it, expect, vi } from 'vitest';
2
+ import { analyzeConsistency } from '../index';
3
+ import { validateSpokeOutput } from '../../../core/src/types/contract';
4
+
5
+ // Mock core functions
6
+ vi.mock('@aiready/core', async (importOriginal) => {
7
+ const actual = await importOriginal<typeof import('@aiready/core')>();
8
+ return {
9
+ ...actual,
10
+ scanFiles: vi.fn().mockResolvedValue(['file1.ts']),
11
+ readFileContent: vi.fn().mockResolvedValue('export const My_Variable = 1;'), // Intentionally inconsistent
12
+ };
13
+ });
14
+
15
+ describe('Consistency Spoke Contract Validation', () => {
16
+ it('should produce output matching the SpokeOutput contract', async () => {
17
+ const results = await analyzeConsistency({
18
+ rootDir: './test',
19
+ } as any);
20
+
21
+ const fullOutput = {
22
+ results: results.results,
23
+ summary: results.summary,
24
+ };
25
+
26
+ const validation = validateSpokeOutput('consistency', fullOutput);
27
+
28
+ if (!validation.valid) {
29
+ console.error('Contract Validation Errors:', validation.errors);
30
+ }
31
+
32
+ expect(validation.valid).toBe(true);
33
+ });
34
+ });