@aiready/change-amplification 0.13.1 → 0.13.2
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.
- package/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-test.log +8 -54
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +17 -31
- package/dist/index.mjs +19 -32
- package/package.json +2 -2
- package/src/__tests__/provider.test.ts +1 -1
- package/src/provider.ts +20 -45
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/change-amplification@0.13.
|
|
3
|
+
> @aiready/change-amplification@0.13.2 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
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist/chunk-OBBL7HKE.mjs [22m[32m4.82 KB[39m
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m2.07 KB[39m
|
|
14
|
-
[32mESM[39m [1mdist/cli.mjs [22m[32m2.78 KB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in 152ms
|
|
16
|
-
[32mCJS[39m [1mdist/index.js [22m[32m8.30 KB[39m
|
|
17
12
|
[32mCJS[39m [1mdist/cli.js [22m[32m9.01 KB[39m
|
|
18
|
-
[32mCJS[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.91 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 203ms
|
|
15
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m2.78 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m1.70 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/chunk-OBBL7HKE.mjs [22m[32m4.82 KB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 204ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 4162ms
|
|
21
21
|
DTS dist/cli.d.ts 152.00 B
|
|
22
|
-
DTS dist/index.d.ts 1.
|
|
22
|
+
DTS dist/index.d.ts 1.32 KB
|
|
23
23
|
DTS dist/cli.d.mts 152.00 B
|
|
24
|
-
DTS dist/index.d.mts 1.
|
|
24
|
+
DTS dist/index.d.mts 1.32 KB
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,70 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/change-amplification@0.13.
|
|
3
|
+
> @aiready/change-amplification@0.13.1 test /Users/pengcao/projects/aiready/packages/change-amplification
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
7
7
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/change-amplification[39m
|
|
8
8
|
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
|
|
12
|
-
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (5)[39m
|
|
13
|
-
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
14
|
-
[2m Start at [22m17:20:12
|
|
15
|
-
[2m Duration [22m697ms
|
|
16
|
-
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
17
|
-
[1m[33m ❯ [39m[22msrc/__tests__/analyzer.test.ts[2m [queued][22m
|
|
18
|
-
[1m[33m ❯ [39m[22msrc/__tests__/cli.test.ts[2m [queued][22m
|
|
19
|
-
[1m[33m ❯ [39m[22msrc/__tests__/provider.test.ts[2m [queued][22m
|
|
20
|
-
[1m[33m ❯ [39m[22msrc/__tests__/scoring.test.ts[2m [queued][22m
|
|
21
|
-
|
|
22
|
-
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (5)[39m
|
|
23
|
-
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
24
|
-
[2m Start at [22m17:20:12
|
|
25
|
-
[2m Duration [22m839ms
|
|
26
|
-
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
27
|
-
[1m[33m ❯ [39m[22msrc/__tests__/analyzer.test.ts[2m [queued][22m
|
|
28
|
-
[1m[33m ❯ [39m[22msrc/__tests__/cli.test.ts[2m 0/2[22m
|
|
29
|
-
[1m[33m ❯ [39m[22msrc/__tests__/dummy.test.ts[2m [queued][22m
|
|
30
|
-
[1m[33m ❯ [39m[22msrc/__tests__/provider.test.ts[2m [queued][22m
|
|
31
|
-
[1m[33m ❯ [39m[22msrc/__tests__/scoring.test.ts[2m [queued][22m
|
|
32
|
-
|
|
33
|
-
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (5)[39m
|
|
34
|
-
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (2)[39m
|
|
35
|
-
[2m Start at [22m17:20:12
|
|
36
|
-
[2m Duration [22m1.25s
|
|
37
|
-
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K [32m✓[39m src/__tests__/dummy.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
38
|
-
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
39
|
-
|
|
40
|
-
[1m[33m ❯ [39m[22msrc/__tests__/analyzer.test.ts[2m [queued][22m
|
|
41
|
-
[1m[33m ❯ [39m[22msrc/__tests__/provider.test.ts[2m [queued][22m
|
|
42
|
-
[1m[33m ❯ [39m[22msrc/__tests__/scoring.test.ts[2m [queued][22m
|
|
43
|
-
|
|
44
|
-
[2m Test Files [22m[1m[32m2 passed[39m[22m[90m (5)[39m
|
|
45
|
-
[2m Tests [22m[1m[32m3 passed[39m[22m[90m (3)[39m
|
|
46
|
-
[2m Start at [22m17:20:12
|
|
47
|
-
[2m Duration [22m1.97s
|
|
48
|
-
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
49
|
-
[1m[33m ❯ [39m[22msrc/__tests__/analyzer.test.ts[2m [queued][22m
|
|
50
|
-
[1m[33m ❯ [39m[22msrc/__tests__/provider.test.ts[2m [queued][22m
|
|
51
|
-
[1m[33m ❯ [39m[22msrc/__tests__/scoring.test.ts[2m 0/2[22m
|
|
52
|
-
|
|
53
|
-
[2m Test Files [22m[1m[32m2 passed[39m[22m[90m (5)[39m
|
|
54
|
-
[2m Tests [22m[1m[32m3 passed[39m[22m[90m (5)[39m
|
|
55
|
-
[2m Start at [22m17:20:12
|
|
56
|
-
[2m Duration [22m2.18s
|
|
57
|
-
[?2026l[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K [32m✓[39m src/__tests__/scoring.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/__tests__/dummy.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 1[2mms[22m[39m
|
|
10
|
+
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
11
|
+
[32m✓[39m src/__tests__/scoring.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 55[2mms[22m[39m
|
|
58
12
|
[90mstdout[2m | src/__tests__/analyzer.test.ts[2m > [22m[2manalyzeChangeAmplification reproduction[2m > [22m[2mshould see how it gets to 0
|
|
59
13
|
[22m[39mResulting score for highly coupled: [33m27[39m
|
|
60
14
|
Rating: explosive
|
|
61
15
|
|
|
62
|
-
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
63
|
-
[32m✓[39m src/__tests__/provider.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
16
|
+
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
17
|
+
[32m✓[39m src/__tests__/provider.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
64
18
|
|
|
65
19
|
[2m Test Files [22m [1m[32m5 passed[39m[22m[90m (5)[39m
|
|
66
20
|
[2m Tests [22m [1m[32m9 passed[39m[22m[90m (9)[39m
|
|
67
|
-
[2m Start at [22m
|
|
68
|
-
[2m Duration [22m 2.
|
|
21
|
+
[2m Start at [22m 02:00:17
|
|
22
|
+
[2m Duration [22m 2.98s[2m (transform 1.32s, setup 0ms, import 6.49s, tests 71ms, environment 0ms)[22m
|
|
69
23
|
|
|
70
24
|
[?25h
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _aiready_core from '@aiready/core';
|
|
2
|
+
import { Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Change Amplification Tool Provider
|
|
5
6
|
*/
|
|
6
|
-
declare const ChangeAmplificationProvider: ToolProvider;
|
|
7
|
+
declare const ChangeAmplificationProvider: _aiready_core.ToolProvider;
|
|
7
8
|
|
|
8
9
|
type ChangeAmplificationOptions = ScanOptions;
|
|
9
10
|
interface ChangeAmplificationIssue extends Issue {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _aiready_core from '@aiready/core';
|
|
2
|
+
import { Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Change Amplification Tool Provider
|
|
5
6
|
*/
|
|
6
|
-
declare const ChangeAmplificationProvider: ToolProvider;
|
|
7
|
+
declare const ChangeAmplificationProvider: _aiready_core.ToolProvider;
|
|
7
8
|
|
|
8
9
|
type ChangeAmplificationOptions = ScanOptions;
|
|
9
10
|
interface ChangeAmplificationIssue extends Issue {
|
package/dist/index.js
CHANGED
|
@@ -170,41 +170,27 @@ async function analyzeChangeAmplification(options) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// src/provider.ts
|
|
173
|
-
var ChangeAmplificationProvider = {
|
|
173
|
+
var ChangeAmplificationProvider = (0, import_core2.createProvider)({
|
|
174
174
|
id: import_core2.ToolName.ChangeAmplification,
|
|
175
175
|
alias: ["change-amp", "change-amplification", "coupling"],
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
);
|
|
180
|
-
return import_core2.SpokeOutputSchema.parse({
|
|
181
|
-
results: report.results,
|
|
182
|
-
summary: report.summary,
|
|
183
|
-
metadata: {
|
|
184
|
-
toolName: import_core2.ToolName.ChangeAmplification,
|
|
185
|
-
version: "0.9.5",
|
|
186
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
187
|
-
}
|
|
188
|
-
});
|
|
176
|
+
version: "0.9.5",
|
|
177
|
+
defaultWeight: 8,
|
|
178
|
+
async analyzeReport(options) {
|
|
179
|
+
return analyzeChangeAmplification(options);
|
|
189
180
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return {
|
|
193
|
-
toolName: import_core2.ToolName.ChangeAmplification,
|
|
194
|
-
score: summary.score || 0,
|
|
195
|
-
rawMetrics: summary,
|
|
196
|
-
factors: [],
|
|
197
|
-
recommendations: (summary.recommendations || []).map(
|
|
198
|
-
(action) => ({
|
|
199
|
-
action,
|
|
200
|
-
estimatedImpact: 5,
|
|
201
|
-
priority: "medium"
|
|
202
|
-
})
|
|
203
|
-
)
|
|
204
|
-
};
|
|
181
|
+
getResults(report) {
|
|
182
|
+
return report.results;
|
|
205
183
|
},
|
|
206
|
-
|
|
207
|
-
|
|
184
|
+
getSummary(report) {
|
|
185
|
+
return report.summary;
|
|
186
|
+
},
|
|
187
|
+
score(output) {
|
|
188
|
+
return (0, import_core2.buildSimpleProviderScore)(
|
|
189
|
+
import_core2.ToolName.ChangeAmplification,
|
|
190
|
+
output.summary
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
208
194
|
|
|
209
195
|
// src/scoring.ts
|
|
210
196
|
var import_core3 = require("@aiready/core");
|
package/dist/index.mjs
CHANGED
|
@@ -7,44 +7,31 @@ import { ToolRegistry } from "@aiready/core";
|
|
|
7
7
|
|
|
8
8
|
// src/provider.ts
|
|
9
9
|
import {
|
|
10
|
+
createProvider,
|
|
10
11
|
ToolName,
|
|
11
|
-
|
|
12
|
+
buildSimpleProviderScore
|
|
12
13
|
} from "@aiready/core";
|
|
13
|
-
var ChangeAmplificationProvider = {
|
|
14
|
+
var ChangeAmplificationProvider = createProvider({
|
|
14
15
|
id: ToolName.ChangeAmplification,
|
|
15
16
|
alias: ["change-amp", "change-amplification", "coupling"],
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
20
|
-
return SpokeOutputSchema.parse({
|
|
21
|
-
results: report.results,
|
|
22
|
-
summary: report.summary,
|
|
23
|
-
metadata: {
|
|
24
|
-
toolName: ToolName.ChangeAmplification,
|
|
25
|
-
version: "0.9.5",
|
|
26
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
27
|
-
}
|
|
28
|
-
});
|
|
17
|
+
version: "0.9.5",
|
|
18
|
+
defaultWeight: 8,
|
|
19
|
+
async analyzeReport(options) {
|
|
20
|
+
return analyzeChangeAmplification(options);
|
|
29
21
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
toolName: ToolName.ChangeAmplification,
|
|
34
|
-
score: summary.score || 0,
|
|
35
|
-
rawMetrics: summary,
|
|
36
|
-
factors: [],
|
|
37
|
-
recommendations: (summary.recommendations || []).map(
|
|
38
|
-
(action) => ({
|
|
39
|
-
action,
|
|
40
|
-
estimatedImpact: 5,
|
|
41
|
-
priority: "medium"
|
|
42
|
-
})
|
|
43
|
-
)
|
|
44
|
-
};
|
|
22
|
+
getResults(report) {
|
|
23
|
+
return report.results;
|
|
45
24
|
},
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
getSummary(report) {
|
|
26
|
+
return report.summary;
|
|
27
|
+
},
|
|
28
|
+
score(output) {
|
|
29
|
+
return buildSimpleProviderScore(
|
|
30
|
+
ToolName.ChangeAmplification,
|
|
31
|
+
output.summary
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
48
35
|
|
|
49
36
|
// src/scoring.ts
|
|
50
37
|
import { ToolName as ToolName2 } from "@aiready/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/change-amplification",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
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.23.
|
|
13
|
+
"@aiready/core": "0.23.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "^24.0.0",
|
|
@@ -24,7 +24,7 @@ describe('Change Amplification Provider', () => {
|
|
|
24
24
|
const output = await ChangeAmplificationProvider.analyze({ rootDir: '.' });
|
|
25
25
|
|
|
26
26
|
expect(output.summary.totalFiles).toBe(1);
|
|
27
|
-
expect(output.metadata
|
|
27
|
+
expect(output.metadata!.toolName).toBe('change-amplification');
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
it('should score an output', () => {
|
package/src/provider.ts
CHANGED
|
@@ -1,58 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
createProvider,
|
|
3
3
|
ToolName,
|
|
4
|
-
SpokeOutput,
|
|
5
4
|
ScanOptions,
|
|
6
|
-
|
|
7
|
-
AnalysisResult,
|
|
8
|
-
SpokeOutputSchema,
|
|
5
|
+
buildSimpleProviderScore,
|
|
9
6
|
} from '@aiready/core';
|
|
10
7
|
import { analyzeChangeAmplification } from './analyzer';
|
|
11
|
-
import {
|
|
12
|
-
ChangeAmplificationOptions,
|
|
13
|
-
FileChangeAmplificationResult,
|
|
14
|
-
} from './types';
|
|
8
|
+
import { ChangeAmplificationOptions } from './types';
|
|
15
9
|
|
|
16
10
|
/**
|
|
17
11
|
* Change Amplification Tool Provider
|
|
18
12
|
*/
|
|
19
|
-
export const ChangeAmplificationProvider
|
|
13
|
+
export const ChangeAmplificationProvider = createProvider({
|
|
20
14
|
id: ToolName.ChangeAmplification,
|
|
21
15
|
alias: ['change-amp', 'change-amplification', 'coupling'],
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
return SpokeOutputSchema.parse({
|
|
29
|
-
results: report.results as AnalysisResult[],
|
|
30
|
-
summary: report.summary,
|
|
31
|
-
metadata: {
|
|
32
|
-
toolName: ToolName.ChangeAmplification,
|
|
33
|
-
version: '0.9.5',
|
|
34
|
-
timestamp: new Date().toISOString(),
|
|
35
|
-
},
|
|
36
|
-
});
|
|
16
|
+
version: '0.9.5',
|
|
17
|
+
defaultWeight: 8,
|
|
18
|
+
async analyzeReport(options: ScanOptions) {
|
|
19
|
+
return analyzeChangeAmplification(options as ChangeAmplificationOptions);
|
|
37
20
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const summary = output.summary as any;
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
toolName: ToolName.ChangeAmplification,
|
|
44
|
-
score: summary.score || 0,
|
|
45
|
-
rawMetrics: summary,
|
|
46
|
-
factors: [],
|
|
47
|
-
recommendations: (summary.recommendations || []).map(
|
|
48
|
-
(action: string) => ({
|
|
49
|
-
action,
|
|
50
|
-
estimatedImpact: 5,
|
|
51
|
-
priority: 'medium',
|
|
52
|
-
})
|
|
53
|
-
),
|
|
54
|
-
};
|
|
21
|
+
getResults(report) {
|
|
22
|
+
return report.results as any;
|
|
55
23
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
24
|
+
getSummary(report) {
|
|
25
|
+
return report.summary;
|
|
26
|
+
},
|
|
27
|
+
score(output) {
|
|
28
|
+
return buildSimpleProviderScore(
|
|
29
|
+
ToolName.ChangeAmplification,
|
|
30
|
+
output.summary as any
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
});
|