@aiready/change-amplification 0.14.16 → 0.14.18

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/change-amplification@0.14.15 build /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.14.17 build /Users/pengcao/projects/aiready/packages/change-amplification
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 7.53 KB
13
13
  CJS dist/cli.js 8.99 KB
14
- CJS ⚡️ Build success in 43ms
15
- ESM dist/chunk-KUIEB4UN.mjs 5.32 KB
16
- ESM dist/cli.mjs 2.41 KB
14
+ CJS ⚡️ Build success in 81ms
17
15
  ESM dist/index.mjs 916.00 B
18
- ESM ⚡️ Build success in 48ms
16
+ ESM dist/cli.mjs 2.41 KB
17
+ ESM dist/chunk-KUIEB4UN.mjs 5.32 KB
18
+ ESM ⚡️ Build success in 86ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 3155ms
20
+ DTS ⚡️ Build success in 3352ms
21
21
  DTS dist/cli.d.ts 266.00 B
22
22
  DTS dist/index.d.ts 937.00 B
23
23
  DTS dist/cli.d.mts 266.00 B
@@ -1,7 +1,7 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.14.15 format-check /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.14.16 format-check /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > prettier --check . --ignore-path ../../.prettierignore
5
5
 
6
6
  Checking formatting...
7
- package.jsonREADME.mdsrc/__tests__/analyzer.test.tssrc/__tests__/cli.test.tssrc/__tests__/dummy.test.tssrc/__tests__/provider.test.tssrc/__tests__/scoring.test.tssrc/analyzer.tssrc/cli.tssrc/index.tssrc/provider.tssrc/scoring.tssrc/types.tstsconfig.jsonAll matched files use Prettier code style!
7
+ package.jsonREADME.mdsrc/__tests__/analyzer.test.tssrc/__tests__/cli.test.tssrc/__tests__/contract.test.tssrc/__tests__/dummy.test.tssrc/__tests__/provider.test.tssrc/__tests__/scoring.test.tssrc/analyzer.tssrc/cli.tssrc/index.tssrc/provider.tssrc/scoring.tssrc/types.tstsconfig.jsonAll matched files use Prettier code style!
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.14.15 lint /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.14.16 lint /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > eslint src --ext .ts
5
5
 
@@ -1,62 +1,76 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.14.15 test /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.14.17 test /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
-  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/change-amplification
7
+  RUN  v4.1.2 /Users/pengcao/projects/aiready/packages/change-amplification
8
8
 
