1779 Commits

Author SHA1 Message Date
Renovate Bot
1fd3893c29 build: update angular 2022-04-14 12:05:58 +02:00
Charles Lyding
c94e6fba4f test: change prod-build E2E bootstrap check to allow underscore in variable name 2022-04-13 13:54:22 -07:00
Charles Lyding
d144caa5f2 test: use yargs-parser in E2E test suite runner
The `minimist` package that was previously used is no longer a dependency of the project
and was only working due to package hoisting.
2022-04-13 12:08:44 -07:00
Alan Agius
607a723f7d feat(@angular/cli): add support for auto completion
To enable bash and zsh real-time type-ahead autocompletion, copy and paste the generated script by the `ng completion` command to your `.bashrc`, `.bash_profile`, `.zshrc` or `.zsh_profile`.

Closes #11043
2022-04-13 12:07:45 -07:00
Renovate Bot
bf891c3b42 build: update angular to 0e12514 2022-04-12 10:36:42 -07:00
Renovate Bot
e88c48092f build: update angular to 89573ed 2022-04-11 11:47:32 -07:00
Alan Agius
ff4eba3d4a fix(@angular/cli): handle duplicate arguments
With this change we add a Yargs middleware that normalizes non Array options when the argument has been provided multiple times.

By default, when an option is non array and it is provided multiple times in the command line, yargs
will not override it's value but instead it will be changed to an array unless `duplicate-arguments-array` is disabled.
But this option also have an effect on real array options which isn't desired.

See: https://github.com/yargs/yargs-parser/pull/163#issuecomment-516566614

Closes #22956
2022-04-11 11:46:00 -07:00
Renovate Bot
3909528c08 build: update angular 2022-04-08 09:37:47 -07:00
Renovate Bot
725e326661 build: update angular to 7c6fc3e 2022-04-06 13:01:00 -04:00
Alan Agius
0316dea676 feat(@angular/cli): add prompts on missing builder targets
With this change we add prompts to `ng deploy` and `ng e2e` to facilitate adding packages that offer these capabalities.

We also add back `ng lint` prompt to add ESLint which was removed by mistake during the commands refactoring.
2022-04-06 10:41:07 -04:00
Renovate Bot
d163229a5f build: update angular to 2fbc7c8 2022-04-04 10:08:20 -04:00
Renovate Bot
f6965fe4f8 build: update angular 2022-03-31 17:13:42 -04:00
Renovate Bot
f2598a4d57 build: update angular to 7c2e257 2022-03-30 10:37:38 +02:00
Alan Agius
efc3c32257 fix(@angular/cli): remove analytics prompt postinstall script
With this change we remove the postinstall hook that was used to prompt users to confirm if they'd like to share anonymous usage with the Angular team.

This post install hook was used to set the global configuration, which was mainly used for commands that run outside of a workspace such as `ng new`, `ng version` and ng `config`. We now prompt once the users runs the above mentioned commands instead of the post install.
2022-03-29 18:20:55 +02:00
Renovate Bot
156006aba0 build: update angular to d5d65d3 2022-03-29 15:45:13 +02:00
Renovate Bot
77a828a1cd build: update angular 2022-03-28 14:15:08 +02:00
Renovate Bot
5d38bee8cf build: update angular 2022-03-24 14:55:19 +01:00
Charles Lyding
f13db1da47 build: update bazel rules_nodejs to v5.3.0
The `check_bazel_version` and `check_rules_nodejs_version` calls have also been removed from the WORKSPACE file as they are no longer supported or recommended by `rules_nodejs`.
2022-03-24 07:04:50 +01:00
Charles Lyding
966d25b55e fix(@angular-devkit/build-angular): remove unneeded JIT reflect metadata polyfill
Since Angular 8, the CLI has transformed decorator metadata to a form that can be used by the Angular dependency injector without the TDZ limitations of Typescript's decorator metadata emit feature.
As a result, a JIT application compiled with the CLI no longer requires the reflect metadata polyfill that was provided by `core-js`.
This polyfill was also the last remaining usage of the `core-js` package within `@angular-devkit/build-angular` which allows the `core-js` package to also be removed.

Refs: https://github.com/angular/angular-cli/pull/14473 & https://github.com/angular/angular/pull/37382

BREAKING CHANGE: Reflect metadata polyfill is no longer automatically provided in JIT mode
Reflect metadata support is not required by Angular in JIT applications compiled by the CLI.
Applications built in AOT mode did not and will continue to not provide the polyfill.
For the majority of applications, the reflect metadata polyfill removal should have no effect.
However, if an application uses JIT mode and also uses the previously polyfilled reflect metadata JavaScript APIs, the polyfill will need to be manually added to the application after updating.
To replicate the previous behavior, the `core-js` package should be manually installed and the `import 'core-js/proposals/reflect-metadata';` statement should be added to the application's `polyfills.ts` file.
2022-03-23 12:58:55 -07:00
Alan Agius
366cabc66c feat(@angular/cli): add support for multiple schematics collections
The `schematicCollections` can be placed under the `cli` option in the global `.angular.json` configuration, at the root or at project level in `angular.json` .

