1015 Commits

Author SHA1 Message Date
Angular Robot
70fcd37b58 build: update all non-major dependencies 2023-02-15 15:28:49 +00:00
Alan Agius
d9fed6a517 build: update parse5-html-rewriting-stream to version 7
This fixes an issue were the HTML is truncated if it's 128Kb or greater.

Closes #24707
2023-02-14 15:23:09 +00:00
Alan Agius
522463c42b fix(@angular/cli): replace os.version with os.release.
This is more user friendly.
2023-02-14 15:20:59 +00:00
Alan Agius
5f407337f9 fix(@angular/cli): add set SessionEngaged in GA
This is required for realtime reports.
2023-02-14 15:20:59 +00:00
Alan Agius
545c180e2b fix(@angular/cli): convert before option in .npmrc to Date
Previously, the `before` option in the npmrc was not converted properly to a date.

See: https://docs.npmjs.com/cli/v8/using-npm/config#before

Closes #24685
2023-02-10 20:17:41 +00:00
Angular Robot
4c69b27816 build: update all non-major dependencies 2023-02-08 19:11:07 +00:00
Kristiyan Kostadinov
234f265d16 fix(@angular/cli): error if Angular compiler is used in a schematic
When a schematic is executed, it is wrapped in a custom Node context. This context doesn't expose the same set of global variables. This can lead to an error if a schematic is importing the Angular compiler and the app is using i18n, because the `TextEncoder` isn't exposed through the custom context (see https://github.com/angular/angular/issues/48940).

These changes add the `TextEncoder` to the context.

Fixes https://github.com/angular/angular/issues/48940.
2023-02-07 01:01:20 +00:00
Jason Bedard
fac1e58b73
run e2e tests under bazel (#24338)
* test: run legacy-cli e2e tests via bazel

* fixup! test: run legacy-cli e2e tests via bazel

* fixup! test: run legacy-cli e2e tests via bazel

* fixup! test: run legacy-cli e2e tests via bazel
2023-02-03 07:52:28 +00:00
Alan Agius
7bcb19cddb fix(@angular/cli): only set DebugView when NG_DEBUG is passed
`querystring.stringify` will not remove undefined values.
2023-02-02 14:04:00 +00:00
Alan Agius
89ab29901b docs(@angular/cli): minor updates to ng run description
Minor improvements of `ng run` docs
2023-01-24 20:12:19 +00:00
Alan Agius
a7d2bda577 build: update quicktype-core to 20.0.15
This commit updates `quicktype-core` to `20.0.15` and enables Renovate to update this.
2023-01-20 18:37:55 +00:00
Alan Agius
983adbd6eb build: update @types/yargs to ^17.0.20 2023-01-20 18:37:40 +00:00
Alan Agius
0f58a17c4c feat(@angular/cli): log number of files update during ng update
This commit updates `ng update` to include the number of files updated when a migration is completed.

Closes #24488
2023-01-19 22:13:19 +00:00
Alan Agius
b5737efae8 fix(@angular/cli): handle extended schematics when retrieving aliases
Previously base collections where not being taken into account and the recent changes caused an exception

```
An unhandled exception occurred: Cannot destructure property 'aliases' of 'collection.description.schematics[schematicName]' as it is undefined.
```

See: https://angular-team.slack.com/archives/CHEEH2LCA/p1674122139247359
2023-01-19 22:12:26 +00:00
Doug Parker
f7c78dd384 Revert "refactor: temporaily disable sending analytics"
This reverts commit df9674bd361b46b1275eed98e503f8897e701af5.

Re-enables anayltics.
2023-01-18 23:13:58 +00:00
Doug Parker
b5dcb29cba refactor: only collect Node version if it's a standard version string
Any other kinds of Node version are collected as "other" to avoid pulling in an unbounded user input.
2023-01-18 17:12:47 +00:00
Alan Agius
3ebb195525 fix(@angular/cli): register schematic aliases when providing collection name in ng generate
Previously, schematic aliases were not registered when a collection name was provided to `ng generate`.  Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case.

Closes #24518
2023-01-13 14:58:36 +00:00
Alan Agius
697df4f6e5 fix(@angular/cli): remove --to option from being required when using --from in ng update
This change remove the requirement for the `to` option to be provided when using the `from` option in conjunction with `migrate-only`.

Closes #24510
2023-01-13 08:29:25 +00:00
Alan Agius
143fc68adc docs(@angular/cli): add ng new long description
This appears to have been deleted by mistake when we switched to Yargs.
2023-01-11 15:56:52 +00:00
Charles Lyding
7f93735e98 build: use bazel to perform release builds
When performing a release via the dev-infra `ng-dev` tooling, the release
builds for the packages that will be published are now performed using bazel.
Prior to this, the release builds were performed using a custom build script
that programmatically invoked TypeScript APIs. The Bazel build and discovery
process for the releasable packages is performed by a script that is based on
the scripts from components and framework repositories. Several small modifications
were performed to match the behavior and structure of the cli repository:
* Use of `packages` as the source root in the bazel query
* Use of `pkg_npm` rule in the bazel query
* Partial transition to native Node.js `fs` APIs instead of `shelljs`
* Directory creation per package when copying output (supports multiple package scopes)
* Copying of archives (tgz) for each package

The snapshot and local build capabilities are not modified as part of this change
but will be merged in a followup as part of a larger transition to use bazel
throughout the package build process.
2023-01-05 03:21:58 +00:00
Kristiyan Kostadinov
ba895b1af6 build: update to TypeScript 4.9
Updates the project to TypeScript 4.9.
2023-01-03 16:46:36 +00:00
Angular Robot
a9c0982f3a build: update all non-major dependencies 2022-12-15 20:48:46 +00:00
Alan Agius
207358afb8 feat(@angular-devkit/schematics): add runSchematic and runExternalSchematic methods
These async methods are a replacement for the Observable based `runSchematicAsync` and `runExternalSchematicAsync` methods.

DEPRECATED:
The Observable based `SchematicTestRunner.runSchematicAsync` and `SchematicTestRunner.runExternalSchematicAsync` method have been deprecated in favor of the Promise based `SchematicTestRunner.runSchematic` and `SchematicTestRunner.runExternalSchematic`.
2022-12-08 14:49:43 -08:00
Angular Robot
3d885fbb21 build: update all non-major dependencies 2022-12-08 12:09:04 -08:00
Angular Robot
66a97103db build: update dependency npm-package-arg to v10.1.0 2022-12-02 09:04:04 +00:00
Alan Agius
2589df0be1 Revert "test: run legacy-cli e2e tests via bazel"
This reverts commit 794e33ae72c15a628f308260020bc4da608c4996.
2022-11-28 15:25:48 +00:00
Jason Bedard
794e33ae72 test: run legacy-cli e2e tests via bazel 2022-11-28 13:39:15 +00:00
Alan Agius
412cb3e61f fix(@angular/cli): use global version of the CLI when running ng new
In some cases orphan `node_modules` would cause the non global CLI to be used to generate a new workspace.

Closes #14603
2022-11-16 13:36:49 -08:00
Doug Parker
df9674bd36 refactor: temporaily disable sending analytics 2022-11-15 12:30:13 -08:00
Alan Agius
0dcb1998ad fix(@angular/cli): respect registry in RC when running update through yarn
This commit fixes an issue where when `ng update` was ran using `yarn` (`yarn ng update`) the registry was always being overridden to `https://registry.yarnpkg.com`.

This is because yarn will set the `npm_config_registry` env variable to `https://registry.yarnpkg.com` even when an RC file is present with a different repository.
2022-11-11 16:40:44 +01:00
Angular Robot
7f4c252eb5 build: update all non-major dependencies 2022-11-07 14:07:00 +01:00
Alan Agius
bf9516e017 build: update dependency npm-package-arg to v10
This commit updates the npm-package-arg to v10 and applies the changes needed due to the breaking change in
d2b87c083f
2022-11-04 11:07:27 -07:00
Angular Robot
4f0ee26b14 build: update dependency pacote to v15.0.6 2022-11-02 08:50:03 -07:00
Angular Robot
503682766f build: update all non-major dependencies 2022-10-27 12:25:33 -07:00
Alan Agius
65a0983a41
fix(@angular/cli): exclude @angular/localize@<10.0.0 from ng add pa… (#24152)
* fix(@angular/cli): exclude `@angular/localize@<10.0.0` from ng add package discovery

`@angular/localize@<10.0.0` has no peer dependencies. This can cause `ng add` to pick these versions of the package if the newer versions.

See: https://app.circleci.com/pipelines/github/angular/angular-cli/27402/workflows/faa64532-541a-4bea-b599-3c53afe42019/jobs/364822
```
Test Process error Error: Process exit error - "ng add @angular/localize --skip-confirmation": 1...

STDOUT:

STDERR:
npm version 7.4.0 detected. When using npm 7 with the Angular CLI, npm version 7.5.6 or higher is recommended.
- Determining package manager...
ℹ Using package manager: npm
- Searching for compatible package version...
✔ Found compatible package version: @angular/localize@10.0.0-next.7.
- Loading package information from registry...
✔ Package information loaded.
- Installing packages...
✔ Packages successfully installed.
NOT SUPPORTED: keyword "id", use "$id" for schema ID
```

* fixup! fix(@angular/cli): exclude `@angular/localize@<10.0.0` from ng add package discovery

Co-authored-by: Charles <19598772+clydin@users.noreply.github.com>

Co-authored-by: Charles <19598772+clydin@users.noreply.github.com>
2022-10-27 12:25:15 -07:00
Charles Lyding
56cb7679db fix(@angular/cli): allow ng add to find prerelease versions when CLI is prerelease
When the CLI is a prerelease version, the `ng add` command will now consider the
use of prerelease versions of requested packages. Without this behavior, attempting
to install a package without a version specifier (e.g., `ng add @angular/material`)
will install an older stable version of the requested package instead of the expected
prerelease version compatible with the prerelease Angular project.
2022-10-25 10:51:26 -07:00
Charles Lyding
9260087bf7 fix(@angular/cli): exclude @angular/material@7.x from ng add package discovery
`@angular/material@7.x` uses unbounded ranges for its framework peer dependencies.
This can cause `ng add` to pick these versions of the package if the newer versions
are not compatible since the peer dependency ranges would match any newer stable
framework version.
2022-10-25 10:51:26 -07:00
Alan Agius
ca7ca1bdfd fix(@angular/cli): disable version check during auto completion
This causes sub broken DX

```
ng bui[TAB]Your global Angular CLI version (14.2.6) is greater than your local version (14.1.3). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
ld --conf[TAB]Your global Angular CLI version (14.2.6) is greater than your local version (14.1.3). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
iguration dev[TAB]Your global Angular CLI version (14.2.6) is greater than your local version (14.1.3). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
elopment
```

Closes #24133
2022-10-25 10:49:00 -07:00
Alan Agius
1e4dbfdf4a fix(@angular/cli): skip node.js compatibility checks when running completion
A warning at this stage could cause a broken source action (`source <(ng completion script)`) when in the shell init script.

Closes #24104
2022-10-24 15:12:05 -07:00
Alan Agius
82cb04927f docs(@angular/cli): update add long description to analytics command
With this change we add a long description to analytics command with the information that is currently contained in https://angular.io/analytics which will be deleted at a later stage.
2022-10-24 15:11:40 -07:00
Alan Agius
708011ea8e build: update all non-major dependencies 2022-10-21 10:24:39 -04:00
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