@aiready/consistency 0.8.37 → 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.37 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
@@ -11,13 +11,13 @@
11
11
  ESM Build start
12
12
  CJS dist/index.js 56.89 KB
13
13
  CJS dist/cli.js 51.74 KB
14
- CJS ⚡️ Build success in 273ms
14
+ CJS ⚡️ Build success in 45ms
15
15
  ESM dist/cli.mjs 8.83 KB
16
- ESM dist/index.mjs 13.46 KB
17
16
  ESM dist/chunk-J5IFYDVU.mjs 41.75 KB
18
- ESM ⚡️ Build success in 274ms
17
+ ESM dist/index.mjs 13.46 KB
18
+ ESM ⚡️ Build success in 45ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 5833ms
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,23 +1,24 @@
1
1
 
2
2
  
3
- > @aiready/consistency@0.8.37 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) 4ms
10
- ✓ src/__tests__/scoring.test.ts (8 tests) 6ms
11
- ✓ dist/__tests__/language-filter.test.js (3 tests) 7ms
12
- ✓ src/__tests__/language-filter.test.ts (3 tests) 7ms
13
- ✓ src/__tests__/analyzer.test.ts (18 tests) 566ms
14
- ✓ should analyze naming issues  396ms
15
- ✓ dist/__tests__/analyzer.test.js (18 tests) 578ms
16
- ✓ should analyze naming issues  377ms
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
+ ✓ dist/__tests__/language-filter.test.js (3 tests) 10ms
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
17
18
 
18
-  Test Files  6 passed (6)
19
-  Tests  58 passed (58)
20
-  Start at  12:53:41
21
-  Duration  2.45s (transform 1.75s, setup 0ms, import 6.92s, tests 1.17s, environment 0ms)
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)
22
23
 
23
24
  [?25h
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/consistency",
3
- "version": "0.8.37",
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.38"
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
+ });