@angular-modernizer/adapter-mcp 0.1.1
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/LICENSE +21 -0
- package/README.md +917 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +129 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/project-analyzer.d.ts +59 -0
- package/dist/core/project-analyzer.d.ts.map +1 -0
- package/dist/core/project-analyzer.js +116 -0
- package/dist/core/project-analyzer.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-watcher.d.ts +119 -0
- package/dist/mcp-watcher.d.ts.map +1 -0
- package/dist/mcp-watcher.js +380 -0
- package/dist/mcp-watcher.js.map +1 -0
- package/dist/server/json-rpc-handler.d.ts +57 -0
- package/dist/server/json-rpc-handler.d.ts.map +1 -0
- package/dist/server/json-rpc-handler.js +222 -0
- package/dist/server/json-rpc-handler.js.map +1 -0
- package/dist/server/mcp-server.d.ts +62 -0
- package/dist/server/mcp-server.d.ts.map +1 -0
- package/dist/server/mcp-server.js +184 -0
- package/dist/server/mcp-server.js.map +1 -0
- package/dist/server/tool-registry.d.ts +73 -0
- package/dist/server/tool-registry.d.ts.map +1 -0
- package/dist/server/tool-registry.js +102 -0
- package/dist/server/tool-registry.js.map +1 -0
- package/dist/streaming/progress-store.d.ts +120 -0
- package/dist/streaming/progress-store.d.ts.map +1 -0
- package/dist/streaming/progress-store.js +238 -0
- package/dist/streaming/progress-store.js.map +1 -0
- package/dist/tools/analyze-build-impact.d.ts +127 -0
- package/dist/tools/analyze-build-impact.d.ts.map +1 -0
- package/dist/tools/analyze-build-impact.js +194 -0
- package/dist/tools/analyze-build-impact.js.map +1 -0
- package/dist/tools/analyze-core-to-shared.d.ts +163 -0
- package/dist/tools/analyze-core-to-shared.d.ts.map +1 -0
- package/dist/tools/analyze-core-to-shared.js +436 -0
- package/dist/tools/analyze-core-to-shared.js.map +1 -0
- package/dist/tools/analyze-parser-performance.d.ts +105 -0
- package/dist/tools/analyze-parser-performance.d.ts.map +1 -0
- package/dist/tools/analyze-parser-performance.js +313 -0
- package/dist/tools/analyze-parser-performance.js.map +1 -0
- package/dist/tools/analyze-project.d.ts +277 -0
- package/dist/tools/analyze-project.d.ts.map +1 -0
- package/dist/tools/analyze-project.js +946 -0
- package/dist/tools/analyze-project.js.map +1 -0
- package/dist/tools/check-incremental-compatibility.d.ts +109 -0
- package/dist/tools/check-incremental-compatibility.d.ts.map +1 -0
- package/dist/tools/check-incremental-compatibility.js +302 -0
- package/dist/tools/check-incremental-compatibility.js.map +1 -0
- package/dist/tools/collect-feedback.d.ts +117 -0
- package/dist/tools/collect-feedback.d.ts.map +1 -0
- package/dist/tools/collect-feedback.js +773 -0
- package/dist/tools/collect-feedback.js.map +1 -0
- package/dist/tools/extract-libraries.d.ts +121 -0
- package/dist/tools/extract-libraries.d.ts.map +1 -0
- package/dist/tools/extract-libraries.js +223 -0
- package/dist/tools/extract-libraries.js.map +1 -0
- package/dist/tools/find-angular-symbol.d.ts +55 -0
- package/dist/tools/find-angular-symbol.d.ts.map +1 -0
- package/dist/tools/find-angular-symbol.js +104 -0
- package/dist/tools/find-angular-symbol.js.map +1 -0
- package/dist/tools/find-usages.d.ts +65 -0
- package/dist/tools/find-usages.d.ts.map +1 -0
- package/dist/tools/find-usages.js +108 -0
- package/dist/tools/find-usages.js.map +1 -0
- package/dist/tools/get-call-graph.d.ts +61 -0
- package/dist/tools/get-call-graph.d.ts.map +1 -0
- package/dist/tools/get-call-graph.js +119 -0
- package/dist/tools/get-call-graph.js.map +1 -0
- package/dist/tools/get-operation-progress-tool.d.ts +29 -0
- package/dist/tools/get-operation-progress-tool.d.ts.map +1 -0
- package/dist/tools/get-operation-progress-tool.js +36 -0
- package/dist/tools/get-operation-progress-tool.js.map +1 -0
- package/dist/tools/get-operation-progress.d.ts +51 -0
- package/dist/tools/get-operation-progress.d.ts.map +1 -0
- package/dist/tools/get-operation-progress.js +93 -0
- package/dist/tools/get-operation-progress.js.map +1 -0
- package/dist/tools/helpers/feedback-analyzer.d.ts +43 -0
- package/dist/tools/helpers/feedback-analyzer.d.ts.map +1 -0
- package/dist/tools/helpers/feedback-analyzer.js +196 -0
- package/dist/tools/helpers/feedback-analyzer.js.map +1 -0
- package/dist/tools/helpers/find-ts-config.d.ts +10 -0
- package/dist/tools/helpers/find-ts-config.d.ts.map +1 -0
- package/dist/tools/helpers/find-ts-config.js +32 -0
- package/dist/tools/helpers/find-ts-config.js.map +1 -0
- package/dist/tools/helpers/platform-root-resolver.d.ts +33 -0
- package/dist/tools/helpers/platform-root-resolver.d.ts.map +1 -0
- package/dist/tools/helpers/platform-root-resolver.js +60 -0
- package/dist/tools/helpers/platform-root-resolver.js.map +1 -0
- package/dist/tools/helpers/rule-matcher.d.ts +84 -0
- package/dist/tools/helpers/rule-matcher.d.ts.map +1 -0
- package/dist/tools/helpers/rule-matcher.js +212 -0
- package/dist/tools/helpers/rule-matcher.js.map +1 -0
- package/dist/tools/helpers/suggestion-generator.d.ts +66 -0
- package/dist/tools/helpers/suggestion-generator.d.ts.map +1 -0
- package/dist/tools/helpers/suggestion-generator.js +248 -0
- package/dist/tools/helpers/suggestion-generator.js.map +1 -0
- package/dist/tools/learn-patterns.d.ts +368 -0
- package/dist/tools/learn-patterns.d.ts.map +1 -0
- package/dist/tools/learn-patterns.js +1089 -0
- package/dist/tools/learn-patterns.js.map +1 -0
- package/dist/tools/orchestrate-migration.d.ts +187 -0
- package/dist/tools/orchestrate-migration.d.ts.map +1 -0
- package/dist/tools/orchestrate-migration.js +235 -0
- package/dist/tools/orchestrate-migration.js.map +1 -0
- package/dist/tools/parse-stack-trace.d.ts +63 -0
- package/dist/tools/parse-stack-trace.d.ts.map +1 -0
- package/dist/tools/parse-stack-trace.js +92 -0
- package/dist/tools/parse-stack-trace.js.map +1 -0
- package/dist/tools/plan-migration.d.ts +388 -0
- package/dist/tools/plan-migration.d.ts.map +1 -0
- package/dist/tools/plan-migration.js +826 -0
- package/dist/tools/plan-migration.js.map +1 -0
- package/dist/tools/resolve-type.d.ts +54 -0
- package/dist/tools/resolve-type.d.ts.map +1 -0
- package/dist/tools/resolve-type.js +101 -0
- package/dist/tools/resolve-type.js.map +1 -0
- package/dist/tools/review-feedback.d.ts +124 -0
- package/dist/tools/review-feedback.d.ts.map +1 -0
- package/dist/tools/review-feedback.js +276 -0
- package/dist/tools/review-feedback.js.map +1 -0
- package/dist/tools/rollback-changes.d.ts +42 -0
- package/dist/tools/rollback-changes.d.ts.map +1 -0
- package/dist/tools/rollback-changes.js +95 -0
- package/dist/tools/rollback-changes.js.map +1 -0
- package/dist/tools/run-angular-cli.d.ts +102 -0
- package/dist/tools/run-angular-cli.d.ts.map +1 -0
- package/dist/tools/run-angular-cli.js +152 -0
- package/dist/tools/run-angular-cli.js.map +1 -0
- package/dist/tools/run-build.d.ts +201 -0
- package/dist/tools/run-build.d.ts.map +1 -0
- package/dist/tools/run-build.js +554 -0
- package/dist/tools/run-build.js.map +1 -0
- package/dist/tools/run-schematic.d.ts +173 -0
- package/dist/tools/run-schematic.d.ts.map +1 -0
- package/dist/tools/run-schematic.js +410 -0
- package/dist/tools/run-schematic.js.map +1 -0
- package/dist/tools/scan-all.d.ts +160 -0
- package/dist/tools/scan-all.d.ts.map +1 -0
- package/dist/tools/scan-all.js +486 -0
- package/dist/tools/scan-all.js.map +1 -0
- package/dist/tools/scan-angular.d.ts +132 -0
- package/dist/tools/scan-angular.d.ts.map +1 -0
- package/dist/tools/scan-angular.js +411 -0
- package/dist/tools/scan-angular.js.map +1 -0
- package/dist/tools/scan-architecture.d.ts +351 -0
- package/dist/tools/scan-architecture.d.ts.map +1 -0
- package/dist/tools/scan-architecture.js +1290 -0
- package/dist/tools/scan-architecture.js.map +1 -0
- package/dist/tools/scan-solid.d.ts +132 -0
- package/dist/tools/scan-solid.d.ts.map +1 -0
- package/dist/tools/scan-solid.js +435 -0
- package/dist/tools/scan-solid.js.map +1 -0
- package/dist/tools/search-codebase.d.ts +64 -0
- package/dist/tools/search-codebase.d.ts.map +1 -0
- package/dist/tools/search-codebase.js +109 -0
- package/dist/tools/search-codebase.js.map +1 -0
- package/dist/tools/shared/scan-types.d.ts +200 -0
- package/dist/tools/shared/scan-types.d.ts.map +1 -0
- package/dist/tools/shared/scan-types.js +7 -0
- package/dist/tools/shared/scan-types.js.map +1 -0
- package/dist/tools/suggest-improvements.d.ts +96 -0
- package/dist/tools/suggest-improvements.d.ts.map +1 -0
- package/dist/tools/suggest-improvements.js +182 -0
- package/dist/tools/suggest-improvements.js.map +1 -0
- package/dist/tools/transform-code-batch.d.ts +57 -0
- package/dist/tools/transform-code-batch.d.ts.map +1 -0
- package/dist/tools/transform-code-batch.js +107 -0
- package/dist/tools/transform-code-batch.js.map +1 -0
- package/dist/tools/transform-code.d.ts +352 -0
- package/dist/tools/transform-code.d.ts.map +1 -0
- package/dist/tools/transform-code.js +1171 -0
- package/dist/tools/transform-code.js.map +1 -0
- package/dist/tools/validate-before-transform.d.ts +54 -0
- package/dist/tools/validate-before-transform.d.ts.map +1 -0
- package/dist/tools/validate-before-transform.js +141 -0
- package/dist/tools/validate-before-transform.js.map +1 -0
- package/dist/tools/validate-project-compatibility.d.ts +119 -0
- package/dist/tools/validate-project-compatibility.d.ts.map +1 -0
- package/dist/tools/validate-project-compatibility.js +243 -0
- package/dist/tools/validate-project-compatibility.js.map +1 -0
- package/dist/tools/validate-transformation.d.ts +105 -0
- package/dist/tools/validate-transformation.d.ts.map +1 -0
- package/dist/tools/validate-transformation.js +391 -0
- package/dist/tools/validate-transformation.js.map +1 -0
- package/dist/types.d.ts +153 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +38 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/format-tool-response.d.ts +72 -0
- package/dist/utils/format-tool-response.d.ts.map +1 -0
- package/dist/utils/format-tool-response.js +149 -0
- package/dist/utils/format-tool-response.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @angular-modernizer/adapter-mcp - Analyze Core-to-Shared Tool
|
|
3
|
+
*
|
|
4
|
+
* MCP tool for analyzing core-to-shared dependency violations with impact assessment.
|
|
5
|
+
* Detects when core layer imports from shared layer and provides detailed refactoring guidance.
|
|
6
|
+
*/
|
|
7
|
+
import type { MCPTool } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Result from the analyze-core-to-shared tool.
|
|
10
|
+
*/
|
|
11
|
+
interface AnalyzeCoreToSharedResult {
|
|
12
|
+
/**
|
|
13
|
+
* Core-to-shared violations found.
|
|
14
|
+
*/
|
|
15
|
+
violations: {
|
|
16
|
+
id: string;
|
|
17
|
+
filePath: string;
|
|
18
|
+
line: number;
|
|
19
|
+
importedModule: string;
|
|
20
|
+
importedItem: string;
|
|
21
|
+
severity: 'error' | 'warning';
|
|
22
|
+
message: string;
|
|
23
|
+
impactAssessment?: {
|
|
24
|
+
breakingChangeRisk: 'LOW' | 'MEDIUM' | 'HIGH';
|
|
25
|
+
riskFactors: string[];
|
|
26
|
+
reverseDependencies: {
|
|
27
|
+
file: string;
|
|
28
|
+
imports: string[];
|
|
29
|
+
}[];
|
|
30
|
+
transitiveDependencies: string[];
|
|
31
|
+
};
|
|
32
|
+
suggestedFix: string;
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Summary statistics.
|
|
37
|
+
*/
|
|
38
|
+
summary: {
|
|
39
|
+
totalViolations: number;
|
|
40
|
+
analyzedFiles: number;
|
|
41
|
+
bySeverity: Record<string, number>;
|
|
42
|
+
affectedCoreFiles: number;
|
|
43
|
+
uniqueSharedModules: number;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Analysis metadata.
|
|
47
|
+
*/
|
|
48
|
+
metadata: {
|
|
49
|
+
duration: number;
|
|
50
|
+
projectRoot: string;
|
|
51
|
+
impactAssessmentEnabled: boolean;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Analyze Core-to-Shared Tool
|
|
56
|
+
*
|
|
57
|
+
* Provides core-to-shared dependency analysis with impact assessment through MCP.
|
|
58
|
+
* Detects architectural violations where core layer imports from shared layer.
|
|
59
|
+
*/
|
|
60
|
+
export declare class AnalyzeCoreToSharedTool implements MCPTool {
|
|
61
|
+
readonly name = "analyze-core-to-shared";
|
|
62
|
+
readonly description = "Analyze core-to-shared dependency violations with impact assessment";
|
|
63
|
+
readonly inputSchema: {
|
|
64
|
+
type: string;
|
|
65
|
+
properties: {
|
|
66
|
+
rootPath: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
includeImpactAssessment: {
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
default: boolean;
|
|
74
|
+
};
|
|
75
|
+
maxFiles: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
default: number;
|
|
79
|
+
};
|
|
80
|
+
orchestration: {
|
|
81
|
+
type: string;
|
|
82
|
+
description: string;
|
|
83
|
+
properties: {
|
|
84
|
+
enableProgress: {
|
|
85
|
+
type: string;
|
|
86
|
+
description: string;
|
|
87
|
+
default: boolean;
|
|
88
|
+
};
|
|
89
|
+
maxWorkers: {
|
|
90
|
+
type: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
resourceLimits: {
|
|
94
|
+
type: string;
|
|
95
|
+
description: string;
|
|
96
|
+
properties: {
|
|
97
|
+
maxMemoryMB: {
|
|
98
|
+
type: string;
|
|
99
|
+
description: string;
|
|
100
|
+
};
|
|
101
|
+
maxWorkers: {
|
|
102
|
+
type: string;
|
|
103
|
+
description: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
required: string[];
|
|
111
|
+
};
|
|
112
|
+
execute(args: Record<string, unknown>): Promise<AnalyzeCoreToSharedResult>;
|
|
113
|
+
/**
|
|
114
|
+
* Find files to analyze based on patterns.
|
|
115
|
+
*/
|
|
116
|
+
private findFilesToAnalyze;
|
|
117
|
+
/**
|
|
118
|
+
* Analyze a single file for core-to-shared violations.
|
|
119
|
+
*/
|
|
120
|
+
private analyzeFileForCoreToSharedViolations;
|
|
121
|
+
/**
|
|
122
|
+
* Check if a module specifier represents a shared module import.
|
|
123
|
+
*/
|
|
124
|
+
private isSharedModuleImport;
|
|
125
|
+
/**
|
|
126
|
+
* Extract imported items from an import declaration.
|
|
127
|
+
*/
|
|
128
|
+
private extractImportedItems;
|
|
129
|
+
/**
|
|
130
|
+
* Create a violation object with impact assessment.
|
|
131
|
+
*/
|
|
132
|
+
private createViolation;
|
|
133
|
+
/**
|
|
134
|
+
* Assess the impact of a core-to-shared violation.
|
|
135
|
+
*/
|
|
136
|
+
private assessImpact;
|
|
137
|
+
/**
|
|
138
|
+
* Find files that depend on the given core file.
|
|
139
|
+
*/
|
|
140
|
+
private findReverseDependencies;
|
|
141
|
+
/**
|
|
142
|
+
* Find transitive dependencies of the core file.
|
|
143
|
+
*/
|
|
144
|
+
private findTransitiveDependencies;
|
|
145
|
+
/**
|
|
146
|
+
* Assess breaking change impact based on reverse dependencies.
|
|
147
|
+
*/
|
|
148
|
+
private assessBreakingChangeImpact;
|
|
149
|
+
/**
|
|
150
|
+
* Determine severity based on impact assessment.
|
|
151
|
+
*/
|
|
152
|
+
private determineSeverity;
|
|
153
|
+
/**
|
|
154
|
+
* Calculate summary statistics from violations.
|
|
155
|
+
*/
|
|
156
|
+
private calculateSummary;
|
|
157
|
+
/**
|
|
158
|
+
* Escape special regex characters.
|
|
159
|
+
*/
|
|
160
|
+
private escapeRegExp;
|
|
161
|
+
}
|
|
162
|
+
export {};
|
|
163
|
+
//# sourceMappingURL=analyze-core-to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AO,CAAC;KAClC,CAAC;CACH;AAED;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,OAAO;IACrD,QAAQ,CAAC,IAAI,4BAA4B;IACzC,QAAQ,CAAC,WAAW,yEACoD;IACxE,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkDlB;IAEI,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,yBAAyB,CAAC;IAoFrC;;OAEG;YACW,kBAAkB;IA2ChC;;OAEG;YACW,oCAAoC;IAmClD;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiB5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiC5B;;OAEG;YACW,eAAe;IAuC7B;;OAEG;YACW,YAAY;IAsB1B;;OAEG;YACW,uBAAuB;IA6ErC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAgClC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAyBlC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;OAEG;IACH,OAAO,CAAC,YAAY;CAGrB"}
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @angular-modernizer/adapter-mcp - Analyze Core-to-Shared Tool
|
|
3
|
+
*
|
|
4
|
+
* MCP tool for analyzing core-to-shared dependency violations with impact assessment.
|
|
5
|
+
* Detects when core layer imports from shared layer and provides detailed refactoring guidance.
|
|
6
|
+
*/
|
|
7
|
+
import { findTsConfig } from './helpers/find-ts-config.js';
|
|
8
|
+
import { Kernel } from '@angular-modernizer/core';
|
|
9
|
+
import { glob } from 'glob';
|
|
10
|
+
import { resolve, extname, relative, dirname } from 'node:path';
|
|
11
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
12
|
+
/**
|
|
13
|
+
* Analyze Core-to-Shared Tool
|
|
14
|
+
*
|
|
15
|
+
* Provides core-to-shared dependency analysis with impact assessment through MCP.
|
|
16
|
+
* Detects architectural violations where core layer imports from shared layer.
|
|
17
|
+
*/
|
|
18
|
+
export class AnalyzeCoreToSharedTool {
|
|
19
|
+
name = 'analyze-core-to-shared';
|
|
20
|
+
description = 'Analyze core-to-shared dependency violations with impact assessment';
|
|
21
|
+
inputSchema = {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
rootPath: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Root path of the project to analyze',
|
|
27
|
+
},
|
|
28
|
+
includeImpactAssessment: {
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
description: 'Whether to include impact assessment (reverse dependencies, breaking change risk)',
|
|
31
|
+
default: true,
|
|
32
|
+
},
|
|
33
|
+
maxFiles: {
|
|
34
|
+
type: 'number',
|
|
35
|
+
description: 'Maximum number of files to analyze (for performance)',
|
|
36
|
+
default: 1000,
|
|
37
|
+
},
|
|
38
|
+
orchestration: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
description: 'Orchestration options (subset for core-to-shared analysis)',
|
|
41
|
+
properties: {
|
|
42
|
+
enableProgress: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
description: 'Enable real-time progress reporting',
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
maxWorkers: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: 'Maximum parallel workers for impact assessment',
|
|
50
|
+
},
|
|
51
|
+
resourceLimits: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
description: 'Resource limits for large codebase analysis',
|
|
54
|
+
properties: {
|
|
55
|
+
maxMemoryMB: {
|
|
56
|
+
type: 'number',
|
|
57
|
+
description: 'Maximum memory usage in MB',
|
|
58
|
+
},
|
|
59
|
+
maxWorkers: {
|
|
60
|
+
type: 'number',
|
|
61
|
+
description: 'Maximum concurrent workers',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
required: ['rootPath'],
|
|
69
|
+
};
|
|
70
|
+
async execute(args) {
|
|
71
|
+
const params = args;
|
|
72
|
+
// Validate input
|
|
73
|
+
if (!params.rootPath || typeof params.rootPath !== 'string') {
|
|
74
|
+
throw new Error('rootPath is required and must be a string');
|
|
75
|
+
}
|
|
76
|
+
const startTime = Date.now();
|
|
77
|
+
const includeImpactAssessment = params.includeImpactAssessment ?? true;
|
|
78
|
+
try {
|
|
79
|
+
// Find TypeScript config file
|
|
80
|
+
const tsConfigPath = findTsConfig(params.rootPath);
|
|
81
|
+
if (!tsConfigPath) {
|
|
82
|
+
throw new Error('Could not find tsconfig.json in the project root');
|
|
83
|
+
}
|
|
84
|
+
// Initialize kernel with caching enabled
|
|
85
|
+
const kernel = new Kernel({
|
|
86
|
+
tsConfigPath,
|
|
87
|
+
cacheConfig: {
|
|
88
|
+
enabled: true,
|
|
89
|
+
cacheDir: resolve(params.rootPath, '.angular-modernizer-cache'),
|
|
90
|
+
maxSize: 100 * 1024 * 1024, // 100MB
|
|
91
|
+
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
|
92
|
+
compression: true,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
await kernel.initialize();
|
|
96
|
+
// Find files to analyze
|
|
97
|
+
const maxFiles = params.maxFiles ?? 1000;
|
|
98
|
+
const filesToAnalyze = await this.findFilesToAnalyze(params.rootPath, maxFiles);
|
|
99
|
+
// Analyze files for core-to-shared violations
|
|
100
|
+
const violations = [];
|
|
101
|
+
const project = kernel.getProject();
|
|
102
|
+
for (const filePath of filesToAnalyze) {
|
|
103
|
+
try {
|
|
104
|
+
const sourceFile = project.addSourceFileAtPath(filePath);
|
|
105
|
+
const fileViolations = await this.analyzeFileForCoreToSharedViolations(sourceFile, params.rootPath, includeImpactAssessment);
|
|
106
|
+
violations.push(...fileViolations);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
// Log error but continue with other files
|
|
110
|
+
console.warn(`Error analyzing ${filePath}:`, error);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Calculate summary
|
|
114
|
+
const summary = this.calculateSummary(violations);
|
|
115
|
+
const duration = Date.now() - startTime;
|
|
116
|
+
const result = {
|
|
117
|
+
violations,
|
|
118
|
+
summary: {
|
|
119
|
+
...summary,
|
|
120
|
+
analyzedFiles: filesToAnalyze.length,
|
|
121
|
+
},
|
|
122
|
+
metadata: {
|
|
123
|
+
duration,
|
|
124
|
+
projectRoot: params.rootPath,
|
|
125
|
+
impactAssessmentEnabled: includeImpactAssessment,
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
throw new Error(`Core-to-shared analysis failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Find files to analyze based on patterns.
|
|
136
|
+
*/
|
|
137
|
+
async findFilesToAnalyze(rootPath, maxFiles) {
|
|
138
|
+
const includePatterns = ['src/app/core/**/*.ts', 'src/app/core/**/*.tsx'];
|
|
139
|
+
const allFiles = [];
|
|
140
|
+
for (const pattern of includePatterns) {
|
|
141
|
+
const files = await glob(pattern, {
|
|
142
|
+
cwd: rootPath,
|
|
143
|
+
absolute: true,
|
|
144
|
+
ignore: [
|
|
145
|
+
'**/node_modules/**',
|
|
146
|
+
'**/dist/**',
|
|
147
|
+
'**/*.spec.ts',
|
|
148
|
+
'**/*.test.ts',
|
|
149
|
+
],
|
|
150
|
+
});
|
|
151
|
+
allFiles.push(...files);
|
|
152
|
+
}
|
|
153
|
+
// Remove duplicates and limit
|
|
154
|
+
const uniqueFiles = [...new Set(allFiles)].slice(0, maxFiles);
|
|
155
|
+
// Filter to only TypeScript files and ensure they are actual files
|
|
156
|
+
return uniqueFiles.filter((file) => {
|
|
157
|
+
const isTsFile = ['.ts', '.tsx'].includes(extname(file));
|
|
158
|
+
if (!isTsFile) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
const stats = statSync(file);
|
|
163
|
+
return stats.isFile();
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
// If we can't stat the file, skip it
|
|
167
|
+
console.warn(`Cannot access file ${file}:`, error);
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Analyze a single file for core-to-shared violations.
|
|
174
|
+
*/
|
|
175
|
+
async analyzeFileForCoreToSharedViolations(sourceFile, rootPath, includeImpactAssessment) {
|
|
176
|
+
const violations = [];
|
|
177
|
+
const filePath = sourceFile.getFilePath();
|
|
178
|
+
// Analyze all imports
|
|
179
|
+
const imports = sourceFile.getImportDeclarations();
|
|
180
|
+
for (const importDecl of imports) {
|
|
181
|
+
const moduleSpecifier = importDecl.getModuleSpecifierValue();
|
|
182
|
+
// Check if this is a shared module import
|
|
183
|
+
if (this.isSharedModuleImport(moduleSpecifier)) {
|
|
184
|
+
const importedItems = this.extractImportedItems(importDecl);
|
|
185
|
+
for (const importedItem of importedItems) {
|
|
186
|
+
const violation = await this.createViolation(filePath, importDecl.getStartLineNumber(), moduleSpecifier, importedItem, rootPath, includeImpactAssessment);
|
|
187
|
+
violations.push(violation);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return violations;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Check if a module specifier represents a shared module import.
|
|
195
|
+
*/
|
|
196
|
+
isSharedModuleImport(moduleSpecifier) {
|
|
197
|
+
// Check for @shared/* patterns
|
|
198
|
+
if (moduleSpecifier.startsWith('@shared/')) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
// Check for relative imports to shared directories
|
|
202
|
+
if (moduleSpecifier.includes('/shared/') ||
|
|
203
|
+
moduleSpecifier.includes('../shared/')) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Extract imported items from an import declaration.
|
|
210
|
+
*/
|
|
211
|
+
extractImportedItems(importDecl) {
|
|
212
|
+
const importedItems = [];
|
|
213
|
+
// Handle named imports
|
|
214
|
+
const namedImports = importDecl.getNamedImports();
|
|
215
|
+
for (const namedImport of namedImports) {
|
|
216
|
+
importedItems.push({
|
|
217
|
+
name: namedImport.getName(),
|
|
218
|
+
alias: namedImport.getAliasNode()?.getText(),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
// Handle default imports
|
|
222
|
+
const defaultImport = importDecl.getDefaultImport();
|
|
223
|
+
if (defaultImport) {
|
|
224
|
+
importedItems.push({
|
|
225
|
+
name: defaultImport.getText(),
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
// Handle namespace imports
|
|
229
|
+
const namespaceImport = importDecl.getNamespaceImport();
|
|
230
|
+
if (namespaceImport) {
|
|
231
|
+
importedItems.push({
|
|
232
|
+
name: `* as ${namespaceImport.getText()}`,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return importedItems;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Create a violation object with impact assessment.
|
|
239
|
+
*/
|
|
240
|
+
async createViolation(filePath, line, importedModule, importedItem, rootPath, includeImpactAssessment) {
|
|
241
|
+
const violationId = `${filePath}:${line}:${importedModule}:${importedItem.name}`;
|
|
242
|
+
let impactAssessment;
|
|
243
|
+
if (includeImpactAssessment) {
|
|
244
|
+
impactAssessment = await this.assessImpact(filePath, rootPath);
|
|
245
|
+
}
|
|
246
|
+
const severity = this.determineSeverity(impactAssessment);
|
|
247
|
+
return {
|
|
248
|
+
id: violationId,
|
|
249
|
+
filePath,
|
|
250
|
+
line,
|
|
251
|
+
importedModule,
|
|
252
|
+
importedItem: importedItem.alias
|
|
253
|
+
? `${importedItem.name} as ${importedItem.alias}`
|
|
254
|
+
: importedItem.name,
|
|
255
|
+
severity,
|
|
256
|
+
message: `Core layer importing from shared layer: ${importedItem.name} from ${importedModule}`,
|
|
257
|
+
impactAssessment,
|
|
258
|
+
suggestedFix: 'Replace direct import with interface-based dependency injection. Create interfaces in core layer and implement in shared layer.',
|
|
259
|
+
metadata: {
|
|
260
|
+
violationType: 'core-to-shared-import',
|
|
261
|
+
importedItemName: importedItem.name,
|
|
262
|
+
importedItemAlias: importedItem.alias,
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Assess the impact of a core-to-shared violation.
|
|
268
|
+
*/
|
|
269
|
+
async assessImpact(coreFilePath, rootPath) {
|
|
270
|
+
const reverseDeps = await this.findReverseDependencies(coreFilePath, rootPath);
|
|
271
|
+
const transitiveDeps = this.findTransitiveDependencies(coreFilePath, rootPath);
|
|
272
|
+
const impact = this.assessBreakingChangeImpact(reverseDeps);
|
|
273
|
+
return {
|
|
274
|
+
breakingChangeRisk: impact.risk,
|
|
275
|
+
riskFactors: impact.reasons,
|
|
276
|
+
reverseDependencies: reverseDeps,
|
|
277
|
+
transitiveDependencies: transitiveDeps,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Find files that depend on the given core file.
|
|
282
|
+
*/
|
|
283
|
+
async findReverseDependencies(coreFilePath, rootPath) {
|
|
284
|
+
const reverseDeps = [];
|
|
285
|
+
const srcPath = resolve(rootPath, 'src');
|
|
286
|
+
try {
|
|
287
|
+
// Find all TypeScript files in the project
|
|
288
|
+
const allFiles = await glob('**/*.{ts,tsx}', {
|
|
289
|
+
cwd: srcPath,
|
|
290
|
+
absolute: true,
|
|
291
|
+
ignore: [
|
|
292
|
+
'**/node_modules/**',
|
|
293
|
+
'**/dist/**',
|
|
294
|
+
'**/*.spec.ts',
|
|
295
|
+
'**/*.test.ts',
|
|
296
|
+
],
|
|
297
|
+
});
|
|
298
|
+
for (const filePath of allFiles) {
|
|
299
|
+
try {
|
|
300
|
+
const content = readFileSync(filePath, 'utf8');
|
|
301
|
+
const relativeCorePath = relative(dirname(filePath), coreFilePath);
|
|
302
|
+
// Check for imports of the core file
|
|
303
|
+
const importPatterns = [
|
|
304
|
+
new RegExp(`import.*from.*['"]${this.escapeRegExp(relativeCorePath.replaceAll('\\', '/'))}['"]`, 'g'),
|
|
305
|
+
new RegExp(String.raw `import.*from.*['"]\./${this.escapeRegExp(relative(dirname(coreFilePath), filePath).replaceAll('\\', '/'))}['"]`, 'g'),
|
|
306
|
+
];
|
|
307
|
+
let hasImport = false;
|
|
308
|
+
const imports = [];
|
|
309
|
+
for (const pattern of importPatterns) {
|
|
310
|
+
if (pattern.test(content)) {
|
|
311
|
+
hasImport = true;
|
|
312
|
+
// Extract imported items
|
|
313
|
+
const importRegex = /import\s+{([^}]+)}\s+from/g;
|
|
314
|
+
let importMatch;
|
|
315
|
+
while ((importMatch = importRegex.exec(content)) !== null) {
|
|
316
|
+
const importStr = importMatch[1];
|
|
317
|
+
if (importStr != null) {
|
|
318
|
+
const parsedImports = importStr
|
|
319
|
+
.split(',')
|
|
320
|
+
.map((s) => s.trim().split(' as ')[0])
|
|
321
|
+
.filter((s) => s && s.length > 0);
|
|
322
|
+
imports.push(...parsedImports);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (hasImport) {
|
|
329
|
+
reverseDeps.push({
|
|
330
|
+
file: relative(srcPath, filePath),
|
|
331
|
+
imports: [...new Set(imports)], // Remove duplicates
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
catch (_error) {
|
|
336
|
+
// Skip files that can't be read
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
catch (error) {
|
|
341
|
+
console.warn('Error finding reverse dependencies:', error);
|
|
342
|
+
}
|
|
343
|
+
return reverseDeps;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Find transitive dependencies of the core file.
|
|
347
|
+
*/
|
|
348
|
+
findTransitiveDependencies(coreFilePath, _rootPath) {
|
|
349
|
+
const transitiveDeps = new Set();
|
|
350
|
+
try {
|
|
351
|
+
const content = readFileSync(coreFilePath, 'utf8');
|
|
352
|
+
// Find all imports in the core file
|
|
353
|
+
const importRegex = /import\s+.*\s+from\s+['"]([^'"]+)['"]/g;
|
|
354
|
+
let match;
|
|
355
|
+
while ((match = importRegex.exec(content)) !== null) {
|
|
356
|
+
const modulePath = match[1];
|
|
357
|
+
// Only include non-relative, non-Angular imports as transitive dependencies
|
|
358
|
+
if (modulePath &&
|
|
359
|
+
!modulePath.startsWith('.') &&
|
|
360
|
+
!modulePath.startsWith('@angular') &&
|
|
361
|
+
!modulePath.startsWith('@shared')) {
|
|
362
|
+
transitiveDeps.add(modulePath);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
catch (_error) {
|
|
367
|
+
console.warn('Error finding transitive dependencies:', _error);
|
|
368
|
+
}
|
|
369
|
+
return Array.from(transitiveDeps);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Assess breaking change impact based on reverse dependencies.
|
|
373
|
+
*/
|
|
374
|
+
assessBreakingChangeImpact(reverseDeps) {
|
|
375
|
+
let risk = 'LOW';
|
|
376
|
+
const reasons = [];
|
|
377
|
+
if (reverseDeps.length > 10) {
|
|
378
|
+
risk = 'HIGH';
|
|
379
|
+
reasons.push('High reverse dependency count');
|
|
380
|
+
}
|
|
381
|
+
else if (reverseDeps.length > 5) {
|
|
382
|
+
risk = 'MEDIUM';
|
|
383
|
+
reasons.push('Moderate reverse dependency count');
|
|
384
|
+
}
|
|
385
|
+
// Check for test files
|
|
386
|
+
const testFiles = reverseDeps.filter((dep) => dep.file.includes('.spec.ts') || dep.file.includes('.test.ts'));
|
|
387
|
+
if (testFiles.length > 0) {
|
|
388
|
+
reasons.push('Test files depend on this - ensure test coverage');
|
|
389
|
+
}
|
|
390
|
+
return { risk, reasons };
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Determine severity based on impact assessment.
|
|
394
|
+
*/
|
|
395
|
+
determineSeverity(impactAssessment) {
|
|
396
|
+
if (!impactAssessment) {
|
|
397
|
+
return 'error';
|
|
398
|
+
}
|
|
399
|
+
switch (impactAssessment.breakingChangeRisk) {
|
|
400
|
+
case 'HIGH':
|
|
401
|
+
return 'error';
|
|
402
|
+
case 'MEDIUM':
|
|
403
|
+
return 'warning';
|
|
404
|
+
case 'LOW':
|
|
405
|
+
default:
|
|
406
|
+
return 'warning';
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Calculate summary statistics from violations.
|
|
411
|
+
*/
|
|
412
|
+
calculateSummary(violations) {
|
|
413
|
+
const bySeverity = {};
|
|
414
|
+
const affectedFiles = new Set();
|
|
415
|
+
const sharedModules = new Set();
|
|
416
|
+
for (const violation of violations) {
|
|
417
|
+
bySeverity[violation.severity] =
|
|
418
|
+
(bySeverity[violation.severity] ?? 0) + 1;
|
|
419
|
+
affectedFiles.add(violation.filePath);
|
|
420
|
+
sharedModules.add(violation.importedModule);
|
|
421
|
+
}
|
|
422
|
+
return {
|
|
423
|
+
totalViolations: violations.length,
|
|
424
|
+
bySeverity,
|
|
425
|
+
affectedCoreFiles: affectedFiles.size,
|
|
426
|
+
uniqueSharedModules: sharedModules.size,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Escape special regex characters.
|
|
431
|
+
*/
|
|
432
|
+
escapeRegExp(string) {
|
|
433
|
+
return string.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
//# sourceMappingURL=analyze-core-to-shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-core-to-shared.js","sourceRoot":"","sources":["../../src/tools/analyze-core-to-shared.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