With this change we deprecate the angular.json `defaultProject` option.
DEPRECATED:
The `defaultProject` workspace option has been deprecated. The project to use will be determined from the current working directory.
Closes#20661
With this change we create a new command `ng cache` that can be used control and check the disk cache settings.
This command has 4 subcommands
- `ng cache enable` which can be used to enable the cache.
- `ng cache disable` which can be used to disable the cache.
- `ng cache clean` which can be used to delete the cache from disk.
- `ng cache info` which will print statistics and information about the cache.
With this change we clean up further the analytics code and re-use the `getAnalytics` to determine if the config is set or not.
Also, this change inclused a refactor to the `createAnalytics` method to make it more readable.
With this change we add a subcommand to `ng analytics`. This command can be used tp display analytics gathering and reporting configuration.
Example:
```
$ ng analytics info
Global setting: disabled
Local setting: enabled
Effective status: disabled
```
With this change we add a `--global` option to `ng analytics` command.
BREAKING CHANGE:
Several changes to the `ng analytics` command syntax.
- `ng analytics project <setting>` has been replaced with `ng analytics <setting>`
- `ng analytics <setting>` has been replaced with `ng analytics <setting> --global`
When running architect command such as `ng build`, `ng test`, `ng lint`... and no project is provided as a positional argument. The project in the current working directory is favored instead of the configured as default project.
This addresses the issue when trying to disable analytics the prompt will be shown
```
ng analytics off
Would you like to share anonymous usage data about this project with the Angular Team at Google under Google’s Privacy Policy at https://policies.google.com/privacy? For more details and how to change this setting, see http://angular.io/analytics. (y/N)
```
Closes#16784
(cherry picked from commit 9a9bd3f2ac22211dc6e8a47be582c5e1390189d7)
With this change we remove the JSON serialized description from the help output and also align the description properties between commands and subcommands.
With this change we update yargs help method to output help in JSON format which is needed to generate the documents that are used to generate AIO man pages.
With this change we refactor the Angular CLI and replace the underlying args parser and command builder. We choose to use Yargs as our parser and command builder of choice. The main advantages of Yargs over other command builders are;
- Highly configurable.
- We already use it in other packages such as the compiler-cli/dev-infra etc..
- Commands and options can be added during runtime. This is a requirement that is needed to support architect and schematics commands.
- Outstanding documentation.
- The possibility to parse args without parser configuration (Free form).
- Commands are built lazily based on the arguments passed.
BREAKING CHANGE:
Several changes in the Angular CLI commands and arguments handling.
- `ng help` has been removed in favour of the `—-help` option.
- `ng —-version` has been removed in favour of `ng version` and `ng v`.
- Deprecated camel cased arguments are no longer supported. Ex. using `—-sourceMap` instead of `—-source-map` will result in an error.
- `ng update`, `—-migrate-only` option no longer accepts a string of migration name, instead use `—-migrate-only -—name <migration-name>`.
- `—-help json` help has been removed.
Closes#20976, closes#16614 and closes#16241
Node.js v12 will become EOL on 2022-04-30. As a result, Angular CLI v14 will no longer support Node.js v12.
BREAKING CHANGE:
Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later.
BREAKING CHANGE:
Deprecated option `--prod` has been removed from all builders. `--configuration production`/`-c production` should be used instead if the default configuration of the builder is not configured to `production`.
BREAKING CHANGE:
`--all` option from `ng update` has been removed without replacement. To update packages which don’t provide `ng update` capabilities in your workspace `package.json` use `npm update`, `yarn upgrade-interactive` or `yarn upgrade` instead.