@aiready/change-amplification 0.14.6 → 0.14.8

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,23 +1,24 @@
1
-
2
- > @aiready/change-amplification@0.14.6 build /Users/pengcao/projects/aiready/packages/change-amplification
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/cli.js 8.51 KB
12
- CJS dist/index.js 7.74 KB
13
- CJS ⚡️ Build success in 51ms
14
- ESM dist/cli.mjs 2.41 KB
15
- ESM dist/chunk-SPXGOPNW.mjs 4.83 KB
16
- ESM dist/index.mjs 1.53 KB
17
- ESM ⚡️ Build success in 52ms
18
- DTS Build start
19
- DTS ⚡️ Build success in 4350ms
20
- DTS dist/cli.d.ts 152.00 B
21
- DTS dist/index.d.ts 1.12 KB
22
- DTS dist/cli.d.mts 152.00 B
23
- DTS dist/index.d.mts 1.12 KB
1
+
2
+ 
3
+ > @aiready/change-amplification@0.14.8 build /Users/pengcao/projects/aiready/packages/change-amplification
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
+ ESM dist/cli.mjs 2.41 KB
13
+ ESM dist/index.mjs 1.53 KB
14
+ ESM dist/chunk-SPXGOPNW.mjs 4.83 KB
15
+ ESM ⚡️ Build success in 65ms
16
+ CJS dist/cli.js 8.51 KB
17
+ CJS dist/index.js 7.74 KB
18
+ CJS ⚡️ Build success in 66ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 1855ms
21
+ DTS dist/cli.d.ts 266.00 B
22
+ DTS dist/index.d.ts 1.15 KB
23
+ DTS dist/cli.d.mts 266.00 B
24
+ DTS dist/index.d.mts 1.15 KB
@@ -0,0 +1,7 @@
1
+
2
+ 
3
+ > @aiready/change-amplification@0.14.8 format-check /Users/pengcao/projects/aiready/packages/change-amplification
4
+ > prettier --check . --ignore-path ../../.prettierignore
5
+
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!
@@ -1,4 +1,5 @@
1
-
2
- > @aiready/change-amplification@0.13.20 lint /Users/pengcao/projects/aiready/packages/change-amplification
3
- > eslint src --ext .ts
4
-
1
+
2
+ 
3
+ > @aiready/change-amplification@0.14.8 lint /Users/pengcao/projects/aiready/packages/change-amplification
4
+ > eslint src --ext .ts
5
+
@@ -1,22 +1,24 @@
1
-
2
- > @aiready/change-amplification@0.14.5 test /Users/pengcao/projects/aiready/packages/change-amplification
3
- > vitest run
4
-
5
-
6
-  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/change-amplification
7
-
8
- ✓ src/__tests__/dummy.test.ts (1 test) 1ms
9
- ✓ src/__tests__/scoring.test.ts (2 tests) 27ms
10
- ✓ src/__tests__/provider.test.ts (2 tests) 13ms
11
- ✓ src/__tests__/cli.test.ts (2 tests) 42ms
12
- stdout | src/__tests__/analyzer.test.ts > analyzeChangeAmplification reproduction > should see how it gets to 0
13
- Resulting score for highly coupled: 27
14
- Rating: explosive
15
-
16
- ✓ src/__tests__/analyzer.test.ts (2 tests) 31ms
17
-
18
-  Test Files  5 passed (5)
19
-  Tests  9 passed (9)
20
-  Start at  20:27:24
21
-  Duration  4.19s (transform 3.30s, setup 0ms, import 13.24s, tests 114ms, environment 0ms)
22
-
1
+
2
+ 
3
+ > @aiready/change-amplification@0.14.7 test /Users/pengcao/projects/aiready/packages/change-amplification
4
+ > vitest run
5
+
6
+ [?25l
7
+  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/change-amplification
8
+
9
+ ✓ src/__tests__/dummy.test.ts (1 test) 12ms
10
+ ✓ src/__tests__/cli.test.ts (2 tests) 10ms
11
+ ✓ src/__tests__/scoring.test.ts (2 tests) 9ms
12
+ stdout | src/__tests__/analyzer.test.ts > analyzeChangeAmplification reproduction > should see how it gets to 0
13
+ Resulting score for highly coupled: 27
14
+ Rating: explosive
15
+
16
+ ✓ src/__tests__/analyzer.test.ts (2 tests) 3ms
17
+ ✓ src/__tests__/provider.test.ts (2 tests) 7ms
18
+
19
+  Test Files  5 passed (5)
20
+  Tests  9 passed (9)
21
+  Start at  00:08:32
22
+  Duration  3.04s (transform 3.50s, setup 0ms, import 11.31s, tests 41ms, environment 0ms)
23
+
24
+ [?25h
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > @aiready/change-amplification@0.14.8 type-check /Users/pengcao/projects/aiready/packages/change-amplification
4
+ > tsc --noEmit
5
+
package/dist/cli.d.mts CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env node
2
- declare const changeAmplificationAction: (directory: string, options: any) => Promise<void>;
2
+ declare const changeAmplificationAction: (directory: string, options: {
3
+ include?: string;
4
+ exclude?: string;
5
+ output?: string;
6
+ outputFile?: string;
7
+ [key: string]: any;
8
+ }) => Promise<void>;
3
9
 
4
10
  export { changeAmplificationAction };
package/dist/cli.d.ts CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env node
2
- declare const changeAmplificationAction: (directory: string, options: any) => Promise<void>;
2
+ declare const changeAmplificationAction: (directory: string, options: {
3
+ include?: string;
4
+ exclude?: string;
5
+ output?: string;
6
+ outputFile?: string;
7
+ [key: string]: any;
8
+ }) => Promise<void>;
3
9
 
4
10
  export { changeAmplificationAction };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _aiready_core from '@aiready/core';
2
- import { Issue, IssueType, ScanOptions, SpokeOutput, AnalysisResult } from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, SpokeOutput, AnalysisResult, ToolScoringOutput } from '@aiready/core';
3
3
 
4
4
  /**
5
5
  * Change Amplification Tool Provider
@@ -22,6 +22,6 @@ declare function analyzeChangeAmplification(options: ChangeAmplificationOptions)
22
22
  /**
23
23
  * Convert change amplification report into a standardized ToolScoringOutput.
24
24
  */
25
- declare function calculateChangeAmplificationScore(report: ChangeAmplificationReport): any;
25
+ declare function calculateChangeAmplificationScore(report: ChangeAmplificationReport): ToolScoringOutput;
26
26
 
27
27
  export { type ChangeAmplificationIssue, type ChangeAmplificationOptions, ChangeAmplificationProvider, type ChangeAmplificationReport, type FileChangeAmplificationResult, analyzeChangeAmplification, calculateChangeAmplificationScore };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _aiready_core from '@aiready/core';
2
- import { Issue, IssueType, ScanOptions, SpokeOutput, AnalysisResult } from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, SpokeOutput, AnalysisResult, ToolScoringOutput } from '@aiready/core';
3
3
 