9
9
  [?2026h
10
-  ❯ src/__tests__/scoring.test.ts [queued]
10
+  ❯ src/__tests__/dummy.test.ts [queued]
11
11
 
12
-  Test Files 0 passed (5)
12
+  Test Files 0 passed (6)
13
13
   Tests 0 passed (0)
14
-  Start at 23:35:29
15
-  Duration 370ms
14
+  Start at 19:25:10
15
+  Duration 341ms
16
16
  [?2026l[?2026h
17
17
   ❯ src/__tests__/analyzer.test.ts [queued]
18
18
   ❯ src/__tests__/cli.test.ts [queued]
19
-  ❯ src/__tests__/dummy.test.ts 0/1
20
-  ❯ src/__tests__/provider.test.ts [queued]
19
+  ❯ src/__tests__/contract.test.ts [queued]
20
+  ❯ src/__tests__/dummy.test.ts 1/1
21
21
   ❯ src/__tests__/scoring.test.ts [queued]
22
22
 
23
-  Test Files 0 passed (5)
24
-  Tests 0 passed (1)
25
-  Start at 23:35:29
26
-  Duration 474ms
27
- [?2026l[?2026h ✓ src/__tests__/dummy.test.ts (1 test) 1ms
23
+  Test Files 0 passed (6)
24
+  Tests 1 passed (1)
25
+  Start at 19:25:10
26
+  Duration 442ms
27
+ [?2026l[?2026h ✓ src/__tests__/dummy.test.ts (1 test) 3ms
28
28
 
29
29
   ❯ src/__tests__/analyzer.test.ts [queued]
30
30
   ❯ src/__tests__/cli.test.ts [queued]
31
+  ❯ src/__tests__/contract.test.ts [queued]
31
32
   ❯ src/__tests__/provider.test.ts [queued]
32
33
   ❯ src/__tests__/scoring.test.ts [queued]
33
34
 
34
-  Test Files 1 passed (5)
35
+  Test Files 1 passed (6)
35
36
   Tests 1 passed (1)
36
-  Start at 23:35:29
37
-  Duration 908ms
38
- [?2026l[?2026h
37
+  Start at 19:25:10
38
+  Duration 994ms
39
+ [?2026l[?2026h
39
40
   ❯ src/__tests__/analyzer.test.ts [queued]
40
-  ❯ src/__tests__/cli.test.ts 0/2
41
+  ❯ src/__tests__/cli.test.ts [queued]
42
+  ❯ src/__tests__/contract.test.ts [queued]
41
43
   ❯ src/__tests__/provider.test.ts [queued]
42
44
   ❯ src/__tests__/scoring.test.ts [queued]
43
45
 
44
-  Test Files 1 passed (5)
46
+  Test Files 1 passed (6)
47
+  Tests 1 passed (1)
48
+  Start at 19:25:10
49
+  Duration 2.00s
50
+ [?2026l[?2026h
51
+  ❯ src/__tests__/analyzer.test.ts [queued]
52
+  ❯ src/__tests__/cli.test.ts [queued]
53
+  ❯ src/__tests__/contract.test.ts [queued]
54
+  ❯ src/__tests__/provider.test.ts 0/2
55
+  ❯ src/__tests__/scoring.test.ts [queued]
56
+
57
+  Test Files 1 passed (6)
45
58
   Tests 1 passed (3)
46
-  Start at 23:35:29
47
-  Duration 1.54s
48
- [?2026l ✓ src/__tests__/cli.test.ts (2 tests) 4ms
59
+  Start at 19:25:10
60
+  Duration 2.21s
61
+ [?2026l ✓ src/__tests__/cli.test.ts (2 tests) 2ms
62
+ ✓ src/__tests__/provider.test.ts (2 tests) 2ms
49
63
  stdout | src/__tests__/analyzer.test.ts > analyzeChangeAmplification reproduction > should see how it gets to 0
50
64
  Resulting score for highly coupled: 27
51
65
  Rating: explosive
52
66
 
53
- ✓ src/__tests__/analyzer.test.ts (2 tests) 5ms
54
- ✓ src/__tests__/provider.test.ts (2 tests) 4ms
67
+ ✓ src/__tests__/analyzer.test.ts (2 tests) 4ms
55
68
  ✓ src/__tests__/scoring.test.ts (2 tests) 2ms
69
+ ✓ src/__tests__/contract.test.ts (1 test) 14ms
56
70
 
57
-  Test Files  5 passed (5)
58
-  Tests  9 passed (9)
59
-  Start at  23:35:29
60
-  Duration  1.65s (transform 1.47s, setup 0ms, import 4.83s, tests 16ms, environment 0ms)
71
+  Test Files  6 passed (6)
72
+  Tests  10 passed (10)
73
+  Start at  19:25:10
74
+  Duration  2.33s (transform 2.30s, setup 0ms, import 9.20s, tests 28ms, environment 0ms)
61
75
 
62
76
  [?25h
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.14.15 type-check /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.14.16 type-check /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > tsc --noEmit
5
5
 
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@aiready/change-amplification",
3
- "version": "0.14.16",
3
+ "version": "0.14.18",
4
4
  "description": "AI-Readiness: Change Amplification Detection",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "dependencies": {
9
- "@typescript-eslint/typescript-estree": "^8.0.0",
10
- "commander": "^14.0.0",
11
- "glob": "^13.0.0",
12
- "chalk": "^5.3.0",
13
- "@aiready/core": "0.24.19"
9
+ "@typescript-eslint/typescript-estree": "^8.58.0",
10
+ "chalk": "^5.6.2",
11
+ "commander": "^14.0.3",
12
+ "glob": "^13.0.6",
13
+ "@aiready/core": "0.24.21"
14
14
  },
15
15
  "devDependencies": {
16
- "@types/node": "^24.0.0",
17
- "@typescript-eslint/types": "^8.0.0",
18
- "tsup": "^8.0.2",
19
- "typescript": "^5.4.5",
20
- "vitest": "^4.0.0"
16
+ "@types/node": "^24.12.2",
17
+ "@typescript-eslint/types": "^8.58.0",
18
+ "tsup": "^8.5.1",
19
+ "typescript": "^6.0.2",
20
+ "vitest": "^4.1.2"
21
21
  },
22
22
  "exports": {
23
23
  ".": {
@@ -44,6 +44,7 @@
44
44
  "type-check": "tsc --noEmit",
45
45
  "format-check": "prettier --check . --ignore-path ../../.prettierignore",
46
46
  "format": "prettier --write . --ignore-path ../../.prettierignore",
47
- "lint:fix": "eslint . --fix"
47
+ "lint:fix": "eslint . --fix",
48
+ "test:coverage": "vitest run --coverage"
48
49
  }
49
50
  }
@@ -0,0 +1,41 @@
1
+ import { describe, it, expect, vi } from 'vitest';
2
+ import { CHANGE_AMPLIFICATION_PROVIDER } from '../provider';
3
+ import { validateSpokeOutput } from '@aiready/core';
4
+
5
+ // Mock core functions to avoid actual FS access
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().mockImplementation((file) => {
12
+ if (file === 'file1.ts')
13
+ return 'import { x } from "./module"; export const y = x + 1;';
14
+ return '';
15
+ }),
16
+ };
17
+ });
18
+
19
+ describe('Change Amplification Contract Validation', () => {
20
+ it('should produce output matching the SpokeOutput contract', async () => {
21
+ const options = {
22
+ rootDir: './test',
23
+ };
24
+
25
+ const output = await CHANGE_AMPLIFICATION_PROVIDER.analyze(options);
26
+
27
+ // 1. Structural Validation
28
+ const validation = validateSpokeOutput('change-amplification', output);
29
+ if (!validation.valid) {
30
+ console.error('Contract Validation Errors:', validation.errors);
31
+ }
32
+ expect(validation.valid).toBe(true);
33
+
34
+ // 2. Scoring Validation
35
+ const score = CHANGE_AMPLIFICATION_PROVIDER.score(output, options);
36
+ expect(score).toBeDefined();
37
+ expect(typeof score.score).toBe('number');
38
+ expect(score.score).toBeGreaterThanOrEqual(0);
39
+ expect(score.score).toBeLessThanOrEqual(100);
40
+ });
41
+ });
package/tsconfig.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "dist",
5
- "rootDir": "src"
5
+ "rootDir": "src",
6
+ "ignoreDeprecations": "6.0"
6
7
  },
7
8
  "include": ["src/**/*"]
8
9
  }