974 Commits

Author SHA1 Message Date
Angular Robot
e9cd7f35c6 build: update dependency npm-pick-manifest to v8 2022-10-17 10:33:26 +02:00
Alan Agius
61fab6413a fix(@angular/cli): do not collect analytics when running in non TTY mode
Prior to this change we collected analytics when config was not present and the CLI was running in non TTY mode.
2022-10-14 15:55:03 +02:00
Alan Agius
f41d609ae8 fix(@angular/cli): add unique user id as user parameter in GA
While, GA collects the user id, this cannot be used for reporting and filtering purpose. This can be
2022-10-14 15:27:05 +02:00
Alan Agius
c59c1e7e6d fix(@angular/cli): add workspace information as part of analytics collection
With this change we collect 3 additional metrics
- `all_projects_count` Count of all project in a workspace
- `libs_projects_count` Count of library projects in a workspace
- `apps_projects_count` Count of application projects in a workspace
2022-10-14 15:27:05 +02:00
Angular Robot
1cd53d6be1 build: update dependency pacote to v15 2022-10-14 10:11:02 +02:00
Alan Agius
3928d084e6 ci: add validation for parameters length
Needed as otherwise if the parameter is longer we are unable to map this in GA4.

GA4 has a limit of:
- 24 characters for custom user dimension parameter names
- 40 characters for custom event dimension parameter names
- 40 characters for custom metric dimension parameter names
2022-10-12 15:32:28 +02:00
Alan Agius
5228c23763 refactor(@angular/cli): remove debug package from dependencies 2022-10-11 18:52:30 +02:00
Alan Agius
124be1cc9c refactor: add build and rebuild related statistics and analytics
The new build and rebuild statistics are used by the CLI to submit build related information to GA.
2022-10-11 18:52:30 +02:00
Alan Agius
639a3071c3 refactor: migrate analytics collector to use GA4
This change updates the analytics collector collector to use GA4 instead of UA. The motivation behind this change is that UA will stop collecting data in 2023.

BREAKING CHANGE:

`analyticsSharing` option in the global angular configuration has been
removed without replacement. This option was used to configure the Angular CLI to  access to your own users' CLI usage data.

If this option is used, it can be removed using `ng config --global cli.analyticsSharing undefined`.
2022-10-11 18:52:30 +02:00
Angular Robot
c7ca61290c build: update dependency pacote to v14 2022-10-07 14:15:31 -04:00
Alan Agius
4fa5b526e5 fix(@angular/cli): handle missing which binary in path
This change updates the `hasGlobalCliInstall` logic so that a pending promise is not created.

Closes #23997
2022-10-07 11:44:40 -04:00
Alan Agius
4827d1b23e feat(@angular/cli): add support for Node.js version 18
Pacote version 14 does requires `14.17.x` or `16.13.x`.

BREAKING CHANGE: The Angular CLI  no longer supports `16.10.x`, `16.11.x` and `16.12.x`. Current supported versions of Node.js are `14.20.x`, `16.13.x` and `18.10.x`.
2022-10-07 11:34:43 -04:00
Alan Agius
320241010e fix(@angular/cli): skip downloading temp CLI when running ng update without package names
In the case when `ng update` is ran without a package name, an update is not be performed. In this case using the current installed version of the CLI is good enough.

Closes #24024
2022-10-06 16:21:27 -04:00
Alan Agius
f313f4fb04 refactor(@angular/cli): remove leftover schematics path handling
Remove interim handling of `"format": "path"`. workingDirectory smart default provider should be used instead.
2022-10-06 16:20:15 -04:00
Angular Robot
24bcfaaca1 build: update all non-major dependencies 2022-10-05 09:55:07 -04:00
Alan Agius
4b623461a4 feat(@angular/cli): drop support for Node.js versions older than 14.20
Node.js 14.20 and newer support generating UUID using the crypto module. See: https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_crypto_randomuuid_options

