@aiready/change-amplification 0.14.7 → 0.14.9

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.7 build /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.14.9 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
@@ -9,16 +9,16 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
+ CJS dist/cli.js 8.51 KB
13
+ CJS dist/index.js 7.74 KB
14
+ CJS ⚡️ Build success in 107ms
12
15
  ESM dist/chunk-SPXGOPNW.mjs 4.83 KB
13
- ESM dist/cli.mjs 2.41 KB
14
16
  ESM dist/index.mjs 1.53 KB
15
- ESM ⚡️ Build success in 122ms
16
- CJS dist/index.js 7.74 KB
17
- CJS dist/cli.js 8.51 KB
18
- CJS ⚡️ Build success in 124ms
17
+ ESM dist/cli.mjs 2.41 KB
18
+ ESM ⚡️ Build success in 126ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 11254ms
21
- DTS dist/cli.d.ts 152.00 B
22
- DTS dist/index.d.ts 1.12 KB
23
- DTS dist/cli.d.mts 152.00 B
24
- DTS dist/index.d.mts 1.12 KB
20
+ DTS ⚡️ Build success in 1314ms
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.9 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.9 lint /Users/pengcao/projects/aiready/packages/change-amplification
4
+ > eslint src --ext .ts
5
+
@@ -1,24 +1,24 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.14.6 test /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.14.8 test /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/change-amplification
8
8
 
9
- ✓ src/__tests__/dummy.test.ts (1 test) 1ms
9
+ ✓ src/__tests__/dummy.test.ts (1 test) 4ms
10
+ ✓ src/__tests__/cli.test.ts (2 tests) 2ms
10
11
  stdout | src/__tests__/analyzer.test.ts > analyzeChangeAmplification reproduction > should see how it gets to 0
11
12
  Resulting score for highly coupled: 27
12
13
  Rating: explosive
13
14
 
14
- ✓ src/__tests__/analyzer.test.ts (2 tests) 5ms
15
15
  ✓ src/__tests__/scoring.test.ts (2 tests) 2ms
16
- ✓ src/__tests__/cli.test.ts (2 tests) 9ms
17
- ✓ src/__tests__/provider.test.ts (2 tests) 4ms
16
+ ✓ src/__tests__/analyzer.test.ts (2 tests) 3ms
17
+ ✓ src/__tests__/provider.test.ts (2 tests) 6ms
18
18
 
19
19
   Test Files  5 passed (5)
20
20
   Tests  9 passed (9)
21
-  Start at  22:04:34
22
-  Duration  1.42s (transform 1.17s, setup 0ms, import 4.50s, tests 23ms, environment 0ms)
21
+  Start at  00:14:10
22
+  Duration  1.40s (transform 1.04s, setup 0ms, import 3.63s, tests 18ms, environment 0ms)
23
23
 
24
24
  [?25h
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > @aiready/change-amplification@0.14.9 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.7",
3
+ "version": "0.14.9",
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.7"
13
+ "@aiready/core": "0.24.9"
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({