@angular/cli 21.0.0 → 21.1.0-next.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/lib/code-examples.db +0 -0
- package/lib/config/schema.json +9 -0
- package/lib/config/workspace-schema.d.ts +4 -0
- package/lib/config/workspace-schema.js.map +1 -1
- package/package.json +20 -20
- package/src/command-builder/architect-base-command-module.js +5 -8
- package/src/command-builder/architect-base-command-module.js.map +1 -1
- package/src/command-builder/command-module.d.ts +1 -1
- package/src/command-builder/command-module.js.map +1 -1
- package/src/command-builder/utilities/json-schema.js +1 -1
- package/src/command-builder/utilities/json-schema.js.map +1 -1
- package/src/commands/add/cli.js +3 -1
- package/src/commands/add/cli.js.map +1 -1
- package/src/commands/mcp/cli.d.ts +2 -2
- package/src/commands/mcp/cli.js.map +1 -1
- package/src/commands/mcp/dev-server.d.ts +71 -0
- package/src/commands/mcp/dev-server.js +96 -0
- package/src/commands/mcp/dev-server.js.map +1 -0
- package/src/commands/mcp/host.d.ts +20 -5
- package/src/commands/mcp/host.js +44 -13
- package/src/commands/mcp/host.js.map +1 -1
- package/src/commands/mcp/mcp-server.d.ts +26 -4
- package/src/commands/mcp/mcp-server.js +12 -6
- package/src/commands/mcp/mcp-server.js.map +1 -1
- package/src/commands/mcp/resources/best-practices.md +12 -4
- package/src/commands/mcp/resources/instructions.d.ts +1 -1
- package/src/commands/mcp/resources/instructions.js +2 -5
- package/src/commands/mcp/resources/instructions.js.map +1 -1
- package/src/commands/mcp/tools/ai-tutor.js +2 -5
- package/src/commands/mcp/tools/ai-tutor.js.map +1 -1
- package/src/commands/mcp/tools/best-practices.js +6 -9
- package/src/commands/mcp/tools/best-practices.js.map +1 -1
- package/src/commands/mcp/tools/build.d.ts +48 -0
- package/src/commands/mcp/tools/build.js +97 -0
- package/src/commands/mcp/tools/build.js.map +1 -0
- package/src/commands/mcp/tools/devserver/start-devserver.d.ts +41 -0
- package/src/commands/mcp/tools/devserver/start-devserver.js +82 -0
- package/src/commands/mcp/tools/devserver/start-devserver.js.map +1 -0
- package/src/commands/mcp/tools/devserver/stop-devserver.d.ts +49 -0
- package/src/commands/mcp/tools/devserver/stop-devserver.js +66 -0
- package/src/commands/mcp/tools/devserver/stop-devserver.js.map +1 -0
- package/src/commands/mcp/tools/devserver/wait-for-devserver-build.d.ts +47 -0
- package/src/commands/mcp/tools/devserver/wait-for-devserver-build.js +100 -0
- package/src/commands/mcp/tools/devserver/wait-for-devserver-build.js.map +1 -0
- package/src/commands/mcp/tools/doc-search.js.map +1 -1
- package/src/commands/mcp/tools/examples.js +6 -9
- package/src/commands/mcp/tools/examples.js.map +1 -1
- package/src/commands/mcp/tools/modernize.d.ts +15 -11
- package/src/commands/mcp/tools/modernize.js +13 -45
- package/src/commands/mcp/tools/modernize.js.map +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.d.ts → analyze-for-unsupported-zone-uses.d.ts} +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.js → analyze-for-unsupported-zone-uses.js} +2 -2
- package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.js.map → analyze-for-unsupported-zone-uses.js.map} +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.d.ts → migrate-single-file.d.ts} +3 -3
- package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.js → migrate-single-file.js} +5 -5
- package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.js.map → migrate-single-file.js.map} +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_test_file.js → migrate-test-file.js} +6 -52
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js.map +1 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +2 -2
- package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.d.ts → send-debug-message.d.ts} +2 -2
- package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.js → send-debug-message.js} +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.js.map → send-debug-message.js.map} +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.d.ts → ts-utils.d.ts} +3 -4
- package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.js → ts-utils.js} +3 -3
- package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.js.map → ts-utils.js.map} +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +2 -2
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +68 -72
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +1 -1
- package/src/commands/mcp/tools/projects.d.ts +1 -1
- package/src/commands/mcp/tools/projects.js +33 -33
- package/src/commands/mcp/tools/projects.js.map +1 -1
- package/src/commands/mcp/tools/tool-registry.d.ts +3 -1
- package/src/commands/mcp/tools/tool-registry.js.map +1 -1
- package/src/commands/mcp/utils.d.ts +33 -0
- package/src/commands/mcp/utils.js +55 -0
- package/src/commands/mcp/utils.js.map +1 -0
- package/src/utilities/package-manager.d.ts +1 -1
- package/src/utilities/package-manager.js +5 -2
- package/src/utilities/package-manager.js.map +1 -1
- package/src/utilities/version.js +1 -1
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.js.map +0 -1
- package/src/package-managers/testing/mock-host.d.ts +0 -26
- package/src/package-managers/testing/mock-host.js +0 -53
- package/src/package-managers/testing/mock-host.js.map +0 -1
- /package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_test_file.d.ts → migrate-test-file.d.ts} +0 -0
|
@@ -12,6 +12,7 @@ exports.runModernization = runModernization;
|
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
const zod_1 = require("zod");
|
|
14
14
|
const host_1 = require("../host");
|
|
15
|
+
const utils_1 = require("../utils");
|
|
15
16
|
const tool_registry_1 = require("./tool-registry");
|
|
16
17
|
const TRANSFORMATIONS = [
|
|
17
18
|
{
|
|
@@ -72,33 +73,13 @@ const modernizeOutputSchema = zod_1.z.object({
|
|
|
72
73
|
.array(zod_1.z.string())
|
|
73
74
|
.optional()
|
|
74
75
|
.describe('Migration summary, as well as any instructions that need to be performed to complete the migrations.'),
|
|
75
|
-
|
|
76
|
-
stderr: zod_1.z.string().optional().describe('The stderr from the executed commands.'),
|
|
76
|
+
logs: zod_1.z.array(zod_1.z.string()).optional().describe('All logs from all executed commands.'),
|
|
77
77
|
});
|
|
78
|
-
function createToolOutput(structuredContent) {
|
|
79
|
-
return {
|
|
80
|
-
content: [{ type: 'text', text: JSON.stringify(structuredContent, null, 2) }],
|
|
81
|
-
structuredContent,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
function findAngularJsonDir(startDir, host) {
|
|
85
|
-
let currentDir = startDir;
|
|
86
|
-
while (true) {
|
|
87
|
-
if (host.existsSync((0, path_1.join)(currentDir, 'angular.json'))) {
|
|
88
|
-
return currentDir;
|
|
89
|
-
}
|
|
90
|
-
const parentDir = (0, path_1.dirname)(currentDir);
|
|
91
|
-
if (parentDir === currentDir) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
currentDir = parentDir;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
78
|
async function runModernization(input, host) {
|
|
98
79
|
const transformationNames = input.transformations ?? [];
|
|
99
80
|
const directories = input.directories ?? [];
|
|
100
81
|
if (transformationNames.length === 0) {
|
|
101
|
-
return
|
|
82
|
+
return (0, utils_1.createStructuredContentOutput)({
|
|
102
83
|
instructions: [
|
|
103
84
|
'See https://angular.dev/best-practices for Angular best practices. ' +
|
|
104
85
|
'You can call this tool if you have specific transformation you want to run.',
|
|
@@ -106,7 +87,7 @@ async function runModernization(input, host) {
|
|
|
106
87
|
});
|
|
107
88
|
}
|
|
108
89
|
if (directories.length === 0) {
|
|
109
|
-
return
|
|
90
|
+
return (0, utils_1.createStructuredContentOutput)({
|
|
110
91
|
instructions: [
|
|
111
92
|
'Provide this tool with a list of directory paths in your workspace ' +
|
|
112
93
|
'to run the modernization on.',
|
|
@@ -115,15 +96,14 @@ async function runModernization(input, host) {
|
|
|
115
96
|
}
|
|
116
97
|
const firstDir = directories[0];
|
|
117
98
|
const executionDir = (await host.stat(firstDir)).isDirectory() ? firstDir : (0, path_1.dirname)(firstDir);
|
|
118
|
-
const angularProjectRoot = findAngularJsonDir(executionDir, host);
|
|
99
|
+
const angularProjectRoot = (0, utils_1.findAngularJsonDir)(executionDir, host);
|
|
119
100
|
if (!angularProjectRoot) {
|
|
120
|
-
return
|
|
101
|
+
return (0, utils_1.createStructuredContentOutput)({
|
|
121
102
|
instructions: ['Could not find an angular.json file in the current or parent directories.'],
|
|
122
103
|
});
|
|
123
104
|
}
|
|
124
105
|
const instructions = [];
|
|
125
|
-
|
|
126
|
-
const stderrMessages = [];
|
|
106
|
+
let logs = [];
|
|
127
107
|
const transformationsToRun = TRANSFORMATIONS.filter((t) => transformationNames.includes(t.name));
|
|
128
108
|
for (const transformation of transformationsToRun) {
|
|
129
109
|
if (transformation.instructions) {
|
|
@@ -141,36 +121,24 @@ async function runModernization(input, host) {
|
|
|
141
121
|
const command = 'ng';
|
|
142
122
|
const args = ['generate', `@angular/core:${transformation.name}`, '--path', relativePath];
|
|
143
123
|
try {
|
|
144
|
-
|
|
124
|
+
logs = (await host.runCommand(command, args, {
|
|
145
125
|
cwd: angularProjectRoot,
|
|
146
|
-
});
|
|
147
|
-
if (stdout) {
|
|
148
|
-
stdoutMessages.push(stdout);
|
|
149
|
-
}
|
|
150
|
-
if (stderr) {
|
|
151
|
-
stderrMessages.push(stderr);
|
|
152
|
-
}
|
|
126
|
+
})).logs;
|
|
153
127
|
instructions.push(`Migration ${transformation.name} on directory ${relativePath} completed successfully.`);
|
|
154
128
|
}
|
|
155
129
|
catch (e) {
|
|
156
130
|
if (e instanceof host_1.CommandError) {
|
|
157
|
-
|
|
158
|
-
stdoutMessages.push(e.stdout);
|
|
159
|
-
}
|
|
160
|
-
if (e.stderr) {
|
|
161
|
-
stderrMessages.push(e.stderr);
|
|
162
|
-
}
|
|
131
|
+
logs = e.logs;
|
|
163
132
|
}
|
|
164
|
-
|
|
133
|
+
logs.push(e.message);
|
|
165
134
|
instructions.push(`Migration ${transformation.name} on directory ${relativePath} failed.`);
|
|
166
135
|
}
|
|
167
136
|
}
|
|
168
137
|
}
|
|
169
138
|
}
|
|
170
|
-
return
|
|
139
|
+
return (0, utils_1.createStructuredContentOutput)({
|
|
171
140
|
instructions: instructions.length > 0 ? instructions : undefined,
|
|
172
|
-
|
|
173
|
-
stderr: stderrMessages?.join('\n\n') || undefined,
|
|
141
|
+
logs,
|
|
174
142
|
});
|
|
175
143
|
}
|
|
176
144
|
exports.MODERNIZE_TOOL = (0, tool_registry_1.declareTool)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modernize.js","sourceRoot":"","sources":["modernize.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"modernize.js","sourceRoot":"","sources":["modernize.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAyFH,4CA2EC;AAlKD,+BAA+C;AAC/C,6BAAwB;AACxB,kCAAsE;AACtE,oCAA6E;AAC7E,mDAAuE;AASvE,MAAM,eAAe,GAA0B;IAC7C;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,qHAAqH;QACvH,gBAAgB,EAAE,uDAAuD;KAC1E;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,oHAAoH;QACtH,gBAAgB,EAAE,4DAA4D;KAC/E;IACD;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0EAA0E;QACvF,gBAAgB,EAAE,0DAA0D;KAC7E;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,0EAA0E;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AAC,SAAS;QAChE,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,cAAc,GAGvB,IAAA,2BAAW,EAAC;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;EAuBb,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;qBACrD;IACnB,WAAW,EAAE,oBAAoB,CAAC,KAAK;IACvC,YAAY,EAAE,qBAAqB,CAAC,KAAK;IACzC,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,yBAAkB,CAAC;CACtE,CAAC,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { ImportSpecifier, Node, SourceFile } from 'typescript';
|
|
9
|
-
import { MigrationResponse } from './types';
|
|
9
|
+
import type { MigrationResponse } from './types';
|
|
10
10
|
export declare function analyzeForUnsupportedZoneUses(sourceFile: SourceFile): Promise<MigrationResponse | null>;
|
|
11
11
|
/**
|
|
12
12
|
* Finds usages of `NgZone` that are not supported in zoneless applications.
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.analyzeForUnsupportedZoneUses = analyzeForUnsupportedZoneUses;
|
|
11
11
|
exports.findUnsupportedZoneUsages = findUnsupportedZoneUsages;
|
|
12
12
|
const prompts_1 = require("./prompts");
|
|
13
|
-
const ts_utils_1 = require("./
|
|
13
|
+
const ts_utils_1 = require("./ts-utils");
|
|
14
14
|
async function analyzeForUnsupportedZoneUses(sourceFile) {
|
|
15
15
|
const ngZoneImport = await (0, ts_utils_1.getImportSpecifier)(sourceFile, '@angular/core', 'NgZone');
|
|
16
16
|
if (!ngZoneImport) {
|
|
@@ -59,4 +59,4 @@ async function findUnsupportedZoneUsages(sourceFile, ngZoneImport) {
|
|
|
59
59
|
});
|
|
60
60
|
return unsupportedUsages;
|
|
61
61
|
}
|
|
62
|
-
//# sourceMappingURL=
|
|
62
|
+
//# sourceMappingURL=analyze-for-unsupported-zone-uses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"analyze-for-unsupported-zone-uses.js","sourceRoot":"","sources":["analyze-for-unsupported-zone-uses.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAOH,sEAoBC;AAQD,8DAkCC;AAlED,uCAA+D;AAC/D,yCAAgE;AAGzD,KAAK,UAAU,6BAA6B,CACjD,UAAsB;IAEtB,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAkB,EAAC,UAAU,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;IACrF,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,iBAAiB,GAAG,MAAM,yBAAyB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAEpF,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAU,EAAE,EAAE;QACrD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEtF,OAAO,QAAQ,IAAI,GAAG,CAAC,eAAe,SAAS,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,4CAAk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use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
|
|
9
|
-
import { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
|
|
8
|
+
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
|
|
9
|
+
import type { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
|
|
10
10
|
import type { SourceFile } from 'typescript';
|
|
11
|
-
import { MigrationResponse } from './types';
|
|
11
|
+
import type { MigrationResponse } from './types';
|
|
12
12
|
export declare function migrateSingleFile(sourceFile: SourceFile, extras: RequestHandlerExtra<ServerRequest, ServerNotification>): Promise<MigrationResponse | null>;
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.migrateSingleFile = migrateSingleFile;
|
|
11
|
-
const analyze_for_unsupported_zone_uses_1 = require("./
|
|
12
|
-
const migrate_test_file_1 = require("./
|
|
11
|
+
const analyze_for_unsupported_zone_uses_1 = require("./analyze-for-unsupported-zone-uses");
|
|
12
|
+
const migrate_test_file_1 = require("./migrate-test-file");
|
|
13
13
|
const prompts_1 = require("./prompts");
|
|
14
|
-
const send_debug_message_1 = require("./
|
|
15
|
-
const ts_utils_1 = require("./
|
|
14
|
+
const send_debug_message_1 = require("./send-debug-message");
|
|
15
|
+
const ts_utils_1 = require("./ts-utils");
|
|
16
16
|
async function migrateSingleFile(sourceFile, extras) {
|
|
17
17
|
const testBedSpecifier = await (0, ts_utils_1.getImportSpecifier)(sourceFile, '@angular/core/testing', 'TestBed');
|
|
18
18
|
const isTestFile = sourceFile.fileName.endsWith('.spec.ts') || !!testBedSpecifier;
|
|
@@ -70,4 +70,4 @@ async function migrateSingleFile(sourceFile, extras) {
|
|
|
70
70
|
// Component decorator found, but no change detection strategy.
|
|
71
71
|
return (0, prompts_1.generateZonelessMigrationInstructionsForComponent)(sourceFile.fileName);
|
|
72
72
|
}
|
|
73
|
-
//# sourceMappingURL=
|
|
73
|
+
//# sourceMappingURL=migrate-single-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"migrate-single-file.js","sourceRoot":"","sources":["migrate-single-file.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAYH,8CA8EC;AArFD,2FAAoF;AACpF,2DAAsD;AACtD,uCAA8E;AAC9E,6DAAwD;AACxD,yCAAgE;AAGzD,KAAK,UAAU,iBAAiB,CACrC,UAAsB,EACtB,MAA8D;IAE9D,MAAM,gBAAgB,GAAG,MAAM,IAAA,6BAAkB,EAAC,UAAU,EAAE,uBAAuB,EAAE,SAAS,CAAC,CAAC;IAClG,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;IAClF,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,IAAA,mCAAe,EAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,0BAA0B,GAAG,MAAM,IAAA,iEAA6B,EAAC,UAAU,CAAC,CAAC;IACnF,IAAI,0BAA0B,EAAE,CAAC;QAC/B,OAAO,0BAA0B,CAAC;IACpC,CAAC;IAED,IAAI,gBAAkD,CAAC;IACvD,IAAI,qBAAqB,GAAG,KAAK,CAAC;IAElC,MAAM,kBAAkB,GAAG,MAAM,IAAA,6BAAkB,EAAC,UAAU,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;IAC9F,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,IAAA,qCAAgB,EAAC,yCAAyC,UAAU,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;QAEzF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,EAAE,GAAG,MAAM,IAAA,yBAAc,GAAE,CA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ACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,IACE,CAAC,qBAAqB;QACtB,iEAAiE;QACjE,gBAAgB,KAAK,QAAQ;QAC7B,wIAAwI;QACxI,gBAAgB,KAAK,SAAS,EAC9B,CAAC;QACD,IAAA,qCAAgB,EACd,4CAA4C,gBAAgB,aAAa,UAAU,CAAC,QAAQ,gCAAgC,EAC5H,MAAM,CACP,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+DAA+D;IAC/D,OAAO,IAAA,2DAAiD,EAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -6,47 +6,14 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
10
|
exports.migrateTestFile = migrateTestFile;
|
|
44
11
|
exports.searchForGlobalZoneless = searchForGlobalZoneless;
|
|
45
|
-
const
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
46
13
|
const promises_1 = require("node:fs/promises");
|
|
47
|
-
const
|
|
14
|
+
const utils_1 = require("../../utils");
|
|
48
15
|
const prompts_1 = require("./prompts");
|
|
49
|
-
const ts_utils_1 = require("./
|
|
16
|
+
const ts_utils_1 = require("./ts-utils");
|
|
50
17
|
async function migrateTestFile(sourceFile) {
|
|
51
18
|
const ts = await (0, ts_utils_1.loadTypescript)();
|
|
52
19
|
// Check if tests use zoneless either by default through `initTestEnvironment` or by explicitly calling `provideZonelessChangeDetection`.
|
|
@@ -69,7 +36,7 @@ async function migrateTestFile(sourceFile) {
|
|
|
69
36
|
return (0, prompts_1.createFixResponseForZoneTests)(sourceFile);
|
|
70
37
|
}
|
|
71
38
|
async function searchForGlobalZoneless(startPath) {
|
|
72
|
-
const angularJsonDir = findAngularJsonDir(startPath);
|
|
39
|
+
const angularJsonDir = (0, utils_1.findAngularJsonDir)(startPath);
|
|
73
40
|
if (!angularJsonDir) {
|
|
74
41
|
// Cannot determine project root, fallback to original behavior or assume false.
|
|
75
42
|
// For now, let's assume no global setup if angular.json is not found.
|
|
@@ -78,7 +45,7 @@ async function searchForGlobalZoneless(startPath) {
|
|
|
78
45
|
try {
|
|
79
46
|
const files = (0, promises_1.glob)(`${angularJsonDir}/**/*.ts`);
|
|
80
47
|
for await (const file of files) {
|
|
81
|
-
const content =
|
|
48
|
+
const content = (0, node_fs_1.readFileSync)(file, 'utf-8');
|
|
82
49
|
if (content.includes('initTestEnvironment') &&
|
|
83
50
|
content.includes('provideZonelessChangeDetection')) {
|
|
84
51
|
return true;
|
|
@@ -90,17 +57,4 @@ async function searchForGlobalZoneless(startPath) {
|
|
|
90
57
|
}
|
|
91
58
|
return false;
|
|
92
59
|
}
|
|
93
|
-
|
|
94
|
-
let currentDir = startDir;
|
|
95
|
-
while (true) {
|
|
96
|
-
if (fs.existsSync((0, node_path_1.join)(currentDir, 'angular.json'))) {
|
|
97
|
-
return currentDir;
|
|
98
|
-
}
|
|
99
|
-
const parentDir = (0, node_path_1.dirname)(currentDir);
|
|
100
|
-
if (parentDir === currentDir) {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
currentDir = parentDir;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=migrate_test_file.js.map
|
|
60
|
+
//# sourceMappingURL=migrate-test-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-test-file.js","sourceRoot":"","sources":["migrate-test-file.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAWH,0CAyBC;AAED,0DAwBC;AA5DD,qCAAmD;AACnD,+CAAwC;AAGxC,uCAAiD;AACjD,uCAAoG;AACpG,yCAA4C;AAGrC,KAAK,UAAU,eAAe,CAAC,UAAsB;IAC1D,MAAM,EAAE,GAAG,MAAM,IAAA,yBAAc,GAAE,CAAC;IAClC,yIAAyI;IACzI,IAAI,+BAA+B,GAAG,MAAM,uBAAuB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACzF,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;IACf,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { SourceFile } from 'typescript';
|
|
9
|
-
import { MigrationResponse } from './types';
|
|
9
|
+
import type { MigrationResponse } from './types';
|
|
10
10
|
export declare function createProvideZonelessForTestsSetupPrompt(testFilePath: string): MigrationResponse;
|
|
11
11
|
export declare function createUnsupportedZoneUsagesMessage(usages: string[], filePath: string): MigrationResponse;
|
|
12
12
|
export declare function generateZonelessMigrationInstructionsForComponent(filePath: string): MigrationResponse;
|
|
@@ -13,7 +13,7 @@ exports.generateZonelessMigrationInstructionsForComponent = generateZonelessMigr
|
|
|
13
13
|
exports.createTestDebuggingGuideForNonActionableInput = createTestDebuggingGuideForNonActionableInput;
|
|
14
14
|
exports.createFixResponseForZoneTests = createFixResponseForZoneTests;
|
|
15
15
|
exports.createResponse = createResponse;
|
|
16
|
-
const ts_utils_1 = require("./
|
|
16
|
+
const ts_utils_1 = require("./ts-utils");
|
|
17
17
|
/* eslint-disable max-len */
|
|
18
18
|
function createProvideZonelessForTestsSetupPrompt(testFilePath) {
|
|
19
19
|
const text = `You are an expert Angular developer assisting with a migration to zoneless. Your task is to update the test file at \`${testFilePath}\` to enable zoneless change detection and identify tests that are not yet compatible.
|
|
@@ -34,7 +34,7 @@ function createProvideZonelessForTestsSetupPrompt(testFilePath) {
|
|
|
34
34
|
\`\`\`diff
|
|
35
35
|
- import {{ SomeImport }} from '@angular/core';
|
|
36
36
|
+ import {{ SomeImport, provideZonelessChangeDetection }} from '@angular/core';
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
describe('MyComponent', () => {
|
|
39
39
|
+ beforeEach(() => {
|
|
40
40
|
+ TestBed.configureTestingModule({providers: [provideZonelessChangeDetection()]});
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
|
|
9
|
-
import { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
|
|
8
|
+
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
|
|
9
|
+
import type { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
|
|
10
10
|
export declare function sendDebugMessage(message: string, { sendNotification }: RequestHandlerExtra<ServerRequest, ServerNotification>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"send-debug-message.js","sourceRoot":"","sources":["send-debug-message.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKH,4CAWC;AAXD,SAAgB,gBAAgB,CAC9B,OAAe,EACf,EAAE,gBAAgB,EAA0D;IAE5E,KAAK,gBAAgB,CAAC;QACpB,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE;YACN,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;SACd;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import type { ImportSpecifier, NodeArray, SourceFile } from 'typescript';
|
|
9
8
|
import type ts from 'typescript';
|
|
10
9
|
export declare function loadTypescript(): Promise<typeof ts>;
|
|
11
10
|
/**
|
|
@@ -25,12 +24,12 @@ export declare function loadTypescript(): Promise<typeof ts>;
|
|
|
25
24
|
* @param specifierName Original name of the specifier to look for. Aliases will be resolved to
|
|
26
25
|
* their original name.
|
|
27
26
|
*/
|
|
28
|
-
export declare function getImportSpecifier(sourceFile: SourceFile, moduleName: string | RegExp, specifierName: string): Promise<ImportSpecifier | null>;
|
|
27
|
+
export declare function getImportSpecifier(sourceFile: ts.SourceFile, moduleName: string | RegExp, specifierName: string): Promise<ts.ImportSpecifier | null>;
|
|
29
28
|
/**
|
|
30
29
|
* Finds an import specifier with a particular name.
|
|
31
30
|
* @param nodes Array of import specifiers to search through.
|
|
32
31
|
* @param specifierName Name of the specifier to look for.
|
|
33
32
|
*/
|
|
34
|
-
export declare function findImportSpecifier(nodes: NodeArray<ImportSpecifier>, specifierName: string): ImportSpecifier | undefined;
|
|
33
|
+
export declare function findImportSpecifier(nodes: ts.NodeArray<ts.ImportSpecifier>, specifierName: string): ts.ImportSpecifier | undefined;
|
|
35
34
|
/** Creates a TypeScript source file from a file path. */
|
|
36
|
-
export declare function createSourceFile(file: string): Promise<SourceFile>;
|
|
35
|
+
export declare function createSourceFile(file: string): Promise<ts.SourceFile>;
|
|
@@ -44,7 +44,7 @@ exports.loadTypescript = loadTypescript;
|
|
|
44
44
|
exports.getImportSpecifier = getImportSpecifier;
|
|
45
45
|
exports.findImportSpecifier = findImportSpecifier;
|
|
46
46
|
exports.createSourceFile = createSourceFile;
|
|
47
|
-
const
|
|
47
|
+
const node_fs_1 = require("node:fs");
|
|
48
48
|
let typescriptModule;
|
|
49
49
|
async function loadTypescript() {
|
|
50
50
|
return (typescriptModule ??= await Promise.resolve().then(() => __importStar(require('typescript'))));
|
|
@@ -129,8 +129,8 @@ function findImportSpecifier(nodes, specifierName) {
|
|
|
129
129
|
}
|
|
130
130
|
/** Creates a TypeScript source file from a file path. */
|
|
131
131
|
async function createSourceFile(file) {
|
|
132
|
-
const content =
|
|
132
|
+
const content = (0, node_fs_1.readFileSync)(file, 'utf8');
|
|
133
133
|
const ts = await loadTypescript();
|
|
134
134
|
return ts.createSourceFile(file, content, ts.ScriptTarget.Latest, true);
|
|
135
135
|
}
|
|
136
|
-
//# sourceMappingURL=
|
|
136
|
+
//# sourceMappingURL=ts-utils.js.map
|
package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.js.map → ts-utils.js.map}
RENAMED
|
@@ -1 +1 @@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,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
|
|
9
|
-
import { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
|
|
8
|
+
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
|
|
9
|
+
import type { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
export declare const ZONELESS_MIGRATION_TOOL: import("../tool-registry").McpToolDeclaration<{
|
|
12
12
|
fileOrDirPath: z.ZodString;
|