BREAKING CHANGE: Node.js versions older than 14.20 are no longer supported.
2022-10-04 11:28:43 -04:00
Angular Robot
033e8ca8dd build: update dependency yargs to v17.6.0 2022-10-03 09:11:26 -04:00
Alan Agius
c76f9a337f docs(@angular/cli): update platform support information in auto-completion
Closes #23980
2022-09-30 08:56:15 +02:00
Angular Robot
8c3577d07c build: update all non-major dependencies 2022-09-29 14:28:56 +02:00
Alan Agius
23c233c296 fix(@angular/cli): add builders and schematic names as page titles in collected analytics
With this commit the builder and schematic names are added as page title to page events.

Also, we address a bug where during a watch or error in some cases analytics where not flushed. Examples when the builder has a watch mode.
2022-09-23 10:29:59 -04:00
Charles Lyding
326e9234c4 refactor(@angular/cli): remove use of global require resolve
The global require function is not present in Node.js ESM mode. To support
the eventual transition of the `@angular/cli` package to ESM, usage of the
`require.resolve` function has been converted to use locally created `require`
functions via `createRequire` from the `module` builtin.
2022-09-20 10:19:45 -04:00
Jason Bedard
4de9045de8 test: unit test multiple node versions in separate jobs 2022-09-14 10:43:17 -07:00
Charles Lyding
b2add316e7 build: remove unneeded BUILD file licenses rule comments 2022-09-13 10:33:49 -07:00
Angular Robot
a39aa0f499 build: update dependency uuid to v9 2022-09-06 08:20:50 +02:00
Alan Agius
7e64b1537d fix(@angular/cli): favor non deprecated packages during update
Prior to this change during update deprecated packages that satisfied the version range constrain where being favored over the non-deprecated versions if the version of the deprecated version is greater. Ex: if `14.3.1` is deprecated and `14.3.0` is not the former was being installed.

With this change we now change the logic to favor non deprecated version of the package and only use the deprecated package when no satisfying version is found.

This fix is needed as in some cases a package which cannot be unpublished from NPM will gave to be to be deprecated, if the version is for a reason or another broken.
2022-09-01 10:24:33 -04:00
Charles Lyding
e402c2358c build: adjust BUILD file external comment markers
Improvements to the syncing process allow for reduced usage of the comment markers.
2022-08-31 08:37:19 -04:00
Alan Agius
774d349b73 refactor(@angular/cli): remove deprecated path handler
BREAKING CHANGE: The 'path' option in schematics schema no longer has a special meaning. Use 'workingDirectory' smart default provider should be used instead.
2022-08-30 12:24:35 -04:00
Angular Robot
56b3299f12 build: update all non-major dependencies 2022-08-30 08:54:10 -04:00
Angular Robot
ea5edbebb5 build: update all non-major dependencies 2022-08-29 08:18:24 -04:00
Doug Parker
da271addf0 refactor(@angular/cli): update analytics prompt copy
Swapping `anonymous` for `pseudonymous` to align with privacy communication guidelines.
2022-08-22 16:04:11 -07:00
Angular Robot
3651209e95 build: update all non-major dependencies 2022-08-17 10:35:20 +02:00
Alan Agius
0e2044ebb1 build: update @types/semver to ^7.3.12 2022-08-16 01:42:28 +02:00
Alan Agius
37422da4f2 docs: typo in cache command long description 2022-08-12 08:20:43 -04:00
Alan Agius
4368c85983 refactor: remove unused local variables 2022-08-12 08:19:26 -04:00
Alan Agius
6814e300c3 build: update all typescript-eslint packages to v5.33.0
(cherry picked from commit fb11677dde47c348025fd5e44e7822c097ce0bfe)
2022-08-09 10:42:54 -04:00
Jason Bedard
db5c1fc13c test: run tests on multiple node versions 2022-08-03 10:33:46 -07:00
Alan Agius
44f918612a fix(@angular/cli): catch clause variable is not an Error instance
Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes #23631
2022-07-28 09:46:53 +02:00
Alan Agius
596037010a fix(@angular/cli): add missing space after period in warning text 2022-07-28 09:42:56 +02:00
Angular Robot
0a990c525a build: update all non-major dependencies 2022-07-14 15:21:03 -07:00
Alan Agius
669345998b fix(@angular/cli): remove deprecation warning of no prefixed schema options
Prefixing options with `no` in schema definitions appears to be used more widely than initially thought.

