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`.
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.
* 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>
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.
`@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.
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
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.
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
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
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`.
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`.
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
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.
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.
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.
BREAKING CHANGE: The 'path' option in schematics schema no longer has a special meaning. Use 'workingDirectory' smart default provider should be used instead.