@aiready/change-amplification 0.14.16 → 0.14.17

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.16 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
14
+ CJS ⚡️ Build success in 69ms
15
+ ESM dist/index.mjs 916.00 B
15
16
  ESM dist/chunk-KUIEB4UN.mjs 5.32 KB
16
17
  ESM dist/cli.mjs 2.41 KB
17
- ESM dist/index.mjs 916.00 B
18
- ESM ⚡️ Build success in 48ms
18
+ ESM ⚡️ Build success in 69ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 3155ms
20
+ DTS ⚡️ Build success in 2867ms
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,54 @@
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.16 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]
11
-
12
-  Test Files 0 passed (5)
13
-  Tests 0 passed (0)
14
-  Start at 23:35:29
15
-  Duration 370ms
16
- [?2026l[?2026h
17
10
   ❯ src/__tests__/analyzer.test.ts [queued]
18
-  ❯ src/__tests__/cli.test.ts [queued]
19
-  ❯ src/__tests__/dummy.test.ts 0/1
20
-  ❯ src/__tests__/provider.test.ts [queued]
21
-  ❯ src/__tests__/scoring.test.ts [queued]
22
11
 
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
12
+  Test Files 0 passed (6)
13
+  Tests 0 passed (0)
14
+  Start at 19:19:04
15
+  Duration 102ms
16
+ [?2026l[?2026h ✓ src/__tests__/dummy.test.ts (1 test) 2ms
28
17
 
29
18
   ❯ src/__tests__/analyzer.test.ts [queued]
30
19
   ❯ src/__tests__/cli.test.ts [queued]
20
+  ❯ src/__tests__/contract.test.ts [queued]
31
21
   ❯ src/__tests__/provider.test.ts [queued]
32
22
   ❯ src/__tests__/scoring.test.ts [queued]
33
23
 
34
-  Test Files 1 passed (5)
24
+  Test Files 1 passed (6)
35
25
   Tests 1 passed (1)
36
-  Start at 23:35:29
37
-  Duration 908ms
38
- [?2026l[?2026h
26
+  Start at 19:19:04
27
+  Duration 959ms
28
+ [?2026l[?2026h
39
29
   ❯ src/__tests__/analyzer.test.ts [queued]
40
30
   ❯ src/__tests__/cli.test.ts 0/2
31
+  ❯ src/__tests__/contract.test.ts [queued]
41
32
   ❯ src/__tests__/provider.test.ts [queued]
42
33
   ❯ src/__tests__/scoring.test.ts [queued]
43
34
 
44
-  Test Files 1 passed (5)
35
+  Test Files 1 passed (6)
45
36
   Tests 1 passed (3)
46
-  Start at 23:35:29
47
-  Duration 1.54s
48
- [?2026l ✓ src/__tests__/cli.test.ts (2 tests) 4ms
37
+  Start at 19:19:04
38
+  Duration 1.16s
39
+ [?2026l ✓ src/__tests__/cli.test.ts (2 tests) 2ms
40
+ ✓ src/__tests__/scoring.test.ts (2 tests) 2ms
41
+ ✓ src/__tests__/provider.test.ts (2 tests) 3ms
42
+ ✓ src/__tests__/contract.test.ts (1 test) 23ms
49
43
  stdout | src/__tests__/analyzer.test.ts > analyzeChangeAmplification reproduction > should see how it gets to 0
50
44
  Resulting score for highly coupled: 27
51
45
  Rating: explosive
52
46
 
53
- ✓ src/__tests__/analyzer.test.ts (2 tests) 5ms
54
- ✓ src/__tests__/provider.test.ts (2 tests) 4ms
55
- ✓ src/__tests__/scoring.test.ts (2 tests) 2ms
47
+ ✓ src/__tests__/analyzer.test.ts (2 tests) 9ms
56
48
 
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)
49
+  Test Files  6 passed (6)
50
+  Tests  10 passed (10)
51
+  Start at  19:19:04
52
+  Duration  1.24s (transform 1.02s, setup 0ms, import 5.00s, tests 42ms, environment 1ms)
61
53
 
62
54
  [?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.17",
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.20"
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
  }