```jsonc
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "cli": {
    "schematicCollections": ["@schematics/angular", "@angular/material"]
  }
  // ...
}
```

**Rationale**
When this option is not configured and a user would like to run a schematic which is not part of `@schematics/angular`,
the collection name needs to be provided to `ng generate` command in the form of `[collection-name:schematic-name]`. This make the `ng generate` command too verbose for repeated usages.

This is where `schematicCollections` comes handle. When adding `@angular/material` to the list of `schematicCollections`, the generate command will try to locate the schematic in the specified collections.

```
ng generate navigation
```

is equivalent to:

```
ng generate @angular/material:navigation
```

**Conflicting schematic names**
When multiple collections have a schematic with the same name. Both `ng generate` and `ng new` will run the first schematic matched based on the ordering (as specified) of `schematicCollections`.

DEPRECATED:

The `defaultCollection` workspace option has been deprecated in favor of `schematicCollections`.

Before
```json
"defaultCollection": "@angular/material"
```

After
```json
"schematicCollections": ["@angular/material"]
```

Closes #12157
2022-03-22 09:37:57 -07:00
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
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
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
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
9ddb220c3d docs: replace app with application 2022-03-14 10:03:06 -04:00
Alan Agius
7fa3e65879 feat(@angular/cli): support TypeScript 4.6.2
BREAKING CHANGE:

Support for TypeScript 4.4 and 4.5 has been removed. Please update to TypeScript 4.6.
2022-03-10 15:36:19 -05: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
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
Alan Agius
433b6b4931 docs: remove redundant default empty strings values
(cherry picked from commit 3d928c01c8196b1caba7b373eec870540ecda79e)
2022-03-04 16:58:55 +01:00
Renovate Bot
38a9d9eb5d build: update angular 2022-03-01 08:58:23 -08:00
Paul Gschwendtner
59497a9ee3 build: update snapshot e2e setup to reflect builds repository rename
Updates the snapshot e2e setup to reflect the builds repository rename
where `material2-builds` got renamed to `material-builds`.
2022-02-22 09:26:01 -05:00
Charles Lyding
af0ef747b2 test: remove common-tags dependency from E2E tests
The `common-tags` development dependency was only used in several E2E tests.
Removing the usage of the dependency also allows it to be removed as a development dependency from the root `package.json`.
2022-02-22 09:24:38 -05:00
Charles Lyding
ed790c1155 test: update E2E production application size expectations
Improvements to the framework for `14.0.0-next.3` resulted in reduced main bundle sizes.

```
  Initial Chunk Files           | Names         |  Raw Size | Estimated Transfer Size
  main.f6e8bb94b78b0b43.js      | main          | 120.24 kB |                36.23 kB
```
2022-02-18 08:09:53 -05:00
Renovate Bot
d1fffd6035 build: update angular 2022-02-16 12:18:53 +01:00
Renovate Bot
410ff1070f build: update angular 2022-02-14 10:37:06 +01:00
Renovate Bot
0301895e2e build: update angular 2022-02-11 15:32:56 +01:00
Renovate Bot
88f23e0a7a build: update angular 2022-02-10 14:16:45 +01:00
Renovate Bot
b46f624361 build: update angular 2022-02-08 13:06:24 +00:00
Renovate Bot
cf4ccc3aef build: update angular 2022-02-02 11:47:04 -08:00
Alan Agius
7212252b54 test(@angular/cli): remove hardcoded versions from ng-update test
We improve the migrations logic to automatically run the needed migrations based on the build version of the Angular CLI. This helps us to avoid having to manually update this test when we bump the major version. Example: https://github.com/angular/angular-cli/pull/22579/files
2022-02-01 17:02:22 -08:00
Alan Agius
6cf9887302 test(@angular/cli): update ng-update test to start from version 10
With this change we update the `ng-update` test to start from version 10 as version 9 has been out of support for some time now.
2022-02-01 17:02:22 -08:00
Alan Agius
c95ab7041f test: remove hardcoded app-shell test
With this change we remove the hard coded app-shell test that is currently failing in Node.Js 12.

We can remove this test, because this is a duplicate of https://github.com/angular/angular-cli/blob/master/tests/legacy-cli/e2e/tests/build/build-app-shell-with-schematic.ts which app-shell is generated using schematics.
2022-02-01 17:01:23 -08:00
Alan Agius
0a1cd584d8 refactor(@angular-devkit/build-angular): remove deprecated showCircularDependencies browser and server builder option
BREAKING CHANGE:

The deprecated `showCircularDependencies` browser and server builder option has been removed. The recommended method to detect circular dependencies in project code is to use either a lint rule or other external tools.
2022-01-31 11:34:58 -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
69ecddaa7d feat(@schematics/angular): update new and existing projects compilation target to ES2020
With this change we update the TypeScript compilation target to `ES2020` for both new and existing projects. This is because all browsers that Angular supports (https://angular.io/guide/browser-support) support `ES2020` features without the need for polyfills.
2022-01-28 11:01:09 -08:00