It's now possible to use multiple configurations by separating them with a comma:
```
ng build --configuration=one,two,three
```
They will be applied from left to right. If `--prod` is also present, it will be considered to be the first configuration and thus able to be overriden.
You can also use it in target strings:
```
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "latest-project:build:one,two"
},
"configurations": {
"production": {
"browserTarget": "latest-project:build:production,one,two"
}
}
```
Fix https://github.com/angular/angular-cli/issues/10612
This PR provides a way for subclass that extends `SchematicCommand` to
provide a different default collection name.
This is needed in g3 where the collection name is different from
external.
Fix#14986
This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.
We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.
Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.
An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
On prompt only, does not contain any user info. Since prompt should be only
shown at install or first run, this is not going to ping more than once and
the users privacy is also protected.
As the JSON Schema validation is minimum in the CLI, we have to also validate in code.
This PR:
- updates the JSON Schema to use `number` and `enum` instead of `integer` and `const` that are not supported.
- adds validation in the doc command implementation
- adds error reporting if the version is not valid
- fixes a typo in an error message in the parser
Currently, upon execution `ng` will load all description files AND code for all available commands. This requires a large amount of unnecessary file access and processing since only at most one command will be executed. This change limits the loading to only command being executed in the common case and a subset of commands in the event an alias is used. The help command now loads all commands during its execution which is needed to gather command description information. Further improvements are possible by only loading the necessary metadata instead of the execution code (and its dependencies) as well.
This change allows for savings of ~250ms per execution.
Examples:
Before -- `./node_modules/.bin/ng version 0.99s user 0.17s system 113% cpu 1.020 total`
After -- `./node_modules/.bin/ng version 0.70s user 0.13s system 110% cpu 0.749 total`
Before -- `./node_modules/.bin/ng g c a 1.91s user 0.30s system 111% cpu 1.996 total`
After -- `./node_modules/.bin/ng g c a 1.62s user 0.27s system 110% cpu 1.715 total`
This happens if there is no file at all (otherwise it would be undefined). This was
causing an exception and returning false instead of undefined, preventing the
prompt. Now we return undefined in this case.
To be clear, this is because getWorkspace returns null, and the logic makes
analyticsConfig null in this case.
Some commands (like schematics) need to have custom reporting for
analytics. Schematics and Architect commands need to verify if the
schematic/architect builder run is in the safelist, for example.
As `parser.ts` currently always adds a period at the end of the warning message and the `x-deprecated` messages also have one, this removes the always added one to avoid a double period in the warning message.
Fixes:
Option "styleext" is deprecated: Use "style" instead..
to:
Option "styleext" is deprecated: Use "style" instead.