849 Commits

Author SHA1 Message Date
Alan Agius
036327e9ca feat(@angular/cli): deprecated defaultProject option
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
2022-03-21 12:28:15 -07:00
Alan Agius
e5bf35ea30 feat(@angular/cli): add ng cache command
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.
2022-03-18 13:52:07 -07:00
Alan Agius
eef17b3fc5 refactor(@angular/cli): group and move all env variables into a single file 2022-03-18 13:52:07 -07:00
Renovate Bot
becd7b6ed9 build: update all non-major dependencies 2022-03-18 11:45:03 -07:00
Alan Agius
8a396de6a8 fix(@angular/cli): print entire config when no positional args are provided to ng config
This fixes a regression were when no positional args are provided to `ng config` the entire config file should to be printed in the console.
2022-03-18 11:44:46 -07:00
Alan Agius
5a8bdeb434 fix(@angular/cli): hide private schematics from ng g help output
With this change we don't display private schematic in `ng generate` help output.
2022-03-18 11:44:12 -07:00
Alan Agius
8e66c9188b fix(@angular/cli): ng g show descrption from collection.json if not present in schema.json
Wiht this change we show the descrption from `collection.json` if not present in schematic `schema.json` in  `ng generate` help output
2022-03-18 11:44:12 -07:00
Alan Agius
a497d12a6b refactor(@angular/cli): remove hasAnalyticsConfig analytics logic
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.
2022-03-16 11:36:10 -07:00
Renovate Bot
1a36fd94a8 build: update all non-major dependencies 2022-03-16 14:15:50 -04:00
Alan Agius
c0fe0626d5 build: handle default sub command in json help output
This change is needed to handle default subcommands which are used in `ng generate` default subcommands are prefixed with `$0` or `*`.

More info: https://github.com/yargs/yargs/blob/main/docs/advanced.md#default-commands
2022-03-16 10:07:44 -04:00
Alan Agius
d560e23d67 refactor(@angular/cli): remove old CommandModule and SchematicCommand implementations
Use the newly implemented `CommandModule` and `SchematicsCommandModule`.
2022-03-16 10:07:44 -04:00
Alan Agius
154236501f refactor(@angular/cli): add package manager in command context 2022-03-16 10:07:44 -04:00
Alan Agius
7ab22ed40d feat(@angular/cli): add disable/enable aliases for off/on ng analytics command
`ng analytics enable/disable`better aligns with `ng cache enable/disable` that will be available in the future.
2022-03-15 16:31:07 -04:00
Alan Agius
46a7be3af4 refactor(@angular/cli): clean up analytics methods
Re-use methods were possible.
2022-03-15 16:31:07 -04:00
Alan Agius
bb550436a4 feat(@angular/cli): add ng analytics info command
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
```
2022-03-15 16:31:07 -04:00
Alan Agius
afafa5788f feat(@angular/cli): add --global option to ng analytics command
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`
2022-03-15 16:31:07 -04:00
Renovate Bot
9c8b3a16f6 build: update all non-major dependencies 2022-03-15 11:06:45 -04:00
Alan Agius
054ae02c2f fix(@angular/cli): favor project in cwd when running architect commands
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.
2022-03-14 15:36:08 -04:00
Alan Agius
ca401255f4 fix(@angular/cli): sort commands in help output 2022-03-14 15:26:49 -04:00
Alan Agius
b1885856a7 docs(@angular/cli): improve several ng update option descriptions 2022-03-14 10:20:48 -04:00
Alan Agius
a49cdfbfef fix(@angular/cli): don't prompt for analytics when running ng analytics
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)
2022-03-14 10:20:32 -04:00
Alan Agius
96a0d92da2 fix(@angular/cli): remove JSON serialized description from help output
With this change we remove the JSON serialized description from the help output and also align the description properties between commands and subcommands.
2022-03-10 15:36:03 -05:00
Alan Agius
9edeb86146 fix(@angular/cli): add long description to ng update
The long-description.md was not referenced in `UpdateCommandModule`.
2022-03-10 15:35:52 -05:00
Alan Agius
6d37ffcd66 refactor(@angular/cli): replace longDescription line endings with \n
Needed to fix Windows CI
2022-03-10 14:43:33 -05:00
Alan Agius
a6d78a961a refactor(@angular/cli): always use posix separator in longDescriptionRelativePath
Needed for consistency that will fix a Windows CI failure
2022-03-09 21:59:26 +01:00
Renovate Bot
8673e3d36b build: update all non-major dependencies 2022-03-09 17:43:38 +01:00
Alan Agius
92528b1df3 refactor(@angular/cli): several small refactoring and code quality improvements
This PR brings a number of small refactors to improve code quality in the new args parser implementation.
2022-03-09 17:18:53 +01:00
Alan Agius
33ec5e7a04 refactor(@angular/cli): remove unnecessary castings and types 2022-03-09 17:18:53 +01:00
Alan Agius
98984bfcb8 refactor(@angular/cli): move move architect common logic into a base class 2022-03-09 17:18:53 +01:00
Alan Agius
10cce2c86e refactor(@angular/cli): re-organize the Angular CLI package folder structure 2022-03-09 17:18:53 +01:00
Alan Agius
29c2b3a360 refactor(@angular/cli): introspect yargs to generate JSON Help
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.
2022-03-09 17:18:53 +01:00
Alan Agius
2e0493130a refactor(@angular/cli): replace command line arguments parser
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
2022-03-09 17:18:53 +01:00
Alan Agius
4ebfe03415 feat(@angular/cli): drop support for Node.js 12
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.
2022-03-04 22:38:45 +01:00
Renovate Bot
4df12dc121 build: update all non-major dependencies 2022-03-01 10:39:10 -08:00
Alan Agius
e529fb8417 refactor(@angular/cli): remove unused INITIAL_COMMIT_MESSAGE text file
This file is no longer used.
2022-02-25 11:41:08 -05:00
Renovate Bot
3c31c22ba6 build: update all non-major dependencies 2022-02-17 19:02:19 +01:00
Renovate Bot
1fca0f10d3 build: update dependency pacote to v13 2022-02-16 12:21:21 +01:00
Alan Agius
f6984d531e refactor(@angular/cli): remove node.js check in extract-i18n
This is redundant since this is covered by e4e15058cb/packages/angular/cli/lib/cli/index.ts (L26)
2022-02-11 16:42:25 +01:00
Alan Agius
b69ca3a7d2 refactor(@angular/cli): remove deprecated command aliases for extract-i18n.
BREAKING CHANGE:

Deprecated `ng x18n` and `ng i18n-extract` commands have been removed in favor of `ng extract-i18n`.
2022-02-11 16:42:25 +01:00
Renovate Bot
0096ffe4f8 build: update dependency npm-package-arg to v9 2022-02-11 15:32:37 +01:00
Renovate Bot
5792a2f70c build: update dependency npm-pick-manifest to v7 2022-02-11 12:59:10 +01:00
Alan Agius
73746faee9 refactor(@angular/cli): remove support for legacy Angular CLI version 1 configurations
Remove references to legacy Angular CLI version 1 configurations. By now users should have been migrated to use the new configuration.
2022-02-07 10:53:18 +00:00
Alan Agius
9e69331fa6 feat(@angular/cli): use PNPM as package manager when pnpm-lock.yaml exists
While supported, we didn't automatically try to determine if PNPM was used through the lock files like we do for other package managers.
2022-02-07 10:53:18 +00:00
Alan Agius
fafb9ddd58 docs(@angular/cli): update @angular/cli package readme
Previously, the `@angular/cli` readme contained a lot of un-needed information for application users
2022-02-02 11:49:03 -08:00
Alan Agius
2fc7c73d7e refactor(@angular/cli): remove deprecated --prod flag
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`.
2022-01-28 11:01:37 -08:00
Alan Agius
d94a67353d refactor(@angular/cli): remove deprecated --all option from ng update
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.
2022-01-27 11:06:51 -08:00
Renovate Bot
5c5230861c build: update all non-major dependencies 2022-01-26 10:44:30 +01:00
Alan Agius
e9684b2fd2 build: update all non-major dependencies 2022-01-24 12:54:31 +01:00
Renovate Bot
f8eb40e58a build: update all non-major dependencies 2022-01-21 12:51:20 +01:00
Derek Cormier
4721b2796c build: correctly stamp experimental packages in bazel build 2022-01-21 12:50:53 +01:00