@angular/cli 21.0.0-next.1 → 21.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/code-examples.db +0 -0
- package/lib/config/schema.json +33 -0
- package/lib/config/workspace-schema.d.ts +39 -0
- package/lib/config/workspace-schema.js +12 -1
- package/package.json +18 -18
- package/src/command-builder/architect-command-module.js +11 -5
- package/src/command-builder/utilities/json-schema.js +1 -1
- package/src/commands/add/cli.js +65 -26
- package/src/commands/mcp/mcp-server.d.ts +12 -2
- package/src/commands/mcp/mcp-server.js +6 -1
- package/src/commands/mcp/tools/best-practices.js +15 -5
- package/src/commands/mcp/tools/doc-search.d.ts +18 -1
- package/src/commands/mcp/tools/doc-search.js +94 -37
- package/src/commands/mcp/tools/examples.d.ts +9 -1
- package/src/commands/mcp/tools/examples.js +38 -12
- package/src/commands/mcp/tools/modernize.js +28 -17
- package/src/commands/mcp/tools/onpush-zoneless-migration/analyze_for_unsupported_zone_uses.d.ts +17 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/analyze_for_unsupported_zone_uses.js +61 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_single_file.d.ts +12 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_single_file.js +72 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.d.ts +11 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.js +105 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +15 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +236 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/send_debug_message.d.ts +10 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/send_debug_message.js +19 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/ts_utils.d.ts +36 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/ts_utils.js +135 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/types.d.ts +13 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/types.js +9 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +14 -0
- package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +205 -0
- package/src/commands/mcp/tools/projects.d.ts +47 -16
- package/src/commands/mcp/tools/projects.js +155 -30
- package/src/commands/mcp/tools/tool-registry.d.ts +2 -1
- package/src/commands/mcp/tools/tool-registry.js +3 -2
- package/src/utilities/version.js +1 -1
package/lib/code-examples.db
CHANGED
|
Binary file
|
package/lib/config/schema.json
CHANGED
|
@@ -1049,6 +1049,15 @@
|
|
|
1049
1049
|
"description": "Generate an application that does not use `zone.js`.",
|
|
1050
1050
|
"type": "boolean",
|
|
1051
1051
|
"default": false
|
|
1052
|
+
},
|
|
1053
|
+
"fileNameStyleGuide": {
|
|
1054
|
+
"type": "string",
|
|
1055
|
+
"enum": [
|
|
1056
|
+
"2016",
|
|
1057
|
+
"2025"
|
|
1058
|
+
],
|
|
1059
|
+
"default": "2025",
|
|
1060
|
+
"description": "The file naming convention to use for generated files. The '2025' style guide (default) uses a concise format (e.g., `app.ts` for the root component), while the '2016' style guide includes the type in the file name (e.g., `app.component.ts`). For more information, see the Angular Style Guide (https://angular.dev/style-guide)."
|
|
1052
1061
|
}
|
|
1053
1062
|
}
|
|
1054
1063
|
},
|
|
@@ -1196,6 +1205,11 @@
|
|
|
1196
1205
|
"type": "string",
|
|
1197
1206
|
"description": "Append a custom type to the component's filename. For example, if you set the type to `container`, the file will be named `my-component.container.ts`."
|
|
1198
1207
|
},
|
|
1208
|
+
"addTypeToClassName": {
|
|
1209
|
+
"type": "boolean",
|
|
1210
|
+
"default": true,
|
|
1211
|
+
"description": "When true, the 'type' option will be appended to the generated class name. When false, only the file name will include the type."
|
|
1212
|
+
},
|
|
1199
1213
|
"skipTests": {
|
|
1200
1214
|
"type": "boolean",
|
|
1201
1215
|
"description": "Skip the generation of unit test files `spec.ts`.",
|
|
@@ -1325,6 +1339,11 @@
|
|
|
1325
1339
|
"type": {
|
|
1326
1340
|
"type": "string",
|
|
1327
1341
|
"description": "Append a custom type to the directive's filename. For example, if you set the type to `directive`, the file will be named `example.directive.ts`."
|
|
1342
|
+
},
|
|
1343
|
+
"addTypeToClassName": {
|
|
1344
|
+
"type": "boolean",
|
|
1345
|
+
"default": true,
|
|
1346
|
+
"description": "When true, the 'type' option will be appended to the generated class name. When false, only the file name will include the type."
|
|
1328
1347
|
}
|
|
1329
1348
|
}
|
|
1330
1349
|
},
|
|
@@ -1832,6 +1851,15 @@
|
|
|
1832
1851
|
"windsurf"
|
|
1833
1852
|
]
|
|
1834
1853
|
}
|
|
1854
|
+
},
|
|
1855
|
+
"fileNameStyleGuide": {
|
|
1856
|
+
"type": "string",
|
|
1857
|
+
"enum": [
|
|
1858
|
+
"2016",
|
|
1859
|
+
"2025"
|
|
1860
|
+
],
|
|
1861
|
+
"default": "2025",
|
|
1862
|
+
"description": "The file naming convention to use for generated files. The '2025' style guide (default) uses a concise format (e.g., `app.ts` for the root component), while the '2016' style guide includes the type in the file name (e.g., `app.component.ts`). For more information, see the Angular Style Guide (https://angular.dev/style-guide)."
|
|
1835
1863
|
}
|
|
1836
1864
|
}
|
|
1837
1865
|
},
|
|
@@ -1933,6 +1961,11 @@
|
|
|
1933
1961
|
"type": {
|
|
1934
1962
|
"type": "string",
|
|
1935
1963
|
"description": "Append a custom type to the service's filename. For example, if you set the type to `service`, the file will be named `my-service.service.ts`."
|
|
1964
|
+
},
|
|
1965
|
+
"addTypeToClassName": {
|
|
1966
|
+
"type": "boolean",
|
|
1967
|
+
"default": true,
|
|
1968
|
+
"description": "When true, the 'type' option will be appended to the generated class name. When false, only the file name will include the type."
|
|
1936
1969
|
}
|
|
1937
1970
|
}
|
|
1938
1971
|
},
|
|
@@ -105,6 +105,13 @@ export type SchematicOptions = {
|
|
|
105
105
|
* routing, styling, and testing.
|
|
106
106
|
*/
|
|
107
107
|
export type AngularApplicationOptionsSchema = {
|
|
108
|
+
/**
|
|
109
|
+
* The file naming convention to use for generated files. The '2025' style guide (default)
|
|
110
|
+
* uses a concise format (e.g., `app.ts` for the root component), while the '2016' style
|
|
111
|
+
* guide includes the type in the file name (e.g., `app.component.ts`). For more
|
|
112
|
+
* information, see the Angular Style Guide (https://angular.dev/style-guide).
|
|
113
|
+
*/
|
|
114
|
+
fileNameStyleGuide?: FileNameStyleGuide;
|
|
108
115
|
/**
|
|
109
116
|
* Include the styles for the root component directly within the `app.component.ts` file.
|
|
110
117
|
* Only CSS styles can be included inline. By default, a separate stylesheet file (e.g.,
|
|
@@ -186,6 +193,16 @@ export type AngularApplicationOptionsSchema = {
|
|
|
186
193
|
*/
|
|
187
194
|
zoneless?: boolean;
|
|
188
195
|
};
|
|
196
|
+
/**
|
|
197
|
+
* The file naming convention to use for generated files. The '2025' style guide (default)
|
|
198
|
+
* uses a concise format (e.g., `app.ts` for the root component), while the '2016' style
|
|
199
|
+
* guide includes the type in the file name (e.g., `app.component.ts`). For more
|
|
200
|
+
* information, see the Angular Style Guide (https://angular.dev/style-guide).
|
|
201
|
+
*/
|
|
202
|
+
export declare enum FileNameStyleGuide {
|
|
203
|
+
The2016 = "2016",
|
|
204
|
+
The2025 = "2025"
|
|
205
|
+
}
|
|
189
206
|
/**
|
|
190
207
|
* The type of stylesheet files to be created for components in the application.
|
|
191
208
|
*
|
|
@@ -253,6 +270,11 @@ export type AngularClassOptionsSchema = {
|
|
|
253
270
|
* optional CSS stylesheet. Use this schematic to generate a new component in your project.
|
|
254
271
|
*/
|
|
255
272
|
export type AngularComponentOptionsSchema = {
|
|
273
|
+
/**
|
|
274
|
+
* When true, the 'type' option will be appended to the generated class name. When false,
|
|
275
|
+
* only the file name will include the type.
|
|
276
|
+
*/
|
|
277
|
+
addTypeToClassName?: boolean;
|
|
256
278
|
/**
|
|
257
279
|
* Configures the change detection strategy for the component.
|
|
258
280
|
*/
|
|
@@ -381,6 +403,11 @@ export declare enum SchematicsAngularComponentStyle {
|
|
|
381
403
|
* and boilerplate code for a new directive.
|
|
382
404
|
*/
|
|
383
405
|
export type AngularDirectiveOptionsSchema = {
|
|
406
|
+
/**
|
|
407
|
+
* When true, the 'type' option will be appended to the generated class name. When false,
|
|
408
|
+
* only the file name will include the type.
|
|
409
|
+
*/
|
|
410
|
+
addTypeToClassName?: boolean;
|
|
384
411
|
/**
|
|
385
412
|
* Automatically export the directive from the specified NgModule, making it accessible to
|
|
386
413
|
* other modules in the application.
|
|
@@ -692,6 +719,13 @@ export type AngularNgNewOptionsSchema = {
|
|
|
692
719
|
* the workspace will be created in the current directory.
|
|
693
720
|
*/
|
|
694
721
|
directory?: string;
|
|
722
|
+
/**
|
|
723
|
+
* The file naming convention to use for generated files. The '2025' style guide (default)
|
|
724
|
+
* uses a concise format (e.g., `app.ts` for the root component), while the '2016' style
|
|
725
|
+
* guide includes the type in the file name (e.g., `app.component.ts`). For more
|
|
726
|
+
* information, see the Angular Style Guide (https://angular.dev/style-guide).
|
|
727
|
+
*/
|
|
728
|
+
fileNameStyleGuide?: FileNameStyleGuide;
|
|
695
729
|
/**
|
|
696
730
|
* Include the styles for the initial application's root component directly within the
|
|
697
731
|
* `app.component.ts` file. By default, a separate stylesheet file (e.g.,
|
|
@@ -907,6 +941,11 @@ export type AngularResolverOptionsSchema = {
|
|
|
907
941
|
* process of generating a new service with the necessary files and boilerplate code.
|
|
908
942
|
*/
|
|
909
943
|
export type AngularServiceOptionsSchema = {
|
|
944
|
+
/**
|
|
945
|
+
* When true, the 'type' option will be appended to the generated class name. When false,
|
|
946
|
+
* only the file name will include the type.
|
|
947
|
+
*/
|
|
948
|
+
addTypeToClassName?: boolean;
|
|
910
949
|
/**
|
|
911
950
|
* Creates files at the top level of the project or the given path. If set to false, a new
|
|
912
951
|
* folder with the service's name will be created to contain the files.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
3
|
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.AiConfig = exports.TypeSeparator = exports.Implement = exports.SchematicsAngularComponentStyle = exports.ChangeDetection = exports.ViewEncapsulation = exports.SchematicsAngularApplicationStyle = exports.PackageManager = exports.Environment = void 0;
|
|
5
|
+
exports.AiConfig = exports.TypeSeparator = exports.Implement = exports.SchematicsAngularComponentStyle = exports.ChangeDetection = exports.ViewEncapsulation = exports.SchematicsAngularApplicationStyle = exports.FileNameStyleGuide = exports.PackageManager = exports.Environment = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Configure in which environment disk cache is enabled.
|
|
8
8
|
*/
|
|
@@ -24,6 +24,17 @@ var PackageManager;
|
|
|
24
24
|
PackageManager["Pnpm"] = "pnpm";
|
|
25
25
|
PackageManager["Yarn"] = "yarn";
|
|
26
26
|
})(PackageManager || (exports.PackageManager = PackageManager = {}));
|
|
27
|
+
/**
|
|
28
|
+
* The file naming convention to use for generated files. The '2025' style guide (default)
|
|
29
|
+
* uses a concise format (e.g., `app.ts` for the root component), while the '2016' style
|
|
30
|
+
* guide includes the type in the file name (e.g., `app.component.ts`). For more
|
|
31
|
+
* information, see the Angular Style Guide (https://angular.dev/style-guide).
|
|
32
|
+
*/
|
|
33
|
+
var FileNameStyleGuide;
|
|
34
|
+
(function (FileNameStyleGuide) {
|
|
35
|
+
FileNameStyleGuide["The2016"] = "2016";
|
|
36
|
+
FileNameStyleGuide["The2025"] = "2025";
|
|
37
|
+
})(FileNameStyleGuide || (exports.FileNameStyleGuide = FileNameStyleGuide = {}));
|
|
27
38
|
/**
|
|
28
39
|
* The type of stylesheet files to be created for components in the application.
|
|
29
40
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "21.0.0-next.
|
|
3
|
+
"version": "21.0.0-next.2",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.2100.0-next.
|
|
29
|
-
"@angular-devkit/core": "21.0.0-next.
|
|
30
|
-
"@angular-devkit/schematics": "21.0.0-next.
|
|
28
|
+
"@angular-devkit/architect": "0.2100.0-next.2",
|
|
29
|
+
"@angular-devkit/core": "21.0.0-next.2",
|
|
30
|
+
"@angular-devkit/schematics": "21.0.0-next.2",
|
|
31
31
|
"@inquirer/prompts": "7.8.4",
|
|
32
|
-
"@listr2/prompt-adapter-inquirer": "3.0.
|
|
33
|
-
"@modelcontextprotocol/sdk": "1.17.
|
|
34
|
-
"@schematics/angular": "21.0.0-next.
|
|
32
|
+
"@listr2/prompt-adapter-inquirer": "3.0.3",
|
|
33
|
+
"@modelcontextprotocol/sdk": "1.17.5",
|
|
34
|
+
"@schematics/angular": "21.0.0-next.2",
|
|
35
35
|
"@yarnpkg/lockfile": "1.1.0",
|
|
36
|
-
"algoliasearch": "5.
|
|
36
|
+
"algoliasearch": "5.37.0",
|
|
37
37
|
"ini": "5.0.0",
|
|
38
38
|
"jsonc-parser": "3.3.1",
|
|
39
|
-
"listr2": "9.0.
|
|
39
|
+
"listr2": "9.0.3",
|
|
40
40
|
"npm-package-arg": "13.0.0",
|
|
41
41
|
"pacote": "21.0.0",
|
|
42
42
|
"resolve": "1.22.10",
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
"ng-update": {
|
|
48
48
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
49
49
|
"packageGroup": {
|
|
50
|
-
"@angular/cli": "21.0.0-next.
|
|
51
|
-
"@angular/build": "21.0.0-next.
|
|
52
|
-
"@angular/ssr": "21.0.0-next.
|
|
53
|
-
"@angular-devkit/architect": "0.2100.0-next.
|
|
54
|
-
"@angular-devkit/build-angular": "21.0.0-next.
|
|
55
|
-
"@angular-devkit/build-webpack": "0.2100.0-next.
|
|
56
|
-
"@angular-devkit/core": "21.0.0-next.
|
|
57
|
-
"@angular-devkit/schematics": "21.0.0-next.
|
|
50
|
+
"@angular/cli": "21.0.0-next.2",
|
|
51
|
+
"@angular/build": "21.0.0-next.2",
|
|
52
|
+
"@angular/ssr": "21.0.0-next.2",
|
|
53
|
+
"@angular-devkit/architect": "0.2100.0-next.2",
|
|
54
|
+
"@angular-devkit/build-angular": "21.0.0-next.2",
|
|
55
|
+
"@angular-devkit/build-webpack": "0.2100.0-next.2",
|
|
56
|
+
"@angular-devkit/core": "21.0.0-next.2",
|
|
57
|
+
"@angular-devkit/schematics": "21.0.0-next.2"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"packageManager": "pnpm@10.15.
|
|
60
|
+
"packageManager": "pnpm@10.15.1",
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
63
63
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
@@ -109,9 +109,14 @@ let ArchitectCommandModule = (() => {
|
|
|
109
109
|
return this.addSchemaOptionsToCommand(localYargs, schemaOptions);
|
|
110
110
|
}
|
|
111
111
|
async run(options) {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
const originalProcessTitle = process.title;
|
|
113
|
+
try {
|
|
114
|
+
const target = this.getArchitectTarget();
|
|
115
|
+
const { configuration = '', project, ...architectOptions } = options;
|
|
116
|
+
if (project) {
|
|
117
|
+
process.title = `${originalProcessTitle} (${project})`;
|
|
118
|
+
return await this.runSingleTarget({ configuration, target, project }, architectOptions);
|
|
119
|
+
}
|
|
115
120
|
// This runs each target sequentially.
|
|
116
121
|
// Running them in parallel would jumble the log messages.
|
|
117
122
|
let result = 0;
|
|
@@ -120,12 +125,13 @@ let ArchitectCommandModule = (() => {
|
|
|
120
125
|
return this.onMissingTarget('Cannot determine project or target for command.');
|
|
121
126
|
}
|
|
122
127
|
for (const project of projectNames) {
|
|
128
|
+
process.title = `${originalProcessTitle} (${project})`;
|
|
123
129
|
result |= await this.runSingleTarget({ configuration, target, project }, architectOptions);
|
|
124
130
|
}
|
|
125
131
|
return result;
|
|
126
132
|
}
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
finally {
|
|
134
|
+
process.title = originalProcessTitle;
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
137
|
getArchitectProject() {
|
|
@@ -125,7 +125,7 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
|
|
|
125
125
|
}
|
|
126
126
|
break;
|
|
127
127
|
case 'array':
|
|
128
|
-
if (Array.isArray(current.default)) {
|
|
128
|
+
if (Array.isArray(current.default) && current.default.length > 0) {
|
|
129
129
|
defaultValue = current.default;
|
|
130
130
|
}
|
|
131
131
|
break;
|
package/src/commands/add/cli.js
CHANGED
|
@@ -43,7 +43,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
43
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
47
46
|
const listr2_1 = require("listr2");
|
|
48
47
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
49
48
|
const node_module_1 = require("node:module");
|
|
@@ -70,6 +69,16 @@ const packageVersionExclusions = {
|
|
|
70
69
|
'@angular/material': '7.x',
|
|
71
70
|
};
|
|
72
71
|
const DEFAULT_CONFLICT_DISPLAY_LIMIT = 5;
|
|
72
|
+
/**
|
|
73
|
+
* A map of packages to built-in schematics.
|
|
74
|
+
* This is used for packages that do not have a native `ng-add` schematic.
|
|
75
|
+
*/
|
|
76
|
+
const BUILT_IN_SCHEMATICS = {
|
|
77
|
+
tailwindcss: {
|
|
78
|
+
collection: '@schematics/angular',
|
|
79
|
+
name: 'tailwind',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
73
82
|
class AddCommandModule extends schematics_command_module_1.SchematicsCommandModule {
|
|
74
83
|
command = 'add <collection>';
|
|
75
84
|
describe = 'Adds support for an external library to your project.';
|
|
@@ -188,8 +197,46 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
188
197
|
try {
|
|
189
198
|
const result = await tasks.run(taskContext);
|
|
190
199
|
(0, node_assert_1.default)(result.collectionName, 'Collection name should always be available');
|
|
200
|
+
// Check if the installed package has actual add actions and not just schematic support
|
|
201
|
+
if (result.hasSchematics && !options.dryRun) {
|
|
202
|
+
const workflow = this.getOrCreateWorkflowForBuilder(result.collectionName);
|
|
203
|
+
const collection = workflow.engine.createCollection(result.collectionName);
|
|
204
|
+
// listSchematicNames cannot be used here since it does not list private schematics.
|
|
205
|
+
// Most `ng-add` schematics are marked as private.
|
|
206
|
+
// TODO: Consider adding a `hasSchematic` helper to the schematic collection object.
|
|
207
|
+
try {
|
|
208
|
+
collection.createSchematic(this.schematicName, true);
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
result.hasSchematics = false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (!result.hasSchematics) {
|
|
215
|
+
// Fallback to a built-in schematic if the package does not have an `ng-add` schematic
|
|
216
|
+
const packageName = result.packageIdentifier.name;
|
|
217
|
+
if (packageName) {
|
|
218
|
+
const builtInSchematic = BUILT_IN_SCHEMATICS[packageName];
|
|
219
|
+
if (builtInSchematic) {
|
|
220
|
+
logger.info(`The ${listr2_1.color.blue(packageName)} package does not provide \`ng add\` actions.`);
|
|
221
|
+
logger.info('The Angular CLI will use built-in actions to add it to your project.');
|
|
222
|
+
return this.executeSchematic({
|
|
223
|
+
...options,
|
|
224
|
+
collection: builtInSchematic.collection,
|
|
225
|
+
schematicName: builtInSchematic.name,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
let message = options.dryRun
|
|
230
|
+
? 'The package does not provide any `ng add` actions, so no further actions would be taken.'
|
|
231
|
+
: 'Package installed successfully. The package does not provide any `ng add` actions, so no further actions were taken.';
|
|
232
|
+
if (result.homepage) {
|
|
233
|
+
message += `\nFor more information about this package, visit its homepage at ${result.homepage}`;
|
|
234
|
+
}
|
|
235
|
+
logger.info(message);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
191
238
|
if (options.dryRun) {
|
|
192
|
-
logger.info(
|
|
239
|
+
logger.info("The package's `ng add` actions would be executed next.");
|
|
193
240
|
return;
|
|
194
241
|
}
|
|
195
242
|
return this.executeSchematic({ ...options, collection: result.collectionName });
|
|
@@ -313,8 +360,10 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
313
360
|
(0, error_1.assertIsError)(e);
|
|
314
361
|
throw new CommandError(`Unable to fetch package information for '${context.packageIdentifier}': ${e.message}`);
|
|
315
362
|
}
|
|
363
|
+
context.hasSchematics = !!manifest.schematics;
|
|
316
364
|
context.savePackage = manifest['ng-add']?.save;
|
|
317
365
|
context.collectionName = manifest.name;
|
|
366
|
+
context.homepage = manifest.homepage;
|
|
318
367
|
if (await this.getPeerDependencyConflicts(manifest)) {
|
|
319
368
|
task.output = listr2_1.color.yellow(listr2_1.figures.warning +
|
|
320
369
|
' Package has unmet peer dependencies. Adding the package may not succeed.');
|
|
@@ -419,30 +468,20 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
419
468
|
}
|
|
420
469
|
return false;
|
|
421
470
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
catch (e) {
|
|
439
|
-
if (e instanceof tools_1.NodePackageDoesNotSupportSchematics) {
|
|
440
|
-
this.context.logger.error('The package that you are trying to add does not support schematics.' +
|
|
441
|
-
'You can try using a different version of the package or contact the package author to add ng-add support.');
|
|
442
|
-
return 1;
|
|
443
|
-
}
|
|
444
|
-
throw e;
|
|
445
|
-
}
|
|
471
|
+
executeSchematic(options) {
|
|
472
|
+
const { verbose, skipConfirmation, interactive, force, dryRun, registry, defaults, collection: collectionName, schematicName, ...schematicOptions } = options;
|
|
473
|
+
return this.runSchematic({
|
|
474
|
+
schematicOptions,
|
|
475
|
+
schematicName: schematicName ?? this.schematicName,
|
|
476
|
+
collectionName,
|
|
477
|
+
executionOptions: {
|
|
478
|
+
interactive,
|
|
479
|
+
force,
|
|
480
|
+
dryRun,
|
|
481
|
+
defaults,
|
|
482
|
+
packageRegistry: registry,
|
|
483
|
+
},
|
|
484
|
+
});
|
|
446
485
|
}
|
|
447
486
|
async findProjectVersion(name) {
|
|
448
487
|
const cachedVersion = this.#projectVersionCache.get(name);
|
|
@@ -14,11 +14,21 @@ import { AnyMcpToolDeclaration } from './tools/tool-registry';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const EXPERIMENTAL_TOOLS: readonly [import("./tools/tool-registry").McpToolDeclaration<{
|
|
16
16
|
query: import("zod").ZodString;
|
|
17
|
-
},
|
|
17
|
+
}, {
|
|
18
|
+
examples: import("zod").ZodArray<import("zod").ZodObject<{
|
|
19
|
+
content: import("zod").ZodString;
|
|
20
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
21
|
+
content: string;
|
|
22
|
+
}, {
|
|
23
|
+
content: string;
|
|
24
|
+
}>, "many">;
|
|
25
|
+
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
18
26
|
transformations: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<[string, ...string[]]>, "many">>;
|
|
19
27
|
}, {
|
|
20
28
|
instructions: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
21
|
-
}
|
|
29
|
+
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
30
|
+
fileOrDirPath: import("zod").ZodString;
|
|
31
|
+
}, import("zod").ZodRawShape>];
|
|
22
32
|
export declare function createMcpServer(options: {
|
|
23
33
|
workspace?: AngularWorkspace;
|
|
24
34
|
readOnly?: boolean;
|
|
@@ -21,6 +21,7 @@ const best_practices_1 = require("./tools/best-practices");
|
|
|
21
21
|
const doc_search_1 = require("./tools/doc-search");
|
|
22
22
|
const examples_1 = require("./tools/examples");
|
|
23
23
|
const modernize_1 = require("./tools/modernize");
|
|
24
|
+
const zoneless_migration_1 = require("./tools/onpush-zoneless-migration/zoneless-migration");
|
|
24
25
|
const projects_1 = require("./tools/projects");
|
|
25
26
|
const tool_registry_1 = require("./tools/tool-registry");
|
|
26
27
|
/**
|
|
@@ -32,7 +33,11 @@ const STABLE_TOOLS = [best_practices_1.BEST_PRACTICES_TOOL, doc_search_1.DOC_SEA
|
|
|
32
33
|
* The set of tools that are available but not enabled by default.
|
|
33
34
|
* These tools are considered experimental and may have limitations.
|
|
34
35
|
*/
|
|
35
|
-
exports.EXPERIMENTAL_TOOLS = [
|
|
36
|
+
exports.EXPERIMENTAL_TOOLS = [
|
|
37
|
+
examples_1.FIND_EXAMPLE_TOOL,
|
|
38
|
+
modernize_1.MODERNIZE_TOOL,
|
|
39
|
+
zoneless_migration_1.ZONELESS_MIGRATION_TOOL,
|
|
40
|
+
];
|
|
36
41
|
async function createMcpServer(options, logger) {
|
|
37
42
|
const server = new mcp_js_1.McpServer({
|
|
38
43
|
name: 'angular-cli-server',
|
|
@@ -17,11 +17,21 @@ const tool_registry_1 = require("./tool-registry");
|
|
|
17
17
|
exports.BEST_PRACTICES_TOOL = (0, tool_registry_1.declareTool)({
|
|
18
18
|
name: 'get_best_practices',
|
|
19
19
|
title: 'Get Angular Coding Best Practices Guide',
|
|
20
|
-
description:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
description: `
|
|
21
|
+
<Purpose>
|
|
22
|
+
Retrieves the official Angular Best Practices Guide. This guide contains the essential rules and conventions
|
|
23
|
+
that **MUST** be followed for any task involving the creation, analysis, or modification of Angular code.
|
|
24
|
+
</Purpose>
|
|
25
|
+
<Use Cases>
|
|
26
|
+
* As a mandatory first step before writing or modifying any Angular code to ensure adherence to modern standards.
|
|
27
|
+
* To learn about key concepts like standalone components, typed forms, and modern control flow syntax (@if, @for, @switch).
|
|
28
|
+
* To verify that existing code aligns with current Angular conventions before making changes.
|
|
29
|
+
</Use Cases>
|
|
30
|
+
<Operational Notes>
|
|
31
|
+
* The content of this guide is non-negotiable and reflects the official, up-to-date standards for Angular development.
|
|
32
|
+
* You **MUST** internalize and apply the principles from this guide in all subsequent Angular-related tasks.
|
|
33
|
+
* Failure to adhere to these best practices will result in suboptimal and outdated code.
|
|
34
|
+
</Operational Notes>`,
|
|
25
35
|
isReadOnly: true,
|
|
26
36
|
isLocalOnly: true,
|
|
27
37
|
factory: () => {
|
|
@@ -9,4 +9,21 @@ import { z } from 'zod';
|
|
|
9
9
|
export declare const DOC_SEARCH_TOOL: import("./tool-registry").McpToolDeclaration<{
|
|
10
10
|
query: z.ZodString;
|
|
11
11
|
includeTopContent: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
12
|
-
},
|
|
12
|
+
}, {
|
|
13
|
+
results: z.ZodArray<z.ZodObject<{
|
|
14
|
+
title: z.ZodString;
|
|
15
|
+
breadcrumb: z.ZodString;
|
|
16
|
+
url: z.ZodString;
|
|
17
|
+
content: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
title: string;
|
|
20
|
+
breadcrumb: string;
|
|
21
|
+
url: string;
|
|
22
|
+
content?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
title: string;
|
|
25
|
+
breadcrumb: string;
|
|
26
|
+
url: string;
|
|
27
|
+
content?: string | undefined;
|
|
28
|
+
}>, "many">;
|
|
29
|
+
}>;
|