@angular/cli 15.0.0-next.2 → 15.0.0-next.3
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/config/schema.json +51 -11
- package/package.json +11 -11
- package/src/command-builder/architect-base-command-module.js +1 -1
- package/src/command-builder/command-module.d.ts +8 -1
- package/src/command-builder/command-module.js +22 -2
- package/src/command-builder/schematics-command-module.js +1 -8
package/lib/config/schema.json
CHANGED
|
@@ -1662,8 +1662,22 @@
|
|
|
1662
1662
|
"description": "The full path for the main entry point to the app, relative to the current workspace."
|
|
1663
1663
|
},
|
|
1664
1664
|
"polyfills": {
|
|
1665
|
-
"
|
|
1666
|
-
"
|
|
1665
|
+
"description": "Polyfills to be included in the build.",
|
|
1666
|
+
"oneOf": [
|
|
1667
|
+
{
|
|
1668
|
+
"type": "array",
|
|
1669
|
+
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
|
1670
|
+
"items": {
|
|
1671
|
+
"type": "string",
|
|
1672
|
+
"uniqueItems": true
|
|
1673
|
+
},
|
|
1674
|
+
"default": []
|
|
1675
|
+
},
|
|
1676
|
+
{
|
|
1677
|
+
"type": "string",
|
|
1678
|
+
"description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
|
|
1679
|
+
}
|
|
1680
|
+
]
|
|
1667
1681
|
},
|
|
1668
1682
|
"tsConfig": {
|
|
1669
1683
|
"type": "string",
|
|
@@ -2215,8 +2229,22 @@
|
|
|
2215
2229
|
"description": "The full path for the main entry point to the app, relative to the current workspace."
|
|
2216
2230
|
},
|
|
2217
2231
|
"polyfills": {
|
|
2218
|
-
"
|
|
2219
|
-
"
|
|
2232
|
+
"description": "Polyfills to be included in the build.",
|
|
2233
|
+
"oneOf": [
|
|
2234
|
+
{
|
|
2235
|
+
"type": "array",
|
|
2236
|
+
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
|
2237
|
+
"items": {
|
|
2238
|
+
"type": "string",
|
|
2239
|
+
"uniqueItems": true
|
|
2240
|
+
},
|
|
2241
|
+
"default": []
|
|
2242
|
+
},
|
|
2243
|
+
{
|
|
2244
|
+
"type": "string",
|
|
2245
|
+
"description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
|
|
2246
|
+
}
|
|
2247
|
+
]
|
|
2220
2248
|
},
|
|
2221
2249
|
"tsConfig": {
|
|
2222
2250
|
"type": "string",
|
|
@@ -2900,8 +2928,22 @@
|
|
|
2900
2928
|
"description": "The name of the Karma configuration file."
|
|
2901
2929
|
},
|
|
2902
2930
|
"polyfills": {
|
|
2903
|
-
"
|
|
2904
|
-
"
|
|
2931
|
+
"description": "Polyfills to be included in the build.",
|
|
2932
|
+
"oneOf": [
|
|
2933
|
+
{
|
|
2934
|
+
"type": "array",
|
|
2935
|
+
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
|
2936
|
+
"items": {
|
|
2937
|
+
"type": "string",
|
|
2938
|
+
"uniqueItems": true
|
|
2939
|
+
},
|
|
2940
|
+
"default": []
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
"type": "string",
|
|
2944
|
+
"description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
|
|
2945
|
+
}
|
|
2946
|
+
]
|
|
2905
2947
|
},
|
|
2906
2948
|
"assets": {
|
|
2907
2949
|
"type": "array",
|
|
@@ -3012,6 +3054,9 @@
|
|
|
3012
3054
|
"items": {
|
|
3013
3055
|
"type": "string"
|
|
3014
3056
|
},
|
|
3057
|
+
"default": [
|
|
3058
|
+
"**/*.spec.ts"
|
|
3059
|
+
],
|
|
3015
3060
|
"description": "Globs of files to include, relative to workspace or project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead."
|
|
3016
3061
|
},
|
|
3017
3062
|
"sourceMap": {
|
|
@@ -3413,11 +3458,6 @@
|
|
|
3413
3458
|
"description": "Use file name for lazy loaded chunks.",
|
|
3414
3459
|
"default": false
|
|
3415
3460
|
},
|
|
3416
|
-
"bundleDependencies": {
|
|
3417
|
-
"description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled.",
|
|
3418
|
-
"default": true,
|
|
3419
|
-
"type": "boolean"
|
|
3420
|
-
},
|
|
3421
3461
|
"externalDependencies": {
|
|
3422
3462
|
"description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
|
|
3423
3463
|
"type": "array",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "15.0.0-next.
|
|
3
|
+
"version": "15.0.0-next.3",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.1500.0-next.
|
|
29
|
-
"@angular-devkit/core": "15.0.0-next.
|
|
30
|
-
"@angular-devkit/schematics": "15.0.0-next.
|
|
31
|
-
"@schematics/angular": "15.0.0-next.
|
|
28
|
+
"@angular-devkit/architect": "0.1500.0-next.3",
|
|
29
|
+
"@angular-devkit/core": "15.0.0-next.3",
|
|
30
|
+
"@angular-devkit/schematics": "15.0.0-next.3",
|
|
31
|
+
"@schematics/angular": "15.0.0-next.3",
|
|
32
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
34
|
"debug": "4.3.4",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"ng-update": {
|
|
50
50
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
51
51
|
"packageGroup": {
|
|
52
|
-
"@angular/cli": "15.0.0-next.
|
|
53
|
-
"@angular-devkit/architect": "0.1500.0-next.
|
|
54
|
-
"@angular-devkit/build-angular": "15.0.0-next.
|
|
55
|
-
"@angular-devkit/build-webpack": "0.1500.0-next.
|
|
56
|
-
"@angular-devkit/core": "15.0.0-next.
|
|
57
|
-
"@angular-devkit/schematics": "15.0.0-next.
|
|
52
|
+
"@angular/cli": "15.0.0-next.3",
|
|
53
|
+
"@angular-devkit/architect": "0.1500.0-next.3",
|
|
54
|
+
"@angular-devkit/build-angular": "15.0.0-next.3",
|
|
55
|
+
"@angular-devkit/build-webpack": "0.1500.0-next.3",
|
|
56
|
+
"@angular-devkit/core": "15.0.0-next.3",
|
|
57
|
+
"@angular-devkit/schematics": "15.0.0-next.3"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
@@ -39,7 +39,7 @@ class ArchitectBaseCommandModule extends command_module_1.CommandModule {
|
|
|
39
39
|
await this.reportAnalytics({
|
|
40
40
|
...(await architectHost.getOptionsForTarget(target)),
|
|
41
41
|
...options,
|
|
42
|
-
});
|
|
42
|
+
}, undefined /** paths */, undefined /** dimensions */, builderName);
|
|
43
43
|
const { logger } = this.context;
|
|
44
44
|
const run = await this.getArchitect().scheduleTarget(target, options, {
|
|
45
45
|
logger,
|
|
@@ -74,7 +74,7 @@ export declare abstract class CommandModule<T extends {} = {}> implements Comman
|
|
|
74
74
|
abstract builder(argv: Argv): Promise<Argv<T>> | Argv<T>;
|
|
75
75
|
abstract run(options: Options<T> & OtherOptions): Promise<number | void> | number | void;
|
|
76
76
|
handler(args: ArgumentsCamelCase<T> & OtherOptions): Promise<void>;
|
|
77
|
-
reportAnalytics(options: (Options<T> & OtherOptions) | OtherOptions, paths?: string[], dimensions?: (boolean | number | string)[]): Promise<void>;
|
|
77
|
+
reportAnalytics(options: (Options<T> & OtherOptions) | OtherOptions, paths?: string[], dimensions?: (boolean | number | string)[], title?: string): Promise<void>;
|
|
78
78
|
protected getAnalytics(): Promise<analytics.Analytics>;
|
|
79
79
|
/**
|
|
80
80
|
* Adds schema options to a command also this keeps track of options that are required for analytics.
|
|
@@ -82,6 +82,13 @@ export declare abstract class CommandModule<T extends {} = {}> implements Comman
|
|
|
82
82
|
*/
|
|
83
83
|
protected addSchemaOptionsToCommand<T>(localYargs: Argv<T>, options: Option[]): Argv<T>;
|
|
84
84
|
protected getWorkspaceOrThrow(): AngularWorkspace;
|
|
85
|
+
/**
|
|
86
|
+
* Flush on an interval (if the event loop is waiting).
|
|
87
|
+
*
|
|
88
|
+
* @returns a method that when called will terminate the periodic
|
|
89
|
+
* flush and call flush one last time.
|
|
90
|
+
*/
|
|
91
|
+
private periodicAnalyticsFlush;
|
|
85
92
|
}
|
|
86
93
|
/**
|
|
87
94
|
* Creates an known command module error.
|
|
@@ -99,8 +99,10 @@ class CommandModule {
|
|
|
99
99
|
}
|
|
100
100
|
// Gather and report analytics.
|
|
101
101
|
const analytics = await this.getAnalytics();
|
|
102
|
+
let stopPeriodicFlushes;
|
|
102
103
|
if (this.shouldReportAnalytics) {
|
|
103
104
|
await this.reportAnalytics(camelCasedOptions);
|
|
105
|
+
stopPeriodicFlushes = this.periodicAnalyticsFlush(analytics);
|
|
104
106
|
}
|
|
105
107
|
let exitCode;
|
|
106
108
|
try {
|
|
@@ -109,7 +111,6 @@ class CommandModule {
|
|
|
109
111
|
exitCode = await this.run(camelCasedOptions);
|
|
110
112
|
const endTime = Date.now();
|
|
111
113
|
analytics.timing(this.commandName, 'duration', endTime - startTime);
|
|
112
|
-
await analytics.flush();
|
|
113
114
|
}
|
|
114
115
|
catch (e) {
|
|
115
116
|
if (e instanceof core_1.schema.SchemaValidationException) {
|
|
@@ -121,12 +122,13 @@ class CommandModule {
|
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
finally {
|
|
125
|
+
await (stopPeriodicFlushes === null || stopPeriodicFlushes === void 0 ? void 0 : stopPeriodicFlushes());
|
|
124
126
|
if (typeof exitCode === 'number' && exitCode > 0) {
|
|
125
127
|
process.exitCode = exitCode;
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
|
-
async reportAnalytics(options, paths = [], dimensions = []) {
|
|
131
|
+
async reportAnalytics(options, paths = [], dimensions = [], title) {
|
|
130
132
|
for (const [name, ua] of this.optionsWithAnalytics) {
|
|
131
133
|
const value = options[name];
|
|
132
134
|
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
@@ -137,6 +139,7 @@ class CommandModule {
|
|
|
137
139
|
analytics.pageview('/command/' + [this.commandName, ...paths].join('/'), {
|
|
138
140
|
dimensions,
|
|
139
141
|
metrics: [],
|
|
142
|
+
title,
|
|
140
143
|
});
|
|
141
144
|
}
|
|
142
145
|
getAnalytics() {
|
|
@@ -204,6 +207,23 @@ class CommandModule {
|
|
|
204
207
|
}
|
|
205
208
|
return workspace;
|
|
206
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Flush on an interval (if the event loop is waiting).
|
|
212
|
+
*
|
|
213
|
+
* @returns a method that when called will terminate the periodic
|
|
214
|
+
* flush and call flush one last time.
|
|
215
|
+
*/
|
|
216
|
+
periodicAnalyticsFlush(analytics) {
|
|
217
|
+
let analyticsFlushPromise = Promise.resolve();
|
|
218
|
+
const analyticsFlushInterval = setInterval(() => {
|
|
219
|
+
analyticsFlushPromise = analyticsFlushPromise.then(() => analytics.flush());
|
|
220
|
+
}, 2000);
|
|
221
|
+
return () => {
|
|
222
|
+
clearInterval(analyticsFlushInterval);
|
|
223
|
+
// Flush one last time.
|
|
224
|
+
return analyticsFlushPromise.then(() => analytics.flush());
|
|
225
|
+
};
|
|
226
|
+
}
|
|
207
227
|
}
|
|
208
228
|
__decorate([
|
|
209
229
|
memoize_1.memoize
|
|
@@ -128,16 +128,9 @@ class SchematicsCommandModule extends command_module_1.CommandModule {
|
|
|
128
128
|
workflow.registry.addSmartDefaultProvider('workingDirectory', () => workingDir === '' ? undefined : workingDir);
|
|
129
129
|
let shouldReportAnalytics = true;
|
|
130
130
|
workflow.engineHost.registerOptionsTransform(async (schematic, options) => {
|
|
131
|
-
var _a;
|
|
132
131
|
if (shouldReportAnalytics) {
|
|
133
132
|
shouldReportAnalytics = false;
|
|
134
|
-
|
|
135
|
-
const commandName = (_a = this.command) === null || _a === void 0 ? void 0 : _a.split(' ', 1)[0];
|
|
136
|
-
await this.reportAnalytics(options, [
|
|
137
|
-
commandName,
|
|
138
|
-
schematic.collection.name.replace(/\//g, '_'),
|
|
139
|
-
schematic.name.replace(/\//g, '_'),
|
|
140
|
-
]);
|
|
133
|
+
await this.reportAnalytics(options, undefined /** paths */, undefined /** dimensions */, schematic.collection.name + ':' + schematic.name);
|
|
141
134
|
}
|
|
142
135
|
// TODO: The below should be removed in version 15 when we change 1P schematics to use the `workingDirectory smart default`.
|
|
143
136
|
// Handle `"format": "path"` options.
|