Previously, we disabled options in the help output multiple times.
Previous output
```
Generates and/or modifies files based on a schematic.
usage: ng generate c <name> [options]
arguments:
schematic
The schematic or collection:schematic to generate.
name
The name of the component.
options:
--change-detection (-c)
The change detection strategy to use in the new component.
--defaults
When true, disables interactive input prompts for options with a default.
--display-block (-b)
Specifies if the style will contain `:host { display: block; }`.
--dry-run (-d)
When true, runs through and reports activity without writing out results.
--entry-component
When true, the new component is the entry component of the declaring NgModule.
--export
When true, the declaring NgModule exports this component.
--flat
When true, creates the new files at the top level of the current project.
--force (-f)
When true, forces overwriting of existing files.
--help
Shows a help message for this command in the console.
--inline-style (-s)
When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.
--inline-template (-t)
When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
--interactive
When false, disables interactive input prompts.
--lint-fix
When true, applies lint fixes after generating the component.
--module (-m)
The declaring NgModule.
--prefix (-p)
The prefix to apply to the generated component selector.
--project
The name of the project.
--selector
The HTML selector to use for this component.
--skip-import
When true, does not import this component into the owning NgModule.
--skip-selector
Specifies if the component should have a selector or not.
--skip-tests
When true, does not create "spec.ts" test files for the new component.
--style
The file extension or preprocessor to use for style files.
--type
Adds a developer-defined type to the filename, in the format "name.type.ts".
--view-encapsulation (-v)
The view encapsulation strategy to use in the new component.
Help for schematic c
Creates a new generic component definition in the given or default project.
arguments:
name
The name of the component.
options:
--change-detection (-c)
The change detection strategy to use in the new component.
--display-block (-b)
Specifies if the style will contain `:host { display: block; }`.
--entry-component
When true, the new component is the entry component of the declaring NgModule.
--export
When true, the declaring NgModule exports this component.
--flat
When true, creates the new files at the top level of the current project.
--inline-style (-s)
When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.
--inline-template (-t)
When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
--lint-fix
When true, applies lint fixes after generating the component.
--module (-m)
The declaring NgModule.
--prefix (-p)
The prefix to apply to the generated component selector.
--project
The name of the project.
--selector
The HTML selector to use for this component.
--skip-import
When true, does not import this component into the owning NgModule.
--skip-selector
Specifies if the component should have a selector or not.
--skip-tests
When true, does not create "spec.ts" test files for the new component.
--style
The file extension or preprocessor to use for style files.
--type
Adds a developer-defined type to the filename, in the format "name.type.ts".
--view-encapsulation (-v)
The view encapsulation strategy to use in the new component.
To see help for a schematic run:
ng generate <schematic> --help
```
New output
```
Generates and/or modifies files based on a schematic.
usage: ng generate c <name> [options]
arguments:
schematic
The schematic or collection:schematic to generate.
name
The name of the component.
options:
--change-detection (-c)
The change detection strategy to use in the new component.
--defaults
Disable interactive input prompts for options with a default.
--display-block (-b)
Specifies if the style will contain `:host { display: block; }`.
--dry-run (-d)
Run through and reports activity without writing out results.
--export
The declaring NgModule exports this component.
--flat
Create the new files at the top level of the current project.
--force (-f)
Force overwriting of existing files.
--help
Shows a help message for this command in the console.
--inline-style (-s)
Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.
--inline-template (-t)
Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
--interactive
Enable interactive input prompts.
--lint-fix
Apply lint fixes after generating the component.
--module (-m)
The declaring NgModule.
--prefix (-p)
The prefix to apply to the generated component selector.
--project
The name of the project.
--selector
The HTML selector to use for this component.
--skip-import
Do not import this component into the owning NgModule.
--skip-selector
Specifies if the component should have a selector or not.
--skip-tests
Do not create "spec.ts" test files for the new component.
--style
The file extension or preprocessor to use for style files.
--type
Adds a developer-defined type to the filename, in the format "name.type.ts".
--view-encapsulation (-v)
The view encapsulation strategy to use in the new component.
To see help for a schematic run:
ng generate <schematic> --help
```
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
Reading throw #16034 the angular config should be placed in the
`$XDG_CONFIG_HOME/angular/` directory, but if the environmental variable
$XDG_CONFIG_HOME is set the first check of `xdgConfigHome` function will
only put it in the `$XDG_CONFIG_HOME` directory. Also renamed the config
file from `.angular-config.json` to `config.json` when it is in the
`~/.config/angular` directory since it doesn't need to be hidden.
With this change we consider the update schematics are idempotent. When updating from or between prereleases we will execute all migrations for the version.
`tsickle` doesn't be a dependency in users projects, if it is most certain it will cause updates to fail due to mismatching peer dependency on TypeScript.
Deprecated packages that may have been included in a project by the tooling are now ignored when validating an update. This change removes the need to use the `--force` option in a situation where the later migrations will remove and cleanup the deprecated packages.
With the move to refactor and centralize the update logic, the schematics wrapper context needs to be updated to create an exception for the new location of the update schematic.
This change removes the need for the `@schematics/update` package within the Angular tooling and removes the dependency from the `@angular/cli` package.
Only the `update` schematic from the `@schematics/update` package was used and this schematic's logic will eventually be folded into the update command logic directly.
With this change we automate the generation of `@angular/cli/lib/config/schema.json`. While on paper we could use quicktype for this. Quicktype doesn't handle `patternProperties` and `oneOf` that well.
How does this works?
Relative `$ref` will be resolved and inlined as part of the root schema definitions.
Example
```json
"@schematics/angular:enum": {
"$ref": "../../../../schematics/angular/enum/schema.json"
},
```
Will be parsed and transformed to
```json
"@schematics/angular:enum": {
"$ref": "#/definitions/SchematicsAngularEnumSchema"
},
"definitions: {
"SchematicsAngularEnumSchema": {
"title": "Angular Enum Options Schema",
"type": "object",
"description": "Generates a new, generic enum definition for the given or default project.",
"properties": {...}
}
}
```
BREAKING CHANGE:
The `ng add` command will now ask the user to confirm the package and version prior to installing and executing an uninstalled package.
This new behavior allows a user to abort the action if the version selected is not appropriate or if a typo occurred on the command line and an incorrect package would be installed.
A `--skip-confirmation` option has been added to skip the prompt and directly install and execute the package. This option is useful in CI and non-TTY scenarios such as automated scripts.
Errors caused by invalid options or workspace configuration will now be presented as fatal console messages and the CLI will exit gracefully with an exit code of 1.
With this change we deprecated the `--prod` command line argument. This argument is confusing especially to new users, since users expect that this builds an application in production mode. This however, is only an alias for `--configuration="production"`
With this change we remove the dependency on the unmaintained universal-analytics package. We also solve several package deprecation warnings when creating a new workspace.
Closes#16952
This postinstall script was put in place during the v6.0 timeframe to aid users migrating from the v1.x configuration file format by displaying a message instructing the user to run `ng update`.
The `ng update` migration is still functional and users can still use it to migrate from a v1.x project. However, the postinstall script will no longer be run for every install of the Angular CLI.