820 Commits

Author SHA1 Message Date
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
Derek Cormier
c2737dd51a build: use placeholder version for stamping 2022-01-12 10:02:23 -08:00
Renovate Bot
f70f871db2 build: update all non-major dependencies 2022-01-10 11:32:40 -08:00
Derek Cormier
4b5c52b0d8 build: perform package.json substitutions in bazel build 2022-01-10 10:25:49 -08:00
Alan Agius
b7e2923743 fix(@angular/cli): remove extra space in Unable to find compatible package during ng add 2021-12-17 11:08:01 +01:00
Derek Cormier
31801c1a1a build: reproduce original package structure using bazel 2021-12-10 11:06:41 +01:00
Alan Agius
b06dd03feb docs: update CPU profiling section
This section is outdated.

Closes #20336
2021-12-06 14:50:11 +00:00
Ferdinand Malcher
033c4415ef docs: remove @zeit/ng-deploy from deploy suggestions
This package seems not to be maintained anymore. Hence, it shouldn't be suggested with ng deploy.
2021-12-03 16:10:37 +00:00
Alan Agius
0b6071af3a fix(@angular/cli): ng doc does open browser on Windows
Wait until the browser has been launched before exiting the Node.js process.

For more about this change see the explanation https://github.com/angular/angular-cli/issues/22257#issuecomment-983006518

Closes #22257
2021-12-02 09:55:00 -08:00
Renovate Bot
1a9da01b3a build: update all non-major dependencies 2021-11-29 11:17:36 -08:00
Alan Agius
b9cd68f691 fix(@angular/cli): exit with a non-zero error code when migration fails during ng update
In some cases, when a migration fails an error is not thrown, instead the `executeMigration` return a `false` value when resolved.

With this change, we fix an issue were failed migrations resulted in the process of not terminating with a non-zero error code.
2021-11-24 17:12:11 +01:00
Alan Agius
1e9e890bb0 fix(@angular/cli): logic which determines which temp version of the CLI is to be download during ng update
Previously, when using an older version of the Angular CLI, during `ng update`, we download the temporary `latest` version to run the update. The ensured that when running that the runner used to run the update contains the latest bug fixes and improvements.

This however, can be problematic in some cases. Such as when there are API breaking changes, when running a relatively old schematic with the latest CLI can cause runtime issues, especially since those schematics were never meant to be executed on a CLI X major versions in the future.

With this change, we improve the logic to determine which version of the Angular CLI should be used to run the update.

Below is a summarization of this.

- When using the `--next` command line argument, the `@next` version of the CLI will be used to run the update.
- When updating an `@angular/` or `@nguniversal/` package, the target version will be used to run the update. Example: `ng update @angular/core@12`,  the update will run on most recent patch version of `@angular/cli` of that major version `@12.2.6`.
- When updating an `@angular/` or `@nguniversal/` and no target version is specified. Example: `ng update @angular/core` the update will run on most latest version of the `@angular/cli`.
- When updating a third-party package, the most recent patch version of the installed `@angular/cli` will be used to run the update. Example if `13.0.0` is installed and `13.1.1` is available on NPM, the latter will be used.
2021-11-23 07:44:53 +01:00
Billy Lando
a57dafbce6 docs: remove e2e folder reference from new spec 2021-11-22 13:15:58 +01:00
Charles Lyding
56f802b7dd feat(@angular/cli): ask to install angular-eslint when running ng lint in new projects
To improve the developer experience for the `ng lint` command in new projects, the lint command will now ask the developer if they wish to install `@angular-eslint/schematics` when no lint target has been configured for the specified project. `@angular-eslint/schematics` is currently the only option listed in the warning shown prior to the introduction of the prompt in this change. If additional example packages are added to the warning text in the future, the confirmation prompt should be changed to a list prompt which would allow the user to pick one of the potential future listed example packages.

Closes: #21387
2021-11-22 08:55:35 +01:00
Charles Lyding
ecd9fb5c77 feat(@angular/cli): provide more detailed error for not found builder
When a builder-based command is executed (build, serve, test, etc.) and the builder's node package cannot be found a more user-friendly error message is now displayed. In addition, when the builder's node package cannot be found, a check is performed to determine if the node packages for the workspace may have not been installed. Previously, a potentially long stacktrace was shown which did not provide much information regarding how to correct the issue.

