@angular-modernizer/adapter-mcp 0.3.0 → 1.1.0
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/README.md +181 -282
- package/dist/cli.js +21 -13
- package/dist/core/project-analyzer.d.ts +3 -12
- package/dist/core/project-analyzer.js +3 -12
- package/dist/index.d.ts +122 -6
- package/dist/index.js +49 -5
- package/dist/mcp-watcher.d.ts +32 -7
- package/dist/mcp-watcher.js +16 -15
- package/dist/scan-host/scan-host.d.ts +119 -0
- package/dist/scan-host/scan-host.js +376 -0
- package/dist/scan-host/scan-protocol.d.ts +35 -0
- package/dist/scan-host/scan-protocol.js +6 -0
- package/dist/scan-host/scan-worker.d.ts +14 -0
- package/dist/scan-host/scan-worker.js +48 -0
- package/dist/server/limited-stdio-transport.d.ts +75 -0
- package/dist/server/limited-stdio-transport.js +115 -0
- package/dist/server/mcp-server.d.ts +20 -18
- package/dist/server/mcp-server.js +42 -79
- package/dist/server/package-version.d.ts +16 -0
- package/dist/server/package-version.js +37 -0
- package/dist/server/sdk-server.d.ts +71 -0
- package/dist/server/sdk-server.js +113 -0
- package/dist/server/tool-registry.d.ts +6 -9
- package/dist/server/tool-registry.js +6 -12
- package/dist/streaming/progress-store.d.ts +22 -5
- package/dist/streaming/progress-store.js +9 -5
- package/dist/tools/analyze-build-impact.d.ts +276 -35
- package/dist/tools/analyze-build-impact.js +175 -28
- package/dist/tools/analyze-core-to-shared.d.ts +176 -16
- package/dist/tools/analyze-core-to-shared.js +124 -19
- package/dist/tools/analyze-parser-performance.d.ts +209 -15
- package/dist/tools/analyze-parser-performance.js +119 -56
- package/dist/tools/analyze-project.d.ts +349 -17
- package/dist/tools/analyze-project.js +282 -97
- package/dist/tools/check-incremental-compatibility.d.ts +74 -12
- package/dist/tools/check-incremental-compatibility.js +69 -10
- package/dist/tools/collect-feedback.d.ts +225 -21
- package/dist/tools/collect-feedback.js +199 -118
- package/dist/tools/compare-health.d.ts +413 -0
- package/dist/tools/compare-health.js +479 -0
- package/dist/tools/extract-libraries.d.ts +200 -24
- package/dist/tools/extract-libraries.js +131 -27
- package/dist/tools/find-angular-symbol.d.ts +92 -24
- package/dist/tools/find-angular-symbol.js +70 -20
- package/dist/tools/find-component-hosts.d.ts +603 -27
- package/dist/tools/find-component-hosts.js +223 -19
- package/dist/tools/find-usages.d.ts +102 -22
- package/dist/tools/find-usages.js +81 -21
- package/dist/tools/get-bootstrap-execution.d.ts +183 -25
- package/dist/tools/get-bootstrap-execution.js +109 -25
- package/dist/tools/get-call-graph.d.ts +127 -12
- package/dist/tools/get-call-graph.js +84 -19
- package/dist/tools/get-operation-progress-tool.d.ts +126 -8
- package/dist/tools/get-operation-progress-tool.js +124 -12
- package/dist/tools/get-operation-progress.d.ts +27 -1
- package/dist/tools/get-operation-progress.js +5 -5
- package/dist/tools/helpers/analysis-output.d.ts +182 -0
- package/dist/tools/helpers/analysis-output.js +165 -0
- package/dist/tools/helpers/batch-kernel.d.ts +14 -0
- package/dist/tools/helpers/batch-kernel.js +12 -0
- package/dist/tools/helpers/build-schemas.d.ts +36 -0
- package/dist/tools/helpers/build-schemas.js +23 -0
- package/dist/tools/helpers/citation-file-source.d.ts +10 -0
- package/dist/tools/helpers/citation-file-source.js +82 -0
- package/dist/tools/helpers/compact-output.d.ts +2 -1
- package/dist/tools/helpers/compact-output.js +2 -1
- package/dist/tools/helpers/finding-window.d.ts +43 -0
- package/dist/tools/helpers/finding-window.js +64 -0
- package/dist/tools/helpers/health-delta.d.ts +99 -0
- package/dist/tools/helpers/health-delta.js +236 -0
- package/dist/tools/helpers/investigation-schemas.d.ts +93 -0
- package/dist/tools/helpers/investigation-schemas.js +48 -0
- package/dist/tools/helpers/library-imports.d.ts +57 -0
- package/dist/tools/helpers/library-imports.js +151 -0
- package/dist/tools/helpers/load-source-files.d.ts +30 -0
- package/dist/tools/helpers/load-source-files.js +34 -0
- package/dist/tools/helpers/output-contract.d.ts +32 -0
- package/dist/tools/helpers/output-contract.js +32 -0
- package/dist/tools/helpers/platform-root-resolver.d.ts +55 -25
- package/dist/tools/helpers/platform-root-resolver.js +75 -48
- package/dist/tools/helpers/process-output.d.ts +19 -0
- package/dist/tools/helpers/process-output.js +31 -0
- package/dist/tools/helpers/project-cache.d.ts +60 -37
- package/dist/tools/helpers/project-cache.js +54 -37
- package/dist/tools/helpers/project-decorators.d.ts +14 -0
- package/dist/tools/helpers/project-decorators.js +22 -0
- package/dist/tools/helpers/rule-matcher.js +5 -0
- package/dist/tools/helpers/rule-runner.d.ts +25 -13
- package/dist/tools/helpers/rule-runner.js +45 -24
- package/dist/tools/helpers/scan-cache.d.ts +22 -0
- package/dist/tools/helpers/scan-cache.js +34 -0
- package/dist/tools/helpers/scan-engine.d.ts +107 -0
- package/dist/tools/helpers/scan-engine.js +197 -0
- package/dist/tools/helpers/scan-plan.d.ts +5 -2
- package/dist/tools/helpers/scan-plan.js +18 -3
- package/dist/tools/helpers/scope-paths.d.ts +17 -0
- package/dist/tools/helpers/scope-paths.js +32 -0
- package/dist/tools/helpers/suggestion-generator.d.ts +9 -13
- package/dist/tools/helpers/suggestion-generator.js +0 -12
- package/dist/tools/helpers/tool-cache.d.ts +11 -0
- package/dist/tools/helpers/tool-cache.js +15 -0
- package/dist/tools/helpers/tool-context.d.ts +63 -0
- package/dist/tools/helpers/tool-context.js +79 -0
- package/dist/tools/helpers/transform-safety.d.ts +40 -0
- package/dist/tools/helpers/transform-safety.js +87 -0
- package/dist/tools/helpers/validation-output.d.ts +53 -0
- package/dist/tools/helpers/validation-output.js +48 -0
- package/dist/tools/inspect-form-group.d.ts +262 -24
- package/dist/tools/inspect-form-group.js +134 -13
- package/dist/tools/inspect-i18n.d.ts +410 -23
- package/dist/tools/inspect-i18n.js +213 -13
- package/dist/tools/inspect-template.d.ts +260 -22
- package/dist/tools/inspect-template.js +174 -13
- package/dist/tools/learn-patterns.d.ts +210 -13
- package/dist/tools/learn-patterns.js +113 -12
- package/dist/tools/list-imports.d.ts +152 -34
- package/dist/tools/list-imports.js +124 -18
- package/dist/tools/orchestrate-migration.d.ts +159 -14
- package/dist/tools/orchestrate-migration.js +147 -20
- package/dist/tools/parse-stack-trace.d.ts +78 -21
- package/dist/tools/parse-stack-trace.js +44 -7
- package/dist/tools/plan-migration.d.ts +395 -26
- package/dist/tools/plan-migration.js +173 -22
- package/dist/tools/resolve-type.d.ts +57 -9
- package/dist/tools/resolve-type.js +49 -12
- package/dist/tools/review-feedback.d.ts +214 -16
- package/dist/tools/review-feedback.js +142 -57
- package/dist/tools/rollback-changes.d.ts +88 -7
- package/dist/tools/rollback-changes.js +74 -19
- package/dist/tools/run-angular-cli.d.ts +57 -12
- package/dist/tools/run-angular-cli.js +76 -13
- package/dist/tools/run-build.d.ts +127 -13
- package/dist/tools/run-build.js +128 -16
- package/dist/tools/run-schematic.d.ts +82 -12
- package/dist/tools/run-schematic.js +115 -18
- package/dist/tools/scan-all.d.ts +88 -23
- package/dist/tools/scan-all.js +161 -220
- package/dist/tools/scan-angular.d.ts +60 -19
- package/dist/tools/scan-angular.js +100 -141
- package/dist/tools/scan-architecture.d.ts +92 -24
- package/dist/tools/scan-architecture.js +268 -211
- package/dist/tools/scan-solid.d.ts +59 -19
- package/dist/tools/scan-solid.js +98 -139
- package/dist/tools/search-codebase.d.ts +110 -23
- package/dist/tools/search-codebase.js +67 -11
- package/dist/tools/server-status.d.ts +392 -26
- package/dist/tools/server-status.js +260 -27
- package/dist/tools/suggest-improvements.d.ts +105 -10
- package/dist/tools/suggest-improvements.js +91 -51
- package/dist/tools/trace-output-flow.d.ts +713 -26
- package/dist/tools/trace-output-flow.js +396 -33
- package/dist/tools/transform-code-batch.d.ts +3 -0
- package/dist/tools/transform-code-batch.js +10 -5
- package/dist/tools/transform-code.d.ts +402 -18
- package/dist/tools/transform-code.js +708 -649
- package/dist/tools/validate-before-transform.d.ts +136 -7
- package/dist/tools/validate-before-transform.js +65 -9
- package/dist/tools/validate-project-compatibility.d.ts +82 -15
- package/dist/tools/validate-project-compatibility.js +84 -15
- package/dist/tools/validate-transformation.d.ts +243 -8
- package/dist/tools/validate-transformation.js +127 -23
- package/dist/tools/verify-citations.d.ts +202 -0
- package/dist/tools/verify-citations.js +221 -0
- package/dist/types.d.ts +78 -11
- package/dist/types.js +0 -5
- package/dist/utils/format-tool-response.d.ts +22 -59
- package/dist/utils/format-tool-response.js +25 -134
- package/package.json +31 -20
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/core/project-analyzer.d.ts.map +0 -1
- package/dist/core/project-analyzer.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp-watcher.d.ts.map +0 -1
- package/dist/mcp-watcher.js.map +0 -1
- package/dist/server/json-rpc-handler.d.ts +0 -98
- package/dist/server/json-rpc-handler.d.ts.map +0 -1
- package/dist/server/json-rpc-handler.js +0 -301
- package/dist/server/json-rpc-handler.js.map +0 -1
- package/dist/server/mcp-server.d.ts.map +0 -1
- package/dist/server/mcp-server.js.map +0 -1
- package/dist/server/stdio-guard.d.ts.map +0 -1
- package/dist/server/stdio-guard.js.map +0 -1
- package/dist/server/tool-registry.d.ts.map +0 -1
- package/dist/server/tool-registry.js.map +0 -1
- package/dist/streaming/progress-store.d.ts.map +0 -1
- package/dist/streaming/progress-store.js.map +0 -1
- package/dist/tools/analyze-build-impact.d.ts.map +0 -1
- package/dist/tools/analyze-build-impact.js.map +0 -1
- package/dist/tools/analyze-core-to-shared.d.ts.map +0 -1
- package/dist/tools/analyze-core-to-shared.js.map +0 -1
- package/dist/tools/analyze-parser-performance.d.ts.map +0 -1
- package/dist/tools/analyze-parser-performance.js.map +0 -1
- package/dist/tools/analyze-project.d.ts.map +0 -1
- package/dist/tools/analyze-project.js.map +0 -1
- package/dist/tools/check-incremental-compatibility.d.ts.map +0 -1
- package/dist/tools/check-incremental-compatibility.js.map +0 -1
- package/dist/tools/collect-feedback.d.ts.map +0 -1
- package/dist/tools/collect-feedback.js.map +0 -1
- package/dist/tools/extract-libraries.d.ts.map +0 -1
- package/dist/tools/extract-libraries.js.map +0 -1
- package/dist/tools/find-angular-symbol.d.ts.map +0 -1
- package/dist/tools/find-angular-symbol.js.map +0 -1
- package/dist/tools/find-component-hosts.d.ts.map +0 -1
- package/dist/tools/find-component-hosts.js.map +0 -1
- package/dist/tools/find-usages.d.ts.map +0 -1
- package/dist/tools/find-usages.js.map +0 -1
- package/dist/tools/get-bootstrap-execution.d.ts.map +0 -1
- package/dist/tools/get-bootstrap-execution.js.map +0 -1
- package/dist/tools/get-call-graph.d.ts.map +0 -1
- package/dist/tools/get-call-graph.js.map +0 -1
- package/dist/tools/get-operation-progress-tool.d.ts.map +0 -1
- package/dist/tools/get-operation-progress-tool.js.map +0 -1
- package/dist/tools/get-operation-progress.d.ts.map +0 -1
- package/dist/tools/get-operation-progress.js.map +0 -1
- package/dist/tools/helpers/compact-output.d.ts.map +0 -1
- package/dist/tools/helpers/compact-output.js.map +0 -1
- package/dist/tools/helpers/feedback-analyzer.d.ts.map +0 -1
- package/dist/tools/helpers/feedback-analyzer.js.map +0 -1
- package/dist/tools/helpers/find-ts-config.d.ts.map +0 -1
- package/dist/tools/helpers/find-ts-config.js.map +0 -1
- package/dist/tools/helpers/platform-root-resolver.d.ts.map +0 -1
- package/dist/tools/helpers/platform-root-resolver.js.map +0 -1
- package/dist/tools/helpers/project-cache.d.ts.map +0 -1
- package/dist/tools/helpers/project-cache.js.map +0 -1
- package/dist/tools/helpers/rule-matcher.d.ts.map +0 -1
- package/dist/tools/helpers/rule-matcher.js.map +0 -1
- package/dist/tools/helpers/rule-runner.d.ts.map +0 -1
- package/dist/tools/helpers/rule-runner.js.map +0 -1
- package/dist/tools/helpers/scan-plan.d.ts.map +0 -1
- package/dist/tools/helpers/scan-plan.js.map +0 -1
- package/dist/tools/helpers/stack-frame-file-index.d.ts.map +0 -1
- package/dist/tools/helpers/stack-frame-file-index.js.map +0 -1
- package/dist/tools/helpers/suggestion-generator.d.ts.map +0 -1
- package/dist/tools/helpers/suggestion-generator.js.map +0 -1
- package/dist/tools/inspect-form-group.d.ts.map +0 -1
- package/dist/tools/inspect-form-group.js.map +0 -1
- package/dist/tools/inspect-i18n.d.ts.map +0 -1
- package/dist/tools/inspect-i18n.js.map +0 -1
- package/dist/tools/inspect-template.d.ts.map +0 -1
- package/dist/tools/inspect-template.js.map +0 -1
- package/dist/tools/learn-patterns.d.ts.map +0 -1
- package/dist/tools/learn-patterns.js.map +0 -1
- package/dist/tools/list-imports.d.ts.map +0 -1
- package/dist/tools/list-imports.js.map +0 -1
- package/dist/tools/orchestrate-migration.d.ts.map +0 -1
- package/dist/tools/orchestrate-migration.js.map +0 -1
- package/dist/tools/parse-stack-trace.d.ts.map +0 -1
- package/dist/tools/parse-stack-trace.js.map +0 -1
- package/dist/tools/plan-migration.d.ts.map +0 -1
- package/dist/tools/plan-migration.js.map +0 -1
- package/dist/tools/resolve-type.d.ts.map +0 -1
- package/dist/tools/resolve-type.js.map +0 -1
- package/dist/tools/review-feedback.d.ts.map +0 -1
- package/dist/tools/review-feedback.js.map +0 -1
- package/dist/tools/rollback-changes.d.ts.map +0 -1
- package/dist/tools/rollback-changes.js.map +0 -1
- package/dist/tools/run-angular-cli.d.ts.map +0 -1
- package/dist/tools/run-angular-cli.js.map +0 -1
- package/dist/tools/run-build.d.ts.map +0 -1
- package/dist/tools/run-build.js.map +0 -1
- package/dist/tools/run-schematic.d.ts.map +0 -1
- package/dist/tools/run-schematic.js.map +0 -1
- package/dist/tools/scan-all.d.ts.map +0 -1
- package/dist/tools/scan-all.js.map +0 -1
- package/dist/tools/scan-angular.d.ts.map +0 -1
- package/dist/tools/scan-angular.js.map +0 -1
- package/dist/tools/scan-architecture.d.ts.map +0 -1
- package/dist/tools/scan-architecture.js.map +0 -1
- package/dist/tools/scan-solid.d.ts.map +0 -1
- package/dist/tools/scan-solid.js.map +0 -1
- package/dist/tools/search-codebase.d.ts.map +0 -1
- package/dist/tools/search-codebase.js.map +0 -1
- package/dist/tools/server-status.d.ts.map +0 -1
- package/dist/tools/server-status.js.map +0 -1
- package/dist/tools/shared/scan-types.d.ts +0 -200
- package/dist/tools/shared/scan-types.d.ts.map +0 -1
- package/dist/tools/shared/scan-types.js +0 -7
- package/dist/tools/shared/scan-types.js.map +0 -1
- package/dist/tools/suggest-improvements.d.ts.map +0 -1
- package/dist/tools/suggest-improvements.js.map +0 -1
- package/dist/tools/trace-output-flow.d.ts.map +0 -1
- package/dist/tools/trace-output-flow.js.map +0 -1
- package/dist/tools/transform-code-batch.d.ts.map +0 -1
- package/dist/tools/transform-code-batch.js.map +0 -1
- package/dist/tools/transform-code.d.ts.map +0 -1
- package/dist/tools/transform-code.js.map +0 -1
- package/dist/tools/validate-before-transform.d.ts.map +0 -1
- package/dist/tools/validate-before-transform.js.map +0 -1
- package/dist/tools/validate-project-compatibility.d.ts.map +0 -1
- package/dist/tools/validate-project-compatibility.js.map +0 -1
- package/dist/tools/validate-transformation.d.ts.map +0 -1
- package/dist/tools/validate-transformation.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/format-tool-response.d.ts.map +0 -1
- package/dist/utils/format-tool-response.js.map +0 -1
|
@@ -1,40 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Analyze Build Impact Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for analyzing build impact before transformations.
|
|
5
|
-
* Estimates affected files, modules, build time, and provides AI-friendly recommendations.
|
|
6
|
-
* Uses IncrementalAnalyzer.getBuildScope() with the target files as the changed
|
|
7
|
-
* set. The underlying DependencyGraphBuilder follows `export ... from`,
|
|
8
|
-
* resolves tsconfig path aliases, splits value vs type-only dependents and
|
|
9
|
-
* does not let barrels inflate the radius. Optional `symbols` restrict the
|
|
10
|
-
* impact to consumers of specific exported symbols.
|
|
11
|
-
*
|
|
12
|
-
* External templates (`.html`) are not part of the TypeScript program; they
|
|
13
|
-
* are mapped to the component files that own them (`templateUrl`, then same
|
|
14
|
-
* basename) instead of failing. Such a component is recompiled, but its
|
|
15
|
-
* dependents are not counted, because a template edit does not change the
|
|
16
|
-
* component's TypeScript API. Files that cannot be mapped are listed in
|
|
17
|
-
* `unresolvedFiles`. `summaryOnly` and `maxResults` shorten the file lists;
|
|
18
|
-
* counts always describe the full result.
|
|
19
|
-
*
|
|
20
|
-
* Host components that use a changed component, directive or pipe only in
|
|
21
|
-
* their template (NgModule declarations, no import of the class) are listed
|
|
22
|
-
* as `templateDependentFiles` and, with the used classes, in `templateHosts`.
|
|
23
|
-
* They are recompiled and template type-checked; their own dependents are not
|
|
24
|
-
* counted.
|
|
25
|
-
*/
|
|
26
|
-
import { type MCPTool } from '../types.js';
|
|
1
|
+
import { type MCPTool, type ToolAnnotations } from '../types.js';
|
|
27
2
|
import { type BuildScopeSymbolImpact } from '@angular-modernizer/core';
|
|
28
3
|
import { type TemplateEdge } from '@angular-modernizer/api';
|
|
29
4
|
import { type ProjectCache } from './helpers/project-cache.js';
|
|
30
5
|
/**
|
|
31
6
|
* Build scope strategy
|
|
32
7
|
*/
|
|
33
|
-
type BuildScopeStrategy = 'affected-only' | 'partial' | 'full';
|
|
8
|
+
export type BuildScopeStrategy = 'affected-only' | 'partial' | 'full';
|
|
34
9
|
/**
|
|
35
10
|
* Estimated build scope information
|
|
36
11
|
*/
|
|
37
|
-
interface EstimatedBuildScope {
|
|
12
|
+
export interface EstimatedBuildScope {
|
|
38
13
|
/**
|
|
39
14
|
* Recommended build strategy based on impact
|
|
40
15
|
*/
|
|
@@ -79,7 +54,7 @@ interface EstimatedBuildScope {
|
|
|
79
54
|
/**
|
|
80
55
|
* Dependency information for a file
|
|
81
56
|
*/
|
|
82
|
-
interface DependencyInfo {
|
|
57
|
+
export interface DependencyInfo {
|
|
83
58
|
/**
|
|
84
59
|
* File path
|
|
85
60
|
*/
|
|
@@ -112,49 +87,67 @@ interface DependencyInfo {
|
|
|
112
87
|
/**
|
|
113
88
|
* Sizes of the full result, independent of `summaryOnly` / `maxResults`.
|
|
114
89
|
*/
|
|
115
|
-
interface BuildImpactCounts {
|
|
90
|
+
export interface BuildImpactCounts {
|
|
91
|
+
/** Requested files that resolved to the TypeScript program. */
|
|
116
92
|
changedFiles: number;
|
|
93
|
+
/** Files that depend on the changed files. */
|
|
117
94
|
dependentFiles: number;
|
|
95
|
+
/** Dependents that need a JavaScript rebuild. */
|
|
118
96
|
valueDependentFiles: number;
|
|
97
|
+
/** Dependents that import types only (type-check, no rebuild). */
|
|
119
98
|
typeOnlyDependentFiles: number;
|
|
99
|
+
/** Host components that use a changed class only in their template. */
|
|
120
100
|
templateDependentFiles: number;
|
|
101
|
+
/** Barrel files that only re-export changed code. */
|
|
121
102
|
reExportFiles: number;
|
|
103
|
+
/** Changed files plus dependents. */
|
|
122
104
|
affectedFiles: number;
|
|
105
|
+
/** Affected NgModules. */
|
|
123
106
|
affectedModules: number;
|
|
124
107
|
}
|
|
125
108
|
/**
|
|
126
109
|
* A host component that uses changed classes in its template only.
|
|
127
110
|
*/
|
|
128
|
-
interface TemplateHost {
|
|
111
|
+
export interface TemplateHost {
|
|
129
112
|
/** Host component file. */
|
|
130
113
|
file: string;
|
|
114
|
+
/** Host component class. */
|
|
131
115
|
component: string;
|
|
116
|
+
/** Changed classes the host's template uses. */
|
|
132
117
|
uses: {
|
|
118
|
+
/** Class used by the template. */
|
|
133
119
|
className: string;
|
|
120
|
+
/** How the template uses the class. */
|
|
134
121
|
via: TemplateEdge['via'];
|
|
122
|
+
/** Source file declaring the used class. */
|
|
135
123
|
file: string;
|
|
124
|
+
/** Template file of the first use (`.html`, or the `.ts` file for inline templates). */
|
|
136
125
|
templateFile: string;
|
|
137
126
|
}[];
|
|
138
127
|
}
|
|
139
128
|
/**
|
|
140
129
|
* A requested non-TypeScript file mapped to the component files that own it.
|
|
141
130
|
*/
|
|
142
|
-
interface MappedFile {
|
|
131
|
+
export interface MappedFile {
|
|
132
|
+
/** Requested file, e.g. an `.html` template. */
|
|
143
133
|
file: string;
|
|
134
|
+
/** Component files that own it. */
|
|
144
135
|
mappedTo: string[];
|
|
145
136
|
}
|
|
146
137
|
/**
|
|
147
138
|
* A requested file that could not be placed in the TypeScript program.
|
|
148
139
|
*/
|
|
149
|
-
interface UnresolvedFile {
|
|
140
|
+
export interface UnresolvedFile {
|
|
141
|
+
/** Requested file. */
|
|
150
142
|
file: string;
|
|
143
|
+
/** Why it could not be analyzed. */
|
|
151
144
|
reason: string;
|
|
152
145
|
}
|
|
153
146
|
/**
|
|
154
147
|
* Output result of build impact analysis. `recommendation` comes first so it
|
|
155
148
|
* is the first thing a reader of the JSON sees.
|
|
156
149
|
*/
|
|
157
|
-
interface AnalyzeBuildImpactOutput {
|
|
150
|
+
export interface AnalyzeBuildImpactOutput {
|
|
158
151
|
/**
|
|
159
152
|
* AI-friendly recommendation
|
|
160
153
|
*/
|
|
@@ -204,9 +197,39 @@ interface AnalyzeBuildImpactOutput {
|
|
|
204
197
|
* capped by `maxResults`)
|
|
205
198
|
*/
|
|
206
199
|
templateHosts?: TemplateHost[];
|
|
200
|
+
/**
|
|
201
|
+
* Human-readable summary for LLM consumption: the recommendation and the counts
|
|
202
|
+
*/
|
|
203
|
+
summary: string;
|
|
204
|
+
/**
|
|
205
|
+
* Conditions that can make the result incomplete (unresolved library imports)
|
|
206
|
+
*/
|
|
207
|
+
warnings?: string[];
|
|
207
208
|
}
|
|
208
209
|
/**
|
|
209
210
|
* MCP tool for analyzing build impact before transformations.
|
|
211
|
+
* Estimates affected files, modules, build time, and gives a recommendation.
|
|
212
|
+
*
|
|
213
|
+
* @remarks
|
|
214
|
+
* Uses `IncrementalAnalyzer.getBuildScope()` with the target files as the
|
|
215
|
+
* changed set. The underlying `DependencyGraphBuilder` follows
|
|
216
|
+
* `export ... from`, resolves tsconfig path aliases, splits value vs type-only
|
|
217
|
+
* dependents and does not let barrels inflate the radius. Optional `symbols`
|
|
218
|
+
* restrict the impact to consumers of specific exported symbols.
|
|
219
|
+
*
|
|
220
|
+
* External templates (`.html`) are not part of the TypeScript program; they
|
|
221
|
+
* are mapped to the component files that own them (`templateUrl`, then same
|
|
222
|
+
* basename) instead of failing. Such a component is recompiled, but its
|
|
223
|
+
* dependents are not counted, because a template edit does not change the
|
|
224
|
+
* component's TypeScript API. Files that cannot be mapped are listed in
|
|
225
|
+
* `unresolvedFiles`. `summaryOnly` and `maxResults` shorten the file lists;
|
|
226
|
+
* counts always describe the full result.
|
|
227
|
+
*
|
|
228
|
+
* Host components that use a changed component, directive or pipe only in
|
|
229
|
+
* their template (NgModule declarations, no import of the class) are listed
|
|
230
|
+
* as `templateDependentFiles` and, with the used classes, in `templateHosts`.
|
|
231
|
+
* They are recompiled and template type-checked; their own dependents are not
|
|
232
|
+
* counted.
|
|
210
233
|
*/
|
|
211
234
|
export declare class AnalyzeBuildImpactTool implements MCPTool {
|
|
212
235
|
private readonly projects?;
|
|
@@ -216,9 +239,16 @@ export declare class AnalyzeBuildImpactTool implements MCPTool {
|
|
|
216
239
|
*/
|
|
217
240
|
constructor(projects?: ProjectCache | undefined);
|
|
218
241
|
name: string;
|
|
242
|
+
title: string;
|
|
243
|
+
annotations: ToolAnnotations;
|
|
219
244
|
description: string;
|
|
245
|
+
/**
|
|
246
|
+
* JSON Schema of the tool arguments.
|
|
247
|
+
* @hidden
|
|
248
|
+
*/
|
|
220
249
|
inputSchema: {
|
|
221
250
|
type: string;
|
|
251
|
+
additionalProperties: boolean;
|
|
222
252
|
properties: {
|
|
223
253
|
summaryOnly: {
|
|
224
254
|
readonly type: "boolean";
|
|
@@ -250,6 +280,218 @@ export declare class AnalyzeBuildImpactTool implements MCPTool {
|
|
|
250
280
|
};
|
|
251
281
|
required: string[];
|
|
252
282
|
};
|
|
283
|
+
/**
|
|
284
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
285
|
+
* @hidden
|
|
286
|
+
*/
|
|
287
|
+
outputSchema: {
|
|
288
|
+
type: string;
|
|
289
|
+
properties: {
|
|
290
|
+
warnings: {
|
|
291
|
+
readonly type: "array";
|
|
292
|
+
readonly items: {
|
|
293
|
+
readonly type: "string";
|
|
294
|
+
};
|
|
295
|
+
readonly description: "Conditions that can make the result incomplete, e.g. library imports that do not resolve because node_modules is missing.";
|
|
296
|
+
};
|
|
297
|
+
recommendation: {
|
|
298
|
+
type: string;
|
|
299
|
+
};
|
|
300
|
+
counts: {
|
|
301
|
+
type: string;
|
|
302
|
+
properties: {
|
|
303
|
+
[k: string]: {
|
|
304
|
+
type: string;
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
required: ("changedFiles" | "dependentFiles" | "valueDependentFiles" | "typeOnlyDependentFiles" | "templateDependentFiles" | "reExportFiles" | "affectedFiles" | "affectedModules")[];
|
|
308
|
+
};
|
|
309
|
+
truncated: {
|
|
310
|
+
type: string;
|
|
311
|
+
};
|
|
312
|
+
estimatedBuildScope: {
|
|
313
|
+
type: string;
|
|
314
|
+
properties: {
|
|
315
|
+
strategy: {
|
|
316
|
+
type: string;
|
|
317
|
+
};
|
|
318
|
+
changedFiles: {
|
|
319
|
+
readonly type: "array";
|
|
320
|
+
readonly items: {
|
|
321
|
+
readonly type: "string";
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
dependentFiles: {
|
|
325
|
+
readonly type: "array";
|
|
326
|
+
readonly items: {
|
|
327
|
+
readonly type: "string";
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
affectedModules: {
|
|
331
|
+
readonly type: "array";
|
|
332
|
+
readonly items: {
|
|
333
|
+
readonly type: "string";
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
estimatedBuildTime: {
|
|
337
|
+
type: string;
|
|
338
|
+
};
|
|
339
|
+
valueDependentFiles: {
|
|
340
|
+
readonly type: "array";
|
|
341
|
+
readonly items: {
|
|
342
|
+
readonly type: "string";
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
typeOnlyDependentFiles: {
|
|
346
|
+
readonly type: "array";
|
|
347
|
+
readonly items: {
|
|
348
|
+
readonly type: "string";
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
reExportFiles: {
|
|
352
|
+
readonly type: "array";
|
|
353
|
+
readonly items: {
|
|
354
|
+
readonly type: "string";
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
templateDependentFiles: {
|
|
358
|
+
readonly type: "array";
|
|
359
|
+
readonly items: {
|
|
360
|
+
readonly type: "string";
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
changeSource: {
|
|
364
|
+
type: string;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
required: string[];
|
|
368
|
+
};
|
|
369
|
+
affectedFiles: {
|
|
370
|
+
readonly type: "array";
|
|
371
|
+
readonly items: {
|
|
372
|
+
readonly type: "string";
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
affectedModules: {
|
|
376
|
+
readonly type: "array";
|
|
377
|
+
readonly items: {
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
estimatedBuildTime: {
|
|
382
|
+
type: string;
|
|
383
|
+
};
|
|
384
|
+
mappedFiles: {
|
|
385
|
+
type: string;
|
|
386
|
+
items: {
|
|
387
|
+
type: string;
|
|
388
|
+
properties: {
|
|
389
|
+
file: {
|
|
390
|
+
type: string;
|
|
391
|
+
};
|
|
392
|
+
mappedTo: {
|
|
393
|
+
readonly type: "array";
|
|
394
|
+
readonly items: {
|
|
395
|
+
readonly type: "string";
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
required: string[];
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
unresolvedFiles: {
|
|
403
|
+
type: string;
|
|
404
|
+
items: {
|
|
405
|
+
type: string;
|
|
406
|
+
properties: {
|
|
407
|
+
file: {
|
|
408
|
+
type: string;
|
|
409
|
+
};
|
|
410
|
+
reason: {
|
|
411
|
+
type: string;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
required: string[];
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
dependencies: {
|
|
418
|
+
type: string;
|
|
419
|
+
items: {
|
|
420
|
+
type: string;
|
|
421
|
+
properties: {
|
|
422
|
+
file: {
|
|
423
|
+
type: string;
|
|
424
|
+
};
|
|
425
|
+
dependents: {
|
|
426
|
+
type: string;
|
|
427
|
+
};
|
|
428
|
+
valueDependents: {
|
|
429
|
+
type: string;
|
|
430
|
+
};
|
|
431
|
+
typeOnlyDependents: {
|
|
432
|
+
type: string;
|
|
433
|
+
};
|
|
434
|
+
templateDependents: {
|
|
435
|
+
type: string;
|
|
436
|
+
};
|
|
437
|
+
isPublicApi: {
|
|
438
|
+
type: string;
|
|
439
|
+
};
|
|
440
|
+
affectedModule: {
|
|
441
|
+
type: string;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
required: string[];
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
symbolImpacts: {
|
|
448
|
+
type: string;
|
|
449
|
+
items: {
|
|
450
|
+
type: string;
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
templateHosts: {
|
|
454
|
+
type: string;
|
|
455
|
+
items: {
|
|
456
|
+
type: string;
|
|
457
|
+
properties: {
|
|
458
|
+
file: {
|
|
459
|
+
type: string;
|
|
460
|
+
};
|
|
461
|
+
component: {
|
|
462
|
+
type: string;
|
|
463
|
+
};
|
|
464
|
+
uses: {
|
|
465
|
+
type: string;
|
|
466
|
+
items: {
|
|
467
|
+
type: string;
|
|
468
|
+
properties: {
|
|
469
|
+
className: {
|
|
470
|
+
type: string;
|
|
471
|
+
};
|
|
472
|
+
via: {
|
|
473
|
+
type: string;
|
|
474
|
+
};
|
|
475
|
+
file: {
|
|
476
|
+
type: string;
|
|
477
|
+
};
|
|
478
|
+
templateFile: {
|
|
479
|
+
type: string;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
required: string[];
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
required: string[];
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
summary: {
|
|
490
|
+
type: string;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
required: string[];
|
|
494
|
+
};
|
|
253
495
|
execute(args: Record<string, unknown>): Promise<AnalyzeBuildImpactOutput>;
|
|
254
496
|
/**
|
|
255
497
|
* Splits the requested files into files of the TypeScript program, `.html`
|
|
@@ -280,5 +522,4 @@ export declare class AnalyzeBuildImpactTool implements MCPTool {
|
|
|
280
522
|
*/
|
|
281
523
|
private getComponentClass;
|
|
282
524
|
}
|
|
283
|
-
export {};
|
|
284
525
|
//# sourceMappingURL=analyze-build-impact.d.ts.map
|
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Analyze Build Impact Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for analyzing build impact before transformations.
|
|
5
|
-
* Estimates affected files, modules, build time, and provides AI-friendly recommendations.
|
|
6
|
-
* Uses IncrementalAnalyzer.getBuildScope() with the target files as the changed
|
|
7
|
-
* set. The underlying DependencyGraphBuilder follows `export ... from`,
|
|
8
|
-
* resolves tsconfig path aliases, splits value vs type-only dependents and
|
|
9
|
-
* does not let barrels inflate the radius. Optional `symbols` restrict the
|
|
10
|
-
* impact to consumers of specific exported symbols.
|
|
11
|
-
*
|
|
12
|
-
* External templates (`.html`) are not part of the TypeScript program; they
|
|
13
|
-
* are mapped to the component files that own them (`templateUrl`, then same
|
|
14
|
-
* basename) instead of failing. Such a component is recompiled, but its
|
|
15
|
-
* dependents are not counted, because a template edit does not change the
|
|
16
|
-
* component's TypeScript API. Files that cannot be mapped are listed in
|
|
17
|
-
* `unresolvedFiles`. `summaryOnly` and `maxResults` shorten the file lists;
|
|
18
|
-
* counts always describe the full result.
|
|
19
|
-
*
|
|
20
|
-
* Host components that use a changed component, directive or pipe only in
|
|
21
|
-
* their template (NgModule declarations, no import of the class) are listed
|
|
22
|
-
* as `templateDependentFiles` and, with the used classes, in `templateHosts`.
|
|
23
|
-
* They are recompiled and template type-checked; their own dependents are not
|
|
24
|
-
* counted.
|
|
25
|
-
*/
|
|
26
1
|
import { Project } from 'ts-morph';
|
|
27
2
|
import { IncrementalAnalyzer, } from '@angular-modernizer/core';
|
|
28
3
|
import { findTemplateOwnerFiles, } from '@angular-modernizer/api';
|
|
29
4
|
import { existsSync } from 'node:fs';
|
|
30
5
|
import { join } from 'node:path';
|
|
31
6
|
import { findTsConfig } from './helpers/find-ts-config.js';
|
|
7
|
+
import { STRING_ARRAY } from './helpers/investigation-schemas.js';
|
|
8
|
+
import { WARNINGS_OUTPUT_SCHEMA, withWarnings } from './helpers/output-contract.js';
|
|
32
9
|
import { COMPACT_OUTPUT_SCHEMA, limitList, parseCompactOptions, } from './helpers/compact-output.js';
|
|
10
|
+
const BUILD_IMPACT_COUNT_KEYS = [
|
|
11
|
+
'changedFiles',
|
|
12
|
+
'dependentFiles',
|
|
13
|
+
'valueDependentFiles',
|
|
14
|
+
'typeOnlyDependentFiles',
|
|
15
|
+
'templateDependentFiles',
|
|
16
|
+
'reExportFiles',
|
|
17
|
+
'affectedFiles',
|
|
18
|
+
'affectedModules',
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Text summary: the recommendation, then the counts and what the lists hold.
|
|
22
|
+
*/
|
|
23
|
+
function describeBuildImpact(result, strategy, summaryOnly) {
|
|
24
|
+
const c = result.counts;
|
|
25
|
+
const lines = [
|
|
26
|
+
result.recommendation,
|
|
27
|
+
`${c.changedFiles} changed, ${c.dependentFiles} dependent file(s) (${c.valueDependentFiles} value, ` +
|
|
28
|
+
`${c.typeOnlyDependentFiles} type-only, ${c.templateDependentFiles} template host(s)), ` +
|
|
29
|
+
`${c.reExportFiles} re-export(s), ${c.affectedModules} module(s); strategy ${strategy}, ` +
|
|
30
|
+
`about ${result.estimatedBuildTime} s build.`,
|
|
31
|
+
];
|
|
32
|
+
if (summaryOnly) {
|
|
33
|
+
lines.push('File lists omitted (summaryOnly).');
|
|
34
|
+
}
|
|
35
|
+
else if (result.truncated) {
|
|
36
|
+
lines.push('File lists capped at maxResults; counts cover everything.');
|
|
37
|
+
}
|
|
38
|
+
return lines.join('\n');
|
|
39
|
+
}
|
|
33
40
|
/** Groups template edges by host component file. */
|
|
34
41
|
function toTemplateHosts(edges) {
|
|
35
42
|
const hosts = new Map();
|
|
@@ -43,6 +50,28 @@ function toTemplateHosts(edges) {
|
|
|
43
50
|
}
|
|
44
51
|
/**
|
|
45
52
|
* MCP tool for analyzing build impact before transformations.
|
|
53
|
+
* Estimates affected files, modules, build time, and gives a recommendation.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Uses `IncrementalAnalyzer.getBuildScope()` with the target files as the
|
|
57
|
+
* changed set. The underlying `DependencyGraphBuilder` follows
|
|
58
|
+
* `export ... from`, resolves tsconfig path aliases, splits value vs type-only
|
|
59
|
+
* dependents and does not let barrels inflate the radius. Optional `symbols`
|
|
60
|
+
* restrict the impact to consumers of specific exported symbols.
|
|
61
|
+
*
|
|
62
|
+
* External templates (`.html`) are not part of the TypeScript program; they
|
|
63
|
+
* are mapped to the component files that own them (`templateUrl`, then same
|
|
64
|
+
* basename) instead of failing. Such a component is recompiled, but its
|
|
65
|
+
* dependents are not counted, because a template edit does not change the
|
|
66
|
+
* component's TypeScript API. Files that cannot be mapped are listed in
|
|
67
|
+
* `unresolvedFiles`. `summaryOnly` and `maxResults` shorten the file lists;
|
|
68
|
+
* counts always describe the full result.
|
|
69
|
+
*
|
|
70
|
+
* Host components that use a changed component, directive or pipe only in
|
|
71
|
+
* their template (NgModule declarations, no import of the class) are listed
|
|
72
|
+
* as `templateDependentFiles` and, with the used classes, in `templateHosts`.
|
|
73
|
+
* They are recompiled and template type-checked; their own dependents are not
|
|
74
|
+
* counted.
|
|
46
75
|
*/
|
|
47
76
|
export class AnalyzeBuildImpactTool {
|
|
48
77
|
projects;
|
|
@@ -54,13 +83,25 @@ export class AnalyzeBuildImpactTool {
|
|
|
54
83
|
this.projects = projects;
|
|
55
84
|
}
|
|
56
85
|
name = 'analyze-build-impact';
|
|
86
|
+
title = 'Analyze Build Impact';
|
|
87
|
+
annotations = {
|
|
88
|
+
readOnlyHint: true,
|
|
89
|
+
destructiveHint: false,
|
|
90
|
+
idempotentHint: true,
|
|
91
|
+
openWorldHint: false,
|
|
92
|
+
};
|
|
57
93
|
description = 'Analyze build impact before transformations. Estimates affected files, transitive dependents, Angular modules, build time, and provides clear recommendations for AI usage. Helps determine if a transformation is safe to proceed. ' +
|
|
58
94
|
'External .html templates are mapped to their component files. Host components that use a changed component, ' +
|
|
59
95
|
'directive or pipe only in their template (NgModule declarations) are listed as templateHosts. ' +
|
|
60
|
-
'The recommendation and counts come first; ' +
|
|
96
|
+
'The recommendation and counts come first, summary repeats them as text; ' +
|
|
61
97
|
'use summaryOnly to skip the file lists or maxResults to cap them.';
|
|
98
|
+
/**
|
|
99
|
+
* JSON Schema of the tool arguments.
|
|
100
|
+
* @hidden
|
|
101
|
+
*/
|
|
62
102
|
inputSchema = {
|
|
63
103
|
type: 'object',
|
|
104
|
+
additionalProperties: false,
|
|
64
105
|
properties: {
|
|
65
106
|
projectPath: {
|
|
66
107
|
type: 'string',
|
|
@@ -84,6 +125,109 @@ export class AnalyzeBuildImpactTool {
|
|
|
84
125
|
},
|
|
85
126
|
required: ['projectPath', 'filesToChange'],
|
|
86
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
130
|
+
* @hidden
|
|
131
|
+
*/
|
|
132
|
+
outputSchema = {
|
|
133
|
+
type: 'object',
|
|
134
|
+
properties: {
|
|
135
|
+
recommendation: { type: 'string' },
|
|
136
|
+
counts: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: Object.fromEntries(BUILD_IMPACT_COUNT_KEYS.map((k) => [k, { type: 'integer' }])),
|
|
139
|
+
required: [...BUILD_IMPACT_COUNT_KEYS],
|
|
140
|
+
},
|
|
141
|
+
truncated: { type: 'boolean' },
|
|
142
|
+
estimatedBuildScope: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {
|
|
145
|
+
strategy: { type: 'string' },
|
|
146
|
+
changedFiles: STRING_ARRAY,
|
|
147
|
+
dependentFiles: STRING_ARRAY,
|
|
148
|
+
affectedModules: STRING_ARRAY,
|
|
149
|
+
estimatedBuildTime: { type: 'number' },
|
|
150
|
+
valueDependentFiles: STRING_ARRAY,
|
|
151
|
+
typeOnlyDependentFiles: STRING_ARRAY,
|
|
152
|
+
reExportFiles: STRING_ARRAY,
|
|
153
|
+
templateDependentFiles: STRING_ARRAY,
|
|
154
|
+
changeSource: { type: 'string' },
|
|
155
|
+
},
|
|
156
|
+
required: ['strategy', 'changedFiles', 'estimatedBuildTime', 'changeSource'],
|
|
157
|
+
},
|
|
158
|
+
affectedFiles: STRING_ARRAY,
|
|
159
|
+
affectedModules: STRING_ARRAY,
|
|
160
|
+
estimatedBuildTime: { type: 'number' },
|
|
161
|
+
mappedFiles: {
|
|
162
|
+
type: 'array',
|
|
163
|
+
items: {
|
|
164
|
+
type: 'object',
|
|
165
|
+
properties: { file: { type: 'string' }, mappedTo: STRING_ARRAY },
|
|
166
|
+
required: ['file', 'mappedTo'],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
unresolvedFiles: {
|
|
170
|
+
type: 'array',
|
|
171
|
+
items: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: { file: { type: 'string' }, reason: { type: 'string' } },
|
|
174
|
+
required: ['file', 'reason'],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
dependencies: {
|
|
178
|
+
type: 'array',
|
|
179
|
+
items: {
|
|
180
|
+
type: 'object',
|
|
181
|
+
properties: {
|
|
182
|
+
file: { type: 'string' },
|
|
183
|
+
dependents: { type: 'integer' },
|
|
184
|
+
valueDependents: { type: 'integer' },
|
|
185
|
+
typeOnlyDependents: { type: 'integer' },
|
|
186
|
+
templateDependents: { type: 'integer' },
|
|
187
|
+
isPublicApi: { type: 'boolean' },
|
|
188
|
+
affectedModule: { type: 'string' },
|
|
189
|
+
},
|
|
190
|
+
required: ['file', 'dependents', 'isPublicApi'],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
symbolImpacts: { type: 'array', items: { type: 'object' } },
|
|
194
|
+
templateHosts: {
|
|
195
|
+
type: 'array',
|
|
196
|
+
items: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
properties: {
|
|
199
|
+
file: { type: 'string' },
|
|
200
|
+
component: { type: 'string' },
|
|
201
|
+
uses: {
|
|
202
|
+
type: 'array',
|
|
203
|
+
items: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
properties: {
|
|
206
|
+
className: { type: 'string' },
|
|
207
|
+
via: { type: 'string' },
|
|
208
|
+
file: { type: 'string' },
|
|
209
|
+
templateFile: { type: 'string' },
|
|
210
|
+
},
|
|
211
|
+
required: ['className', 'via', 'file', 'templateFile'],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
required: ['file', 'component', 'uses'],
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
summary: { type: 'string' },
|
|
219
|
+
...WARNINGS_OUTPUT_SCHEMA,
|
|
220
|
+
},
|
|
221
|
+
required: [
|
|
222
|
+
'recommendation',
|
|
223
|
+
'counts',
|
|
224
|
+
'truncated',
|
|
225
|
+
'estimatedBuildScope',
|
|
226
|
+
'estimatedBuildTime',
|
|
227
|
+
'dependencies',
|
|
228
|
+
'summary',
|
|
229
|
+
],
|
|
230
|
+
};
|
|
87
231
|
async execute(args) {
|
|
88
232
|
const params = args;
|
|
89
233
|
if (!params.projectPath) {
|
|
@@ -216,10 +360,11 @@ export class AnalyzeBuildImpactTool {
|
|
|
216
360
|
: {}),
|
|
217
361
|
changeSource: buildScope.changeSource ?? 'forced',
|
|
218
362
|
};
|
|
219
|
-
|
|
363
|
+
const truncated = lists.truncated || (templateHosts?.truncated ?? false);
|
|
364
|
+
const result = {
|
|
220
365
|
recommendation,
|
|
221
366
|
counts,
|
|
222
|
-
truncated
|
|
367
|
+
truncated,
|
|
223
368
|
estimatedBuildScope,
|
|
224
369
|
...(lists.affectedFiles ? { affectedFiles: lists.affectedFiles } : {}),
|
|
225
370
|
...(lists.affectedModules ? { affectedModules: lists.affectedModules } : {}),
|
|
@@ -234,6 +379,8 @@ export class AnalyzeBuildImpactTool {
|
|
|
234
379
|
? { templateHosts: templateHosts.items }
|
|
235
380
|
: {}),
|
|
236
381
|
};
|
|
382
|
+
const warnings = this.projects?.warnings(tsConfigPath) ?? [];
|
|
383
|
+
return withWarnings({ ...result, summary: describeBuildImpact(result, strategy, compact.summaryOnly) }, warnings);
|
|
237
384
|
}
|
|
238
385
|
/**
|
|
239
386
|
* Splits the requested files into files of the TypeScript program, `.html`
|