@angular/cli 21.0.0-next.0 → 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 +37 -5
- package/lib/config/workspace-schema.d.ts +41 -2
- package/lib/config/workspace-schema.js +13 -2
- package/package.json +19 -19
- package/src/command-builder/architect-command-module.js +11 -5
- package/src/command-builder/schematics-command-module.js +7 -2
- package/src/command-builder/utilities/json-schema.js +5 -1
- package/src/command-builder/utilities/schematic-engine-host.js +4 -6
- package/src/commands/add/cli.d.ts +2 -1
- package/src/commands/add/cli.js +178 -94
- 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 -27
- 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/commands/update/schematic/schema.d.ts +0 -1
- package/src/commands/update/schematic/schema.js +0 -1
- package/src/commands/update/schematic/schema.json +1 -1
- package/src/utilities/version.js +1 -1
package/lib/code-examples.db
CHANGED
|
Binary file
|
package/lib/config/schema.json
CHANGED
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"type": "string",
|
|
52
52
|
"enum": [
|
|
53
53
|
"npm",
|
|
54
|
-
"cnpm",
|
|
55
54
|
"yarn",
|
|
56
55
|
"pnpm",
|
|
57
56
|
"bun"
|
|
@@ -118,7 +117,6 @@
|
|
|
118
117
|
"type": "string",
|
|
119
118
|
"enum": [
|
|
120
119
|
"npm",
|
|
121
|
-
"cnpm",
|
|
122
120
|
"yarn",
|
|
123
121
|
"pnpm",
|
|
124
122
|
"bun"
|
|
@@ -1007,7 +1005,8 @@
|
|
|
1007
1005
|
"css",
|
|
1008
1006
|
"scss",
|
|
1009
1007
|
"sass",
|
|
1010
|
-
"less"
|
|
1008
|
+
"less",
|
|
1009
|
+
"tailwind"
|
|
1011
1010
|
]
|
|
1012
1011
|
},
|
|
1013
1012
|
"skipTests": {
|
|
@@ -1050,6 +1049,15 @@
|
|
|
1050
1049
|
"description": "Generate an application that does not use `zone.js`.",
|
|
1051
1050
|
"type": "boolean",
|
|
1052
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)."
|
|
1053
1061
|
}
|
|
1054
1062
|
}
|
|
1055
1063
|
},
|
|
@@ -1197,6 +1205,11 @@
|
|
|
1197
1205
|
"type": "string",
|
|
1198
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`."
|
|
1199
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
|
+
},
|
|
1200
1213
|
"skipTests": {
|
|
1201
1214
|
"type": "boolean",
|
|
1202
1215
|
"description": "Skip the generation of unit test files `spec.ts`.",
|
|
@@ -1326,6 +1339,11 @@
|
|
|
1326
1339
|
"type": {
|
|
1327
1340
|
"type": "string",
|
|
1328
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."
|
|
1329
1347
|
}
|
|
1330
1348
|
}
|
|
1331
1349
|
},
|
|
@@ -1769,7 +1787,8 @@
|
|
|
1769
1787
|
"css",
|
|
1770
1788
|
"scss",
|
|
1771
1789
|
"sass",
|
|
1772
|
-
"less"
|
|
1790
|
+
"less",
|
|
1791
|
+
"tailwind"
|
|
1773
1792
|
]
|
|
1774
1793
|
},
|
|
1775
1794
|
"skipTests": {
|
|
@@ -1800,7 +1819,6 @@
|
|
|
1800
1819
|
"npm",
|
|
1801
1820
|
"yarn",
|
|
1802
1821
|
"pnpm",
|
|
1803
|
-
"cnpm",
|
|
1804
1822
|
"bun"
|
|
1805
1823
|
]
|
|
1806
1824
|
},
|
|
@@ -1833,6 +1851,15 @@
|
|
|
1833
1851
|
"windsurf"
|
|
1834
1852
|
]
|
|
1835
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)."
|
|
1836
1863
|
}
|
|
1837
1864
|
}
|
|
1838
1865
|
},
|
|
@@ -1934,6 +1961,11 @@
|
|
|
1934
1961
|
"type": {
|
|
1935
1962
|
"type": "string",
|
|
1936
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."
|
|
1937
1969
|
}
|
|
1938
1970
|
}
|
|
1939
1971
|
},
|
|
@@ -67,7 +67,6 @@ export declare enum Environment {
|
|
|
67
67
|
*/
|
|
68
68
|
export declare enum PackageManager {
|
|
69
69
|
Bun = "bun",
|
|
70
|
-
Cnpm = "cnpm",
|
|
71
70
|
Npm = "npm",
|
|
72
71
|
Pnpm = "pnpm",
|
|
73
72
|
Yarn = "yarn"
|
|
@@ -106,6 +105,13 @@ export type SchematicOptions = {
|
|
|
106
105
|
* routing, styling, and testing.
|
|
107
106
|
*/
|
|
108
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;
|
|
109
115
|
/**
|
|
110
116
|
* Include the styles for the root component directly within the `app.component.ts` file.
|
|
111
117
|
* Only CSS styles can be included inline. By default, a separate stylesheet file (e.g.,
|
|
@@ -187,6 +193,16 @@ export type AngularApplicationOptionsSchema = {
|
|
|
187
193
|
*/
|
|
188
194
|
zoneless?: boolean;
|
|
189
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
|
+
}
|
|
190
206
|
/**
|
|
191
207
|
* The type of stylesheet files to be created for components in the application.
|
|
192
208
|
*
|
|
@@ -196,7 +212,8 @@ export declare enum SchematicsAngularApplicationStyle {
|
|
|
196
212
|
Css = "css",
|
|
197
213
|
Less = "less",
|
|
198
214
|
Sass = "sass",
|
|
199
|
-
Scss = "scss"
|
|
215
|
+
Scss = "scss",
|
|
216
|
+
Tailwind = "tailwind"
|
|
200
217
|
}
|
|
201
218
|
/**
|
|
202
219
|
* Sets the view encapsulation mode for the application's components. This determines how
|
|
@@ -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
|
*/
|
|
@@ -20,11 +20,21 @@ var Environment;
|
|
|
20
20
|
var PackageManager;
|
|
21
21
|
(function (PackageManager) {
|
|
22
22
|
PackageManager["Bun"] = "bun";
|
|
23
|
-
PackageManager["Cnpm"] = "cnpm";
|
|
24
23
|
PackageManager["Npm"] = "npm";
|
|
25
24
|
PackageManager["Pnpm"] = "pnpm";
|
|
26
25
|
PackageManager["Yarn"] = "yarn";
|
|
27
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 = {}));
|
|
28
38
|
/**
|
|
29
39
|
* The type of stylesheet files to be created for components in the application.
|
|
30
40
|
*
|
|
@@ -36,6 +46,7 @@ var SchematicsAngularApplicationStyle;
|
|
|
36
46
|
SchematicsAngularApplicationStyle["Less"] = "less";
|
|
37
47
|
SchematicsAngularApplicationStyle["Sass"] = "sass";
|
|
38
48
|
SchematicsAngularApplicationStyle["Scss"] = "scss";
|
|
49
|
+
SchematicsAngularApplicationStyle["Tailwind"] = "tailwind";
|
|
39
50
|
})(SchematicsAngularApplicationStyle || (exports.SchematicsAngularApplicationStyle = SchematicsAngularApplicationStyle = {}));
|
|
40
51
|
/**
|
|
41
52
|
* Sets the view encapsulation mode for the application's components. This determines how
|
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.
|
|
31
|
-
"@inquirer/prompts": "7.8.
|
|
32
|
-
"@listr2/prompt-adapter-inquirer": "3.0.
|
|
33
|
-
"@modelcontextprotocol/sdk": "1.17.
|
|
34
|
-
"@schematics/angular": "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
|
+
"@inquirer/prompts": "7.8.4",
|
|
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() {
|
|
@@ -224,13 +224,18 @@ let SchematicsCommandModule = (() => {
|
|
|
224
224
|
? {
|
|
225
225
|
name: item,
|
|
226
226
|
value: item,
|
|
227
|
-
checked:
|
|
227
|
+
checked: definition.multiselect && Array.isArray(definition.default)
|
|
228
|
+
? definition.default?.includes(item)
|
|
229
|
+
: item === definition.default,
|
|
228
230
|
}
|
|
229
231
|
: {
|
|
230
232
|
...item,
|
|
231
233
|
name: item.label,
|
|
232
234
|
value: item.value,
|
|
233
|
-
checked:
|
|
235
|
+
checked: definition.multiselect && Array.isArray(definition.default)
|
|
236
|
+
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
237
|
+
definition.default?.includes(item.value)
|
|
238
|
+
: item.value === definition.default,
|
|
234
239
|
}),
|
|
235
240
|
});
|
|
236
241
|
break;
|
|
@@ -120,11 +120,15 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
|
|
|
120
120
|
if (current.default !== undefined) {
|
|
121
121
|
switch (types[0]) {
|
|
122
122
|
case 'string':
|
|
123
|
-
case 'array':
|
|
124
123
|
if (typeof current.default == 'string') {
|
|
125
124
|
defaultValue = current.default;
|
|
126
125
|
}
|
|
127
126
|
break;
|
|
127
|
+
case 'array':
|
|
128
|
+
if (Array.isArray(current.default) && current.default.length > 0) {
|
|
129
|
+
defaultValue = current.default;
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
128
132
|
case 'number':
|
|
129
133
|
if (typeof current.default == 'number') {
|
|
130
134
|
defaultValue = current.default;
|
|
@@ -47,11 +47,9 @@ function shouldWrapSchematic(schematicFile, schematicEncapsulation) {
|
|
|
47
47
|
}
|
|
48
48
|
// Check for first-party Angular schematic packages
|
|
49
49
|
// Angular schematics are safe to use in the wrapped VM context
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// Otherwise use the value of the schematic collection's encapsulation option (current default of false)
|
|
54
|
-
return schematicEncapsulation;
|
|
50
|
+
const isFirstParty = /\/node_modules\/@(?:angular|schematics|nguniversal)\//.test(normalizedSchematicFile);
|
|
51
|
+
// Use value of defined option if present, otherwise default to first-party usage.
|
|
52
|
+
return schematicEncapsulation ?? isFirstParty;
|
|
55
53
|
}
|
|
56
54
|
class SchematicEngineHost extends tools_1.NodeModulesEngineHost {
|
|
57
55
|
_resolveReferenceString(refString, parentPath, collectionDescription) {
|
|
@@ -60,7 +58,7 @@ class SchematicEngineHost extends tools_1.NodeModulesEngineHost {
|
|
|
60
58
|
const fullPath = path[0] === '.' ? (0, node_path_1.resolve)(parentPath ?? process.cwd(), path) : path;
|
|
61
59
|
const referenceRequire = (0, node_module_1.createRequire)(__filename);
|
|
62
60
|
const schematicFile = referenceRequire.resolve(fullPath, { paths: [parentPath] });
|
|
63
|
-
if (shouldWrapSchematic(schematicFile,
|
|
61
|
+
if (shouldWrapSchematic(schematicFile, collectionDescription?.encapsulation)) {
|
|
64
62
|
const schematicPath = (0, node_path_1.dirname)(schematicFile);
|
|
65
63
|
const moduleCache = new Map();
|
|
66
64
|
const factoryInitializer = wrap(schematicFile, schematicPath, moduleCache, name || 'default');
|
|
@@ -15,6 +15,7 @@ interface AddCommandArgs extends SchematicsCommandArgs {
|
|
|
15
15
|
'skip-confirmation'?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export default class AddCommandModule extends SchematicsCommandModule implements CommandModuleImplementation<AddCommandArgs> {
|
|
18
|
+
#private;
|
|
18
19
|
command: string;
|
|
19
20
|
describe: string;
|
|
20
21
|
longDescriptionPath: string;
|
|
@@ -33,6 +34,6 @@ export default class AddCommandModule extends SchematicsCommandModule implements
|
|
|
33
34
|
private isPackageInstalled;
|
|
34
35
|
private executeSchematic;
|
|
35
36
|
private findProjectVersion;
|
|
36
|
-
private
|
|
37
|
+
private getPeerDependencyConflicts;
|
|
37
38
|
}
|
|
38
39
|
export {};
|