The `noOption` can also be provided in the `angular.json` which makes this property definition less ambiguous, since boolean options don't get prefixed with `no` in the JSON config. Therefore, in order to reduce the community changes we remove the deprecation warning for such options and change the interim solution to permanent one.

None-the-less, it's still recommended that options are defined without the `no` prefix.
2022-07-11 11:52:16 -07:00
Alan Agius
2731fe7f67 fix(@angular/cli): handle cases when completion is enabled and running in an older CLI workspace
Previously when having completion enabled and the current workspaces has an older version of the Angular CLI installed in the terminal the below errors is show. This is because the older versions of the CLI do not implement this command. Now we exit gracefully.

```
The specified command ("completion") is invalid. For a list of available options,
run "ng help".

Did you mean "analytics"?
```

Closes #23518
2022-07-07 20:39:36 +02:00
Alan Agius
cbccfd426a fix(@angular/cli): during an update only use package manager force option with npm 7+
In some cases previously we passed the `force` option to yarn which which lead to an installation failure.

Closes #23495
2022-07-06 16:33:02 +02:00
Alan Agius
dbe0dc1743 fix(@angular/cli): improve error message for project-specific ng commands when run outside of a project
With this change we improve the error message when a project for command cannot be determined

```
Error: Cannot determine project for command.
This is a multi-project workspace and more than one project supports this command. Run "ng build [project]" to execute the command for a specific project or change the current working directory to a project directory.

Available projects are:
- project-name-0
- project-name-1
- project-name-2
- project-name-3
- project-name-4
- project-name-5
- project-name-6
- project-name-7
- project-name-8
- project-name-9
```

Closes #23481
2022-07-01 11:43:57 -04:00
Alan Agius
a69000407c refactor: clean up old ansi-colors castings
This has been fixed in https://github.com/doowb/ansi-colors/pull/44
2022-06-28 08:49:44 -04:00
Alan Agius
4fa039b692 fix(@angular/cli): remove color from help epilogue
In some cases gray doesn't provide enough contrast.
2022-06-27 09:09:33 -04:00
Alan Agius
5a012b5fce fix(@angular/cli): correctly handle --collection option in ng new
Previously, this option was ignored due to an incorrect deconstruction.

Closes #23414
2022-06-27 09:09:13 -04:00
renovate[bot]
04160c58ce build: update all non-major dependencies 2022-06-27 08:15:08 -04:00
Tim Bowersox
8b65abe1b0 fix(@angular/cli): improve global schema validation
- Prevent additional properties being set in cli subproperties (i.e. cli.warnings.zzzz).
- Create cliGlobalOptions definition and reference in the global.cli schema.
- Use global.cli schema to validate changes made with --global flag.
- Add test coverage for validating global/local-only changes.
- Add test coverage for setting invalid properties and sub-properties.
2022-06-24 09:51:21 -04:00
Alan Agius
3884b86526 fix(@angular/cli): add esbuild browser builder to workspace schema 2022-06-21 12:21:53 -07:00
Alan Agius
ba3f671936 fix(@angular/cli): temporarily handle boolean options in schema prefixed with no
With this commit we introduce an interim solution for options prefixed with `no` in `schema.json`

Previously, such options were handled as normal boolean option, but yargs handles options prefixed with `no` as negatations of the original option. Example with yargs, an option `noWatch` is will registered as `watch`.

Closes #23397
2022-06-21 12:21:29 -07:00