4
4
  /**
5
5
  * Change Amplification Tool Provider
@@ -22,6 +22,6 @@ declare function analyzeChangeAmplification(options: ChangeAmplificationOptions)
22
22
  /**
23
23
  * Convert change amplification report into a standardized ToolScoringOutput.
24
24
  */
25
- declare function calculateChangeAmplificationScore(report: ChangeAmplificationReport): any;
25
+ declare function calculateChangeAmplificationScore(report: ChangeAmplificationReport): ToolScoringOutput;
26
26
 
27
27
  export { type ChangeAmplificationIssue, type ChangeAmplificationOptions, ChangeAmplificationProvider, type ChangeAmplificationReport, type FileChangeAmplificationResult, analyzeChangeAmplification, calculateChangeAmplificationScore };
package/dist/index.mjs CHANGED
@@ -34,7 +34,10 @@ var ChangeAmplificationProvider = createProvider({
34
34
  });
35
35
 
36
36
  // src/scoring.ts
37
- import { ToolName as ToolName2, buildStandardToolScore } from "@aiready/core";
37
+ import {
38
+ ToolName as ToolName2,
39
+ buildStandardToolScore
40
+ } from "@aiready/core";
38
41
  function calculateChangeAmplificationScore(report) {
39
42
  const { summary } = report;
40
43
  return buildStandardToolScore({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/change-amplification",
3
- "version": "0.14.6",
3
+ "version": "0.14.8",
4
4
  "description": "AI-Readiness: Change Amplification Detection",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -10,7 +10,7 @@
10
10
  "commander": "^14.0.0",
11
11
  "glob": "^13.0.0",
12
12
  "chalk": "^5.3.0",
13
- "@aiready/core": "0.24.6"
13
+ "@aiready/core": "0.24.8"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^24.0.0",
@@ -40,6 +40,8 @@
40
40
  "dev": "tsup src/index.ts src/cli.ts --format cjs,esm --watch",
41
41
  "test": "vitest run",
42
42
  "test:watch": "vitest",
43
- "lint": "eslint src --ext .ts"
43
+ "lint": "eslint src --ext .ts",
44
+ "type-check": "tsc --noEmit",
45
+ "format-check": "prettier --check . --ignore-path ../../.prettierignore"
44
46
  }
45
47
  }
package/src/analyzer.ts CHANGED
@@ -125,7 +125,7 @@ export async function analyzeChangeAmplification(
125
125
  const results: FileChangeAmplificationResult[] = [];
126
126
 
127
127
  // Helper for severity mapping
128
- const getLevel = (s: any): number => {
128
+ const getLevel = (s: Severity | string): number => {
129
129
  if (s === Severity.Critical || s === 'critical') return 4;
130
130
  if (s === Severity.Major || s === 'major') return 3;
131
131
  if (s === Severity.Minor || s === 'minor') return 2;
package/src/cli.ts CHANGED
@@ -4,12 +4,23 @@ import chalk from 'chalk';
4
4
  import * as path from 'path';
5
5
  import * as fs from 'fs';
6
6
  import { analyzeChangeAmplification } from './analyzer';
7
- import type { ChangeAmplificationOptions } from './types';
7
+ import type {
8
+ ChangeAmplificationOptions,
9
+ ChangeAmplificationReport,
10
+ FileChangeAmplificationResult,
11
+ ChangeAmplificationIssue,
12
+ } from './types';
8
13
  import { displayStandardConsoleReport } from '@aiready/core';
9
14
 
10
15
  export const changeAmplificationAction = async (
11
16
  directory: string,
12
- options: any
17
+ options: {
18
+ include?: string;
19
+ exclude?: string;
20
+ output?: string;
21
+ outputFile?: string;
22
+ [key: string]: any;
23
+ }
13
24
  ) => {
14
25
  try {
15
26
  const resolvedDir = path.resolve(process.cwd(), directory);
@@ -19,7 +30,8 @@ export const changeAmplificationAction = async (
19
30
  exclude: options.exclude ? options.exclude.split(',') : undefined,
20
31
  };
21
32
 
22
- const report = await analyzeChangeAmplification(finalOptions);
33
+ const report: ChangeAmplificationReport =
34
+ await analyzeChangeAmplification(finalOptions);
23
35
 
24
36
  if (options.output === 'json') {
25
37
  const outputPath =
@@ -40,8 +52,8 @@ export const changeAmplificationAction = async (
40
52
  { name: 'Major Issues', value: (report.summary.majorIssues ?? 0) * 5 },
41
53
  ],
42
54
 
43
- issues: report.results.flatMap((r: any) =>
44
- r.issues.map((i: any) => ({
55
+ issues: report.results.flatMap((r: FileChangeAmplificationResult) =>
56
+ r.issues.map((i: ChangeAmplificationIssue) => ({
45
57
  ...i,
46
58
  message: `[${r.fileName}] ${i.message}`,
47
59
  }))
package/src/scoring.ts CHANGED
@@ -1,4 +1,8 @@
1
- import { ToolName, buildStandardToolScore } from '@aiready/core';
1
+ import {
2
+ ToolName,
3
+ buildStandardToolScore,
4
+ type ToolScoringOutput,
5
+ } from '@aiready/core';
2
6
  import type { ChangeAmplificationReport } from './types';
3
7
 
4
8
  /**
@@ -6,7 +10,7 @@ import type { ChangeAmplificationReport } from './types';
6
10
  */
7
11
  export function calculateChangeAmplificationScore(
8
12
  report: ChangeAmplificationReport
9
- ): any {
13
+ ): ToolScoringOutput {
10
14
  const { summary } = report;
11
15
 
12
16
  return buildStandardToolScore({