Closes: #10536
2021-11-17 09:30:54 +00:00
Alan Agius
b7b1325a67 fix(@angular/cli): favor ng-update packageGroupName in ng update output
With this change we favor the `packageGroupName` name when specified and only fallback to use the first item in in the `packageGroup` array when it is not specified.

Closes #22087
2021-11-09 11:06:08 -05:00
Charles Lyding
4a5ca162c3 fix(@angular/cli): avoid redirecting @angular/core in Angular migrations
Files should not redirect `@angular/core` and instead use the direct dependency of the `@schematics/angular` package. This allows old major version migrations to continue to function even though the latest major version may have breaking changes in `@angular/core`.
2021-11-08 09:30:22 -05:00
Alan Agius
9b32066e88 fix(@angular/cli): update ng update output for Angular packages
With #21986 we now error when updating `@angular/` and `@nguniversal/` packages across multiple major versions. With this chnage we update `ng update` output to show the correct instructions.

Before
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 13.0.0-rc.2   ng update @angular/core --next
```

Now
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 12.2.9        ng update @angular/core@12
```

Closes #19381
2021-10-28 15:31:15 +02:00
Renovate Bot
6bf379726c build: update all non-major dependencies 2021-10-27 04:44:14 -05:00
Charles Lyding
084eff6965 fix(@angular/cli): exclude packages from ng add that contain invalid peer dependencies
Certain older versions of packages may contain missing or invalid peer dependencies. As a result these packages may be incorrectly added to the project when no newer compatible version is found. An exclusion list is now present within `ng add` that will exclude packages with known peer dependency concerns from consideration when adding a package. Currently, only `@angular/localize@9.x` is included in the list.
2021-10-27 04:43:37 -05:00
Alan Agius
57d7eb5b16 fix(@angular/cli): error when updating Angular packages across multi-major migrations
With this change we show an error message when users try to update `@angular/` and `@nguniversal/` packages across multiple major versions.
2021-10-26 04:45:18 -05:00
Sushrit_Lawliet
1aef32c05b fix(@angular/cli): correct grammar error in Analytics consent prompt 2021-10-19 10:07:48 -04:00
Alan Agius
ebf2d62535 fix(@angular/cli): run stable migrations when package version is prerelease
With this change we fix an issue were migrations are not run when the version specified in migration collection is specified as stable example `13.0.0`, but the version specified in the `package.json` is still a prerelease example `13.0.0-rc.0`.

Closes: #21969
2021-10-18 11:24:16 -04:00
Alan Agius
3f72ccc5d2 fix(@angular/cli): generate new random user ID when passing empty string to uuid
`ng config cli.analyticsSharing.uuid ""` should generate new random user ID.

See: https://angular.io/cli/usage-analytics-gathering#per-user-tracking
2021-10-13 15:29:46 +02:00
Alan Agius
f7d6a48f87 fix(@angular/cli): accept UA-00000-0 format in analytics tracking id
With this change we update the validation of the tracking id to accept  tracking ids in `UA-00000-0` format.

Partially addressses #21916
2021-10-13 15:29:15 +02:00
Renovate Bot
7c0ae75add build: update all non-major dependencies 2021-10-13 10:56:08 +02:00
Renovate Bot
7c2119e48a build: update all non-major dependencies 2021-10-08 10:32:47 +02:00
Alan Agius
5904afd1de feat(@angular-devkit/build-angular): enable disk cache by default and provide configurable options
Persistent disk build cache is now enabled by default. A number of options have been added to allow fine tuning of the cache.

The options can be configuration in `cli.cache` section in the `angular.json` as shown below.

- `enabled`: Configure whether disk caching is enabled. Defaults to `true`
- `environment`: Configure in which environment disk cache is enabled. Valid values `ci`, `local` or `all`. Defaults to: `local`
- `path`: cache base path. Defaults to `.angular/cache`

DEPRECATED: `NG_BUILD_CACHE` environment variable option will be removed in the next major version. Configure `cli.cache` in the workspace configuration instead.

BREAKING CHANGE:  `NG_PERSISTENT_BUILD_CACHE` environment variable option no longer  have effect. Configure `cli.cache` in the workspace configuration instead.

```json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "cli": {
    "cache": {
      "enabled": true,
      "path": ".custom-cache-path",
      "environment": "all"
    }
  }
  ...
}
```
2021-10-06 08:02:22 -05:00
Renovate Bot
4b3fc7607c build: update dependency pacote to v12 2021-10-06 06:13:05 -05:00
Renovate Bot
a5dadc5f71 build: update all non-major dependencies 2021-10-06 06:12:13 -05:00