diff --git a/.bazelrc b/.bazelrc
index e3fb14bdabf7..d742b8bbb40c 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -50,7 +50,7 @@ test --incompatible_strict_action_env
build --experimental_remote_merkle_tree_cache
# Ensure that tags applied in BUILDs propagate to actions
-build --experimental_allow_tags_propagation
+common --experimental_allow_tags_propagation
# Don't check if output files have been modified
build --noexperimental_check_output_files
@@ -90,6 +90,10 @@ build:snapshot --workspace_status_command="yarn -s ng-dev release build-env-stam
build:snapshot --stamp
build:snapshot --//:enable_snapshot_repo_deps
+build:e2e --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=release"
+build:e2e --stamp
+test:e2e --test_timeout=3600
+
build:local --//:enable_package_json_tar_deps
###############################
diff --git a/.circleci/bazel.rc b/.circleci/bazel.common.rc
similarity index 100%
rename from .circleci/bazel.rc
rename to .circleci/bazel.common.rc
diff --git a/.circleci/bazel.linux.rc b/.circleci/bazel.linux.rc
new file mode 100644
index 000000000000..6a4d30ed44f8
--- /dev/null
+++ b/.circleci/bazel.linux.rc
@@ -0,0 +1,5 @@
+# Import config items common to both Linux and Windows setups.
+# https://docs.bazel.build/versions/master/guide.html#bazelrc-syntax-and-semantics
+import %workspace%/.circleci/bazel.common.rc
+
+build --config=remote
diff --git a/.circleci/bazel.windows.rc b/.circleci/bazel.windows.rc
new file mode 100644
index 000000000000..c9cba94c10cc
--- /dev/null
+++ b/.circleci/bazel.windows.rc
@@ -0,0 +1,8 @@
+# Import config items common to both Linux and Windows setups.
+# https://docs.bazel.build/versions/master/guide.html#bazelrc-syntax-and-semantics
+import %workspace%/.circleci/bazel.common.rc
+
+build --remote_cache=https://storage.googleapis.com/angular-cli-windows-bazel-cache
+build --remote_accept_cached=true
+build --remote_upload_local_results=true
+build --google_default_credentials
diff --git a/.circleci/dynamic_config.yml b/.circleci/dynamic_config.yml
index 46b8a56a22ba..c76838e887ec 100644
--- a/.circleci/dynamic_config.yml
+++ b/.circleci/dynamic_config.yml
@@ -10,8 +10,8 @@
version: 2.1
orbs:
- browser-tools: circleci/browser-tools@1.1.3
- devinfra: angular/dev-infra@1.0.7
+ browser-tools: circleci/browser-tools@1.4.0
+ devinfra: angular/dev-infra@1.0.8
parameters:
snapshot_changed:
@@ -29,18 +29,25 @@ var_3: &default_nodeversion '14.20'
var_3_major: &default_nodeversion_major '14'
# The major version of node toolchains. See tools/toolchain_info.bzl
# NOTE: entries in this array may be repeated elsewhere in the file, find them before adding more
-var_3_all_major: &all_nodeversion_major ['14', '16']
+var_3_all_major: &all_nodeversion_major ['14', '16', '18']
# Workspace initially persisted by the `setup` job, and then enhanced by `setup-and-build-win`.
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
var_4: &workspace_location .
# Filter to only release branches on a given job.
-var_5: &only_release_branches
+var_5_only_releases: &only_release_branches
filters:
branches:
only:
- main
- /\d+\.\d+\.x/
+var_5_only_snapshots: &only_snapshot_branches
+ filters:
+ branches:
+ only:
+ - main
+ # This is needed to run this steps on Renovate PRs that amend the snapshots package.json
+ - /^pull\/.*/
var_6: &only_pull_requests
filters:
@@ -48,6 +55,7 @@ var_6: &only_pull_requests
only:
- /pull\/\d+/
+# All e2e test suites
var_7: &all_e2e_subsets ['npm', 'esbuild', 'yarn']
# Executor Definitions
@@ -63,10 +71,20 @@ executors:
working_directory: ~/ng
resource_class: small
+ bazel-executor:
+ parameters:
+ nodeversion:
+ type: string
+ default: *default_nodeversion
+ docker:
+ - image: cimg/node:<< parameters.nodeversion >>-browsers
+ working_directory: ~/ng
+ resource_class: xlarge
+
windows-executor:
# Same as https://circleci.com/orbs/registry/orb/circleci/windows, but named.
working_directory: ~/ng
- resource_class: windows.medium
+ resource_class: windows.large
shell: powershell.exe -ExecutionPolicy Bypass
machine:
# Contents of this image:
@@ -111,12 +129,13 @@ commands:
steps:
- attach_workspace:
at: *workspace_location
+
setup_windows:
steps:
- initialize_env
- run: nvm install 16.13
- run: nvm use 16.13
- - run: npm install -g yarn@1.22.10
+ - run: npm install -g yarn@1.22.10 @bazel/bazelisk@${BAZELISK_VERSION}
- run: node --version
- run: yarn --version
@@ -125,18 +144,20 @@ commands:
key:
type: env_var_name
default: CIRCLE_PROJECT_REPONAME
- steps:
- - devinfra/setup-bazel-remote-exec:
- bazelrc: ./.bazelrc.user
-
- install_python:
steps:
- run:
- name: 'Install Python 2'
+ name: 'Copy Bazel RC'
+ shell: bash
command: |
- sudo apt-get update > /dev/null 2>&1
- sudo apt-get install -y python
- python --version
+ # Conditionally, copy bazel configuration based on the current VM
+ # operating system running. We detect Windows by checking for `%AppData%`.
+ if [[ -n "${APPDATA}" ]]; then
+ cp "./.circleci/bazel.windows.rc" ".bazelrc.user";
+ else
+ cp "./.circleci/bazel.linux.rc" ".bazelrc.user";
+ fi
+ - devinfra/setup-bazel-remote-exec:
+ shell: bash
# Job definitions
jobs:
@@ -190,7 +211,51 @@ jobs:
- run: yarn -s admin validate
- run: yarn -s check-tooling-setup
+ build:
+ executor: bazel-executor
+ steps:
+ - custom_attach_workspace
+ - setup_bazel_rbe
+ - run:
+ name: Bazel Build Packages
+ command: yarn bazel build //...
+ - fail_fast
+
+ test:
+ executor: bazel-executor
+ parameters:
+ nodeversion:
+ type: string
+ default: *default_nodeversion_major
+ steps:
+ - custom_attach_workspace
+ - setup_bazel_rbe
+ - when:
+ # The default nodeversion runs all *excluding* other versions
+ condition:
+ equal: [*default_nodeversion_major, << parameters.nodeversion >>]
+ steps:
+ - run:
+ command: yarn bazel test --test_tag_filters=-node16,-node18,-node<< parameters.nodeversion >>-broken //packages/...
+ # This timeout provides time for the actual tests to timeout and report status
+ # instead of CircleCI stopping the job without test failure information.
+ no_output_timeout: 40m
+ - when:
+ # Non-default nodeversion runs only that specific nodeversion
+ condition:
+ not:
+ equal: [*default_nodeversion_major, << parameters.nodeversion >>]
+ steps:
+ - run:
+ command: yarn bazel test --test_tag_filters=node<< parameters.nodeversion >>,-node<< parameters.nodeversion >>-broken //packages/...
+ # This timeout provides time for the actual tests to timeout and report status
+ # instead of CircleCI stopping the job without test failure information.
+ no_output_timeout: 40m
+ - fail_fast
+
e2e-tests:
+ executor: bazel-executor
+ parallelism: 8
parameters:
nodeversion:
type: string
@@ -202,49 +267,27 @@ jobs:
type: enum
enum: *all_e2e_subsets
default: 'npm'
- executor:
- name: action-executor
- nodeversion: << parameters.nodeversion >>
- parallelism: 8
- resource_class: large
steps:
- custom_attach_workspace
- - browser-tools/install-chrome
- initialize_env
+ - setup_bazel_rbe
- run: mkdir /mnt/ramdisk/e2e
- - when:
- condition:
- equal: ['npm', << parameters.subset >>]
- steps:
- - run:
- name: Execute CLI E2E Tests with NPM
- command: |
- node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots< parameters.snapshots >> --tmpdir=/mnt/ramdisk/e2e --ignore="tests/misc/browsers.ts"
- - when:
- condition:
- equal: ['esbuild', << parameters.subset >>]
- steps:
- - run:
- name: Execute CLI E2E Tests Subset with Esbuild
- command: |
- node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots< parameters.snapshots >> --esbuild --tmpdir=/mnt/ramdisk/e2e --glob="{tests/basic/**,tests/build/prod-build.ts,tests/build/relative-sourcemap.ts,tests/build/styles/scss.ts,tests/build/styles/include-paths.ts,tests/commands/add/add-pwa.ts}" --ignore="tests/basic/{environment,rebuild,serve,scripts-array}.ts"
- - when:
- condition:
- equal: ['yarn', << parameters.subset >>]
- steps:
- - run:
- name: Execute CLI E2E Tests Subset with Yarn
- command: |
- node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots< parameters.snapshots >> --yarn --tmpdir=/mnt/ramdisk/e2e --glob="{tests/basic/**,tests/update/**,tests/commands/add/**}"
+ - run:
+ name: Execute CLI E2E Tests with << parameters.subset >>
+ command: yarn bazel test --define=E2E_TEMP=/mnt/ramdisk/e2e --define=E2E_SHARD_TOTAL=${CIRCLE_NODE_TOTAL} --define=E2E_SHARD_INDEX=${CIRCLE_NODE_INDEX} --config=e2e //tests/legacy-cli:e2e<<# parameters.snapshots >>.snapshots< parameters.snapshots >>.<< parameters.subset >>_node<< parameters.nodeversion >>
+ no_output_timeout: 40m
+ - store_artifacts:
+ path: dist/testlogs/tests/legacy-cli/e2e<<# parameters.snapshots >>.snapshots< parameters.snapshots >>.<< parameters.subset >>_node<< parameters.nodeversion >>
+ - store_test_results:
+ path: dist/testlogs/tests/legacy-cli/e2e<<# parameters.snapshots >>.snapshots< parameters.snapshots >>.<< parameters.subset >>_node<< parameters.nodeversion >>
- fail_fast
test-browsers:
- executor:
- name: action-executor
- resource_class: medium
+ executor: bazel-executor
steps:
- custom_attach_workspace
- initialize_env
+ - setup_bazel_rbe
- run:
name: Initialize Saucelabs
command: setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev)
@@ -255,60 +298,14 @@ jobs:
# Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests
# too early without Saucelabs not being ready.
- run: ./scripts/saucelabs/wait-for-tunnel.sh
- - run: node ./tests/legacy-cli/run_e2e --glob="tests/misc/browsers.ts"
+ - run:
+ name: E2E Saucelabs Tests
+ command: yarn bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
- run: ./scripts/saucelabs/stop-tunnel.sh
- - fail_fast
-
- build:
- executor: action-executor
- steps:
- - custom_attach_workspace
- - run: yarn build
- - persist_to_workspace:
- root: *workspace_location
- paths:
- - dist/_*.tgz
-
- build-bazel-e2e:
- executor: action-executor
- resource_class: medium
- steps:
- - custom_attach_workspace
- - run: yarn bazel build //tests/legacy-cli/...
-
- unit-test:
- executor: action-executor
- resource_class: xlarge
- parameters:
- nodeversion:
- type: string
- default: *default_nodeversion_major
- steps:
- - custom_attach_workspace
- - browser-tools/install-chrome
- - setup_bazel_rbe
- - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
- - when:
- # The default nodeversion runs all *excluding* other versions
- condition:
- equal: [*default_nodeversion_major, << parameters.nodeversion >>]
- steps:
- - run:
- command: yarn bazel test --test_tag_filters=-node16,-node<< parameters.nodeversion >>-broken //packages/...
- # This timeout provides time for the actual tests to timeout and report status
- # instead of CircleCI stopping the job without test failure information.
- no_output_timeout: 40m
- - when:
- # Non-default nodeversion runs only that specific nodeversion
- condition:
- not:
- equal: [*default_nodeversion_major, << parameters.nodeversion >>]
- steps:
- - run:
- command: yarn bazel test --test_tag_filters=node<< parameters.nodeversion >>,-node<< parameters.nodeversion >>-broken //packages/...
- # This timeout provides time for the actual tests to timeout and report status
- # instead of CircleCI stopping the job without test failure information.
- no_output_timeout: 40m
+ - store_artifacts:
+ path: dist/testlogs/tests/legacy-cli/e2e.saucelabs
+ - store_test_results:
+ path: dist/testlogs/tests/legacy-cli/e2e.saucelabs
- fail_fast
snapshot_publish:
@@ -316,22 +313,14 @@ jobs:
resource_class: medium
steps:
- custom_attach_workspace
- - install_python
- - run:
- name: Decrypt Credentials
- # Note: when changing the image, you might have to re-encrypt the credentials with a
- # matching version of openssl.
- # See https://stackoverflow.com/a/43847627/2116927 for more info.
- command: |
- openssl aes-256-cbc -d -in .circleci/github_token -k "${KEY}" -out ~/github_token -md md5
- run:
name: Deployment to Snapshot
- command: |
- yarn admin snapshots --verbose --githubTokenFile=${HOME}/github_token
+ command: yarn admin snapshots --verbose
- fail_fast
publish_artifacts:
executor: action-executor
+ resource_class: medium
environment:
steps:
- custom_attach_workspace
@@ -342,7 +331,7 @@ jobs:
name: Copy tarballs to folder
command: |
mkdir -p dist/artifacts/
- cp dist/*.tgz dist/artifacts/
+ cp dist/releases/*.tgz dist/artifacts/
- store_artifacts:
path: dist/artifacts/
destination: angular
@@ -350,11 +339,12 @@ jobs:
# Windows jobs
e2e-cli-win:
executor: windows-executor
- parallelism: 16
+ parallelism: 12
steps:
- checkout
- rebase_pr_win
- setup_windows
+ - setup_bazel_rbe
- restore_cache:
keys:
- *cache_key_win
@@ -364,7 +354,7 @@ jobs:
name: 'Arsenal Image Mounter (RAM Disk)'
command: |
pwsh ./.circleci/win-ram-disk.ps1
- - run: yarn install --frozen-lockfile --cache-folder ../.cache/yarn
+ - run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
- save_cache:
key: *cache_key_win
paths:
@@ -372,15 +362,23 @@ jobs:
# Path where Arsenal Image Mounter files are downloaded.
# Must match path in .circleci/win-ram-disk.ps1
- ./aim
- # Build the npm packages for the e2e tests
- - run: yarn build
- # Run partial e2e suite on PRs only. Release branches will run the full e2e suite.
- run:
name: Execute E2E Tests
+ environment:
+ # Required by `yarn ng-dev`
+ # See https://github.com/angular/angular/issues/46858
+ PWD: .
command: |
- mkdir X:/ramdisk/e2e-main
- node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX --tmpdir=X:/ramdisk/e2e-main --ignore="tests/misc/browsers.ts"
+ mkdir X:/ramdisk/e2e
+ bazel test --define=E2E_TEMP=X:/ramdisk/e2e --define=E2E_SHARD_TOTAL=$env:CIRCLE_NODE_TOTAL --define=E2E_SHARD_INDEX=$env:CIRCLE_NODE_INDEX --config=e2e //tests/legacy-cli:e2e.npm_node16
+ # This timeout provides time for the actual tests to timeout and report status
+ # instead of CircleCI stopping the job without test failure information.
+ no_output_timeout: 40m
- fail_fast
+ - store_artifacts:
+ path: dist/testlogs/tests/legacy-cli/e2e.npm_node16
+ - store_test_results:
+ path: dist/testlogs/tests/legacy-cli/e2e.npm_node16
workflows:
version: 2
@@ -394,17 +392,28 @@ workflows:
- validate:
requires:
- setup
- - build:
- requires:
- - setup
- - test-browsers:
+ # These jobs only really depend on Setup, but the build job is very quick to run (~35s) and
+ # will catch any build errors before proceeding to the more lengthy and resource intensive
+ - test:
+ name: test-node<< matrix.nodeversion >>
+ matrix:
+ parameters:
+ # Disable running this on Node.js 18 for now. This causes failures when using RBE.
+ # Example: `GLIBC_2.28' not found.
+ # Likely this is caused by outdated Ubuntu image https://github.com/angular/dev-infra/blob/main/bazel/remote-execution/BUILD.bazel#L21
+ nodeversion: ['14', '16']
requires:
- build
+ # Bazel jobs
+ - build:
+ requires:
+ - setup
+
- e2e-tests:
name: e2e-cli-<< matrix.subset >>
- nodeversion: '14.20'
+ nodeversion: *default_nodeversion_major
matrix:
parameters:
subset: *all_e2e_subsets
@@ -421,7 +430,7 @@ workflows:
matrix:
alias: e2e-cli
parameters:
- nodeversion: ['14.20', '16.13', '18.10']
+ nodeversion: *all_nodeversion_major
subset: *all_e2e_subsets
requires:
- build
@@ -429,45 +438,26 @@ workflows:
- e2e-tests:
name: e2e-snapshots-<< matrix.subset >>
- nodeversion: '16.13'
+ nodeversion: *default_nodeversion_major
matrix:
parameters:
subset: *all_e2e_subsets
snapshots: true
pre-steps:
- when:
+ # Don't run snapshot E2E's unless it's on the main branch or the snapshots file has been updated.
condition:
and:
- not:
equal: [main, << pipeline.git.branch >>]
- not: << pipeline.parameters.snapshot_changed >>
steps:
- # Don't run snapshot E2E's unless it's on the main branch or the snapshots file has been updated.
- run: circleci-agent step halt
requires:
- build
- filters:
- branches:
- only:
- - main
- # This is needed to run this steps on Renovate PRs that amend the snapshots package.json
- - /^pull\/.*/
+ <<: *only_snapshot_branches
- # Bazel jobs
- # These jobs only really depend on Setup, but the build job is very quick to run (~35s) and
- # will catch any build errors before proceeding to the more lengthy and resource intensive
- # Bazel jobs.
- - unit-test:
- name: test-node<< matrix.nodeversion >>
- matrix:
- parameters:
- nodeversion: *all_nodeversion_major
- requires:
- - build
-
- # Compile the e2e tests with bazel to ensure the non-runtime typescript
- # compilation completes succesfully.
- - build-bazel-e2e:
+ - test-browsers:
requires:
- build
diff --git a/.circleci/env.sh b/.circleci/env.sh
index 6ec09ef85153..e6ae354a6a7c 100755
--- a/.circleci/env.sh
+++ b/.circleci/env.sh
@@ -36,3 +36,8 @@ source $BASH_ENV;
# Disable husky.
setPublicVar HUSKY 0
+
+# Expose the Bazelisk version. We need to run Bazelisk globally since Windows has problems launching
+# Bazel from a node modules directoy that might be modified by the Bazel Yarn install then.
+setPublicVar BAZELISK_VERSION \
+ "$(cd ${PROJECT_ROOT}; node -p 'require("./package.json").devDependencies["@bazel/bazelisk"]')"
\ No newline at end of file
diff --git a/.circleci/github_token b/.circleci/github_token
deleted file mode 100644
index 450cb2c93f8c..000000000000
--- a/.circleci/github_token
+++ /dev/null
@@ -1 +0,0 @@
-Salted__z"BY|ۍVQֳUzW/GRe}j%<%
\ No newline at end of file
diff --git a/.circleci/win-ram-disk.ps1 b/.circleci/win-ram-disk.ps1
index 5d16d8b8a11d..a73bdcdb06b7 100644
--- a/.circleci/win-ram-disk.ps1
+++ b/.circleci/win-ram-disk.ps1
@@ -26,5 +26,6 @@ if (-not (Test-Path -Path $aimContents)) {
./aim/cli/x64/aim_ll.exe --install ./aim/drivers
# Setup RAM disk mount. Same parameters as ImDisk
+# Ensure size is large enough to support the bazel 'shard_count's such as for e2e tests.
# See: https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk
-./aim/cli/x64/aim_ll.exe -a -s 5G -m X: -p "/fs:ntfs /q /y"
+./aim/cli/x64/aim_ll.exe -a -s 12G -m X: -p "/fs:ntfs /q /y"
diff --git a/.eslintignore b/.eslintignore
index c3cc98e062af..3be6763ed0db 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,6 +1,7 @@
/bazel-out/
/dist-schema/
/goldens/public-api
+/packages/angular_devkit/build_angular/src/babel-bazel.d.ts
/packages/angular_devkit/build_angular/test/
/packages/angular_devkit/build_webpack/test/
/packages/angular_devkit/schematics_cli/blank/project-files/
diff --git a/.github/angular-robot.yml b/.github/angular-robot.yml
index d5105974613c..3e3a56a25603 100644
--- a/.github/angular-robot.yml
+++ b/.github/angular-robot.yml
@@ -67,21 +67,21 @@ triage:
defaultMilestone: 12,
# arrays of labels that determine if an issue has been triaged by the caretaker
l1TriageLabels:
- - - 'comp: *'
+ - - 'area: *'
# arrays of labels that determine if an issue has been fully triaged
l2TriageLabels:
- - 'type: bug/fix'
- 'severity*'
- 'freq*'
- - 'comp: *'
+ - 'area: *'
- - 'type: feature'
- - 'comp: *'
+ - 'area: *'
- - 'type: refactor'
- - 'comp: *'
+ - 'area: *'
- - 'type: RFC / Discussion / question'
- - 'comp: *'
+ - 'area: *'
- - 'type: docs'
- - 'comp: *'
+ - 'area: *'
# Size checking
size:
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index cc8aa2b2c506..a01353b6bcf0 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -8,7 +8,7 @@ updates:
commit-message:
prefix: 'build'
labels:
- - 'comp: build & ci'
+ - 'area: build & ci'
- 'target: patch'
- 'action: merge'
# Disable version updates
diff --git a/.github/workflows/assistant-to-the-branch-manager.yml b/.github/workflows/assistant-to-the-branch-manager.yml
new file mode 100644
index 000000000000..38c85ddcc037
--- /dev/null
+++ b/.github/workflows/assistant-to-the-branch-manager.yml
@@ -0,0 +1,21 @@
+name: DevInfra
+
+on:
+ push:
+ pull_request_target:
+ types: [opened, synchronize, reopened, ready_for_review, labeled]
+
+# Declare default permissions as read only.
+permissions:
+ contents: read
+
+jobs:
+ assistant_to_the_branch_manager:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
+ with:
+ persist-credentials: false
+ - uses: angular/dev-infra/github-actions/branch-manager@98bdad2a2ff3cd66c78048a3d2f48d50389c494a
+ with:
+ angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
diff --git a/.github/workflows/dev-infra.yml b/.github/workflows/dev-infra.yml
index 8b594c938033..44877e48f2c2 100644
--- a/.github/workflows/dev-infra.yml
+++ b/.github/workflows/dev-infra.yml
@@ -12,14 +12,14 @@ jobs:
labels:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- - uses: angular/dev-infra/github-actions/commit-message-based-labels@2e999e1982762a32f68ba8afa02b8bfdac8495b8
+ - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
+ - uses: angular/dev-infra/github-actions/commit-message-based-labels@98bdad2a2ff3cd66c78048a3d2f48d50389c494a
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- - uses: angular/dev-infra/github-actions/post-approval-changes@2e999e1982762a32f68ba8afa02b8bfdac8495b8
+ - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
+ - uses: angular/dev-infra/github-actions/post-approval-changes@98bdad2a2ff3cd66c78048a3d2f48d50389c494a
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
diff --git a/.github/workflows/feature-requests.yml b/.github/workflows/feature-requests.yml
index c2242e9c3144..881402867804 100644
--- a/.github/workflows/feature-requests.yml
+++ b/.github/workflows/feature-requests.yml
@@ -16,6 +16,6 @@ jobs:
if: github.repository == 'angular/angular-cli'
runs-on: ubuntu-latest
steps:
- - uses: angular/dev-infra/github-actions/feature-request@2e999e1982762a32f68ba8afa02b8bfdac8495b8
+ - uses: angular/dev-infra/github-actions/feature-request@98bdad2a2ff3cd66c78048a3d2f48d50389c494a
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
diff --git a/.github/workflows/lock-closed.yml b/.github/workflows/lock-closed.yml
index 957ec6ff7942..f32596777de1 100644
--- a/.github/workflows/lock-closed.yml
+++ b/.github/workflows/lock-closed.yml
@@ -13,6 +13,6 @@ jobs:
lock_closed:
runs-on: ubuntu-latest
steps:
- - uses: angular/dev-infra/github-actions/lock-closed@2e999e1982762a32f68ba8afa02b8bfdac8495b8
+ - uses: angular/dev-infra/github-actions/lock-closed@98bdad2a2ff3cd66c78048a3d2f48d50389c494a
with:
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
index 237fdf4e4ab4..f1ab28e039a3 100644
--- a/.github/workflows/scorecard.yml
+++ b/.github/workflows/scorecard.yml
@@ -25,12 +25,12 @@ jobs:
steps:
- name: 'Checkout code'
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
+ uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
with:
persist-credentials: false
- name: 'Run analysis'
- uses: ossf/scorecard-action@e363bfca00e752f91de7b7d2a77340e2e523cb18 # tag=v2.0.4
+ uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # tag=v2.1.2
with:
results_file: results.sarif
results_format: sarif
@@ -38,7 +38,7 @@ jobs:
# Upload the results as artifacts.
- name: 'Upload artifact'
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3.1.0
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3.1.2
with:
name: SARIF file
path: results.sarif
@@ -46,6 +46,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
- uses: github/codeql-action/upload-sarif@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2.1.27
+ uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
with:
sarif_file: results.sarif
diff --git a/.ng-dev/github.mts b/.ng-dev/github.mts
index b7d89780ba4b..408c672bb8a4 100644
--- a/.ng-dev/github.mts
+++ b/.ng-dev/github.mts
@@ -8,4 +8,5 @@ export const github: GithubConfig = {
owner: 'angular',
name: 'angular-cli',
mainBranchName: 'main',
+ useNgDevAuthService: true,
};
diff --git a/.ng-dev/pull-request.mts b/.ng-dev/pull-request.mts
index 6bbdae4b8783..1bf246fdcdce 100644
--- a/.ng-dev/pull-request.mts
+++ b/.ng-dev/pull-request.mts
@@ -7,9 +7,6 @@ import { PullRequestConfig } from '@angular/ng-dev';
export const pullRequest: PullRequestConfig = {
githubApiMerge: {
default: 'rebase',
- labels: [{ pattern: 'squash commits', method: 'squash' }],
+ labels: [{ pattern: 'merge: squash commits', method: 'squash' }],
},
- mergeReadyLabel: 'action: merge',
- caretakerNoteLabel: 'action: merge-assistance',
- commitMessageFixupLabel: 'needs commit fixup',
};
diff --git a/.ng-dev/release.mts b/.ng-dev/release.mts
index 8e2e2333b141..3bea8ad359c2 100644
--- a/.ng-dev/release.mts
+++ b/.ng-dev/release.mts
@@ -1,8 +1,6 @@
-import '../lib/bootstrap-local.js';
-
+import semver from 'semver';
import { ReleaseConfig } from '@angular/ng-dev';
import packages from '../lib/packages.js';
-import buildPackages from '../scripts/build.js';
const npmPackages = Object.entries(packages.releasePackages).map(([name, { experimental }]) => ({
name,
@@ -13,7 +11,20 @@ const npmPackages = Object.entries(packages.releasePackages).map(([name, { exper
export const release: ReleaseConfig = {
representativeNpmPackage: '@angular/cli',
npmPackages,
- buildPackages: () => buildPackages.default(),
+ buildPackages: async () => {
+ // The `performNpmReleaseBuild` function is loaded at runtime to avoid loading additional
+ // files and dependencies unless a build is required.
+ const { performNpmReleaseBuild } = await import('../scripts/build-packages-dist.mjs');
+ return performNpmReleaseBuild();
+ },
+ prereleaseCheck: async (newVersionStr: string) => {
+ const newVersion = new semver.SemVer(newVersionStr);
+ const { assertValidDependencyRanges } = await import(
+ '../scripts/release-checks/dependency-ranges/index.mjs'
+ );
+
+ await assertValidDependencyRanges(newVersion, packages.releasePackages);
+ },
releaseNotes: {
groupOrder: [
'@angular/cli',
diff --git a/.ng-dev/tsconfig.json b/.ng-dev/tsconfig.json
index 12cf63f79e32..2a26627bc905 100644
--- a/.ng-dev/tsconfig.json
+++ b/.ng-dev/tsconfig.json
@@ -3,7 +3,8 @@
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16",
- "noEmit": true
+ "noEmit": true,
+ "types": []
},
"include": ["**/*.mts"],
"exclude": []
diff --git a/BUILD.bazel b/BUILD.bazel
index 3fc46c3f3b32..b498ed4a3e94 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -3,6 +3,7 @@
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
package(default_visibility = ["//visibility:public"])
@@ -16,6 +17,14 @@ exports_files([
"package.json",
])
+# Files required by e2e tests
+copy_to_bin(
+ name = "config-files",
+ srcs = [
+ "package.json",
+ ],
+)
+
# Detect if the build is running under --stamp
config_setting(
name = "stamp",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74e63ea942a0..2d3e8e40512f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,59 +1,344 @@
-
+
-# 15.0.0-next.4 (2022-10-05)
+# 15.2.4 (2023-03-16)
-## Breaking Changes
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------- |
+| [f74bfea24](https://github.com/angular/angular-cli/commit/f74bfea241b189f261ec81a8561aea7a56774ae8) | fix | update `webpack` dependency to `5.76.1` |
+
+## Special Thanks
+
+Alan Agius
+
+
+
+
+
+# 15.2.3 (2023-03-15)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------- |
+| [a93680585](https://github.com/angular/angular-cli/commit/a9368058517509b277236d6e7db4abc6248817fa) | fix | correct wrap ES2022 classes with static properties |
+
+## Special Thanks
+
+Alan Agius and Paul Gschwendtner
+
+
+
+
+
+# 15.2.2 (2023-03-08)
+
+### @angular-devkit/schematics-cli
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------- |
+| [dfd03aa7c](https://github.com/angular/angular-cli/commit/dfd03aa7c262f4425fa680e205a46792bd7b8451) | fix | correctly transform numbers from prompts |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------- |
+| [eb22f634f](https://github.com/angular/angular-cli/commit/eb22f634f2ec7a5b0bc2f5300682ed8e718b1424) | fix | build optimizer support for non spec-compliant ES2022 class static properties |
+
+## Special Thanks
+
+Alan Agius
+
+
+
+
+
+# 15.2.1 (2023-03-01)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------- |
+| [9a5609a44](https://github.com/angular/angular-cli/commit/9a5609a440fc49b3f7ddf88efb73618b7eede1ea) | fix | improve parsing of error messages |
+
+## Special Thanks
+
+Alan Agius and Paul Gschwendtner
+
+
+
+
+
+# 15.2.0 (2023-02-22)
### @angular/cli
-- Node.js versions older than 14.20 are no longer supported.
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------- |
+| [0f58a17c4](https://github.com/angular/angular-cli/commit/0f58a17c4ce92495d96721bc3f2b632a890bbab4) | feat | log number of files update during `ng update` |
+
+### @angular-devkit/schematics-cli
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------- |
+| [ecf43090d](https://github.com/angular/angular-cli/commit/ecf43090d110f996f45a259c279f1b83dcab3fd8) | feat | auto detect package manager ([#24305](https://github.com/angular/angular-cli/pull/24305)) |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------- |
+| [01b3bcf89](https://github.com/angular/angular-cli/commit/01b3bcf898108f9b879da4a791fa2a21c6d9f7c5) | feat | add Less stylesheet support to experimental esbuild-based builder |
+| [09af70743](https://github.com/angular/angular-cli/commit/09af70743800aefdefe06e0ca32bcdde18f9eb77) | feat | implement node module license extraction for esbuild builder |
+| [bbc1a4f0d](https://github.com/angular/angular-cli/commit/bbc1a4f0dc93437fe97a53a35f68d978cc50bb9e) | feat | support CommonJS dependency checking in esbuild |
+| [8cf0d17fb](https://github.com/angular/angular-cli/commit/8cf0d17fb1b39ea7bbd1c751995a56de3df45114) | feat | support JIT compilation with esbuild |
+| [3f6769ef9](https://github.com/angular/angular-cli/commit/3f6769ef953b1f880508a9152e669064cbb4dcc9) | fix | allow empty scripts to be optimized |
+| [421417a36](https://github.com/angular/angular-cli/commit/421417a36b13a44d39e0818171482871ea8b895f) | fix | avoid CommonJS warning for zone.js in esbuild |
+
+## Special Thanks
+
+Alan Agius, Charles Lyding, Doug Parker, Jason Bedard, Joey Perrott, Marvin and Paul Gschwendtner
+
+
+
+
+
+# 15.1.6 (2023-02-15)
+
+### @angular/cli
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------- |
+| [3d1f48fa2](https://github.com/angular/angular-cli/commit/3d1f48fa2991ded75da3a1b3a431480710a8ce15) | fix | add set `SessionEngaged` in GA |
+| [df07ab113](https://github.com/angular/angular-cli/commit/df07ab11351d6f2d82922ae251ccd17b23d9d0a9) | fix | convert `before` option in `.npmrc` to Date |
+| [c787cc780](https://github.com/angular/angular-cli/commit/c787cc7803598eb67260cbd2112d411384d518cc) | fix | replace `os.version` with `os.release`. |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| [34a4a1bbf](https://github.com/angular/angular-cli/commit/34a4a1bbf608eb54b0a33b3aa3a6be3e2a576770) | fix | correctly copy `safety-worker.js` contents |
+| [88a33155d](https://github.com/angular/angular-cli/commit/88a33155d4bc00077d32bef42588427fb2ed49f4) | fix | update the ECMA output warning message to be more actionable |
+| [384ad29c9](https://github.com/angular/angular-cli/commit/384ad29c9a66d78e545ed7e48bf962e4df9d0549) | fix | use babel default export helper in build optimizer |
+| [59aa1cdbd](https://github.com/angular/angular-cli/commit/59aa1cdbdf3e2712f988790f68bacc174d070b0c) | perf | reduce rebuilt times when using the `scripts` option |
+
+## Special Thanks
+
+Alan Agius and Charles Lyding
+
+
+
+
+
+# 15.1.5 (2023-02-08)
+
+### @angular/cli
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ |
+| [b8bbe9688](https://github.com/angular/angular-cli/commit/b8bbe9688e0e684245636e7d58d50c51719039c8) | fix | error if Angular compiler is used in a schematic |
+| [fabbb8a93](https://github.com/angular/angular-cli/commit/fabbb8a936f3b3b1cee8ea5cbdb7bb7832cb02a7) | fix | only set `DebugView` when `NG_DEBUG` is passed |
### @schematics/angular
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------- |
-| [b6897dbb0](https://github.com/angular/angular-cli/commit/b6897dbb0a1ef287644e117251c1c76cc8afcae0) | feat | remove `karma.conf.js` from newly generated projects |
-| [301b5669a](https://github.com/angular/angular-cli/commit/301b5669a724261d53444d5172334966903078c0) | feat | remove `ngOnInit` from component template |
-| [84e3f7727](https://github.com/angular/angular-cli/commit/84e3f7727dc1de31484704c7c06d51ff5392a34a) | fix | remove empty lines |
+| [499173b5d](https://github.com/angular/angular-cli/commit/499173b5d197f14377203b92b49ff3cbbf55b260) | fix | remove bootstrapping wrapping in universal schematic |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------- |
+| [e87134fe9](https://github.com/angular/angular-cli/commit/e87134fe94831df76698fe0e90fe556da0011511) | fix | build optimizer support for spec-compliant downlevel class properties |
+| [d80adde2f](https://github.com/angular/angular-cli/commit/d80adde2fec53e6513983a89dd194a35c426b8aa) | fix | do not fail compilation when spec pattern does not match |
+| [11be502e7](https://github.com/angular/angular-cli/commit/11be502e7cc2544371d55c8b3d32b7bcbbf8066e) | fix | fix support of Safari TP versions |
+| [14e317d85](https://github.com/angular/angular-cli/commit/14e317d85429c83e6285c5cec4a1c4483d8a1c8f) | fix | load polyfills and runtime as scripts instead of modules |
+
+## Special Thanks
+
+Alan Agius, Charles Lyding, Kristiyan Kostadinov and Ricardo
+
+
+
+
+
+# 15.1.4 (2023-02-01)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------- |
+| [6c8fdfc69](https://github.com/angular/angular-cli/commit/6c8fdfc6985c5b5017a0b6ab6fa38daf4cb9a775) | fix | load JavaScript bundles as modules in karma |
+| [317452e3b](https://github.com/angular/angular-cli/commit/317452e3b7e25080132b7f7a069696d1c5054f69) | fix | print server builder errors and warnings |
+
+## Special Thanks
+
+Alan Agius
+
+
+
+
+
+# 15.1.3 (2023-01-25)
### @angular/cli
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------- |
-| [4b623461a](https://github.com/angular/angular-cli/commit/4b623461a4a938ba320b5e019f9c715d634a46c4) | feat | drop support for Node.js versions older than 14.20 |
+| [de15ec576](https://github.com/angular/angular-cli/commit/de15ec5763afe231439c3f1ace35cbacefad2ca7) | fix | handle extended schematics when retrieving aliases |
+
+### @schematics/angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------- |
+| [2c04f4a8f](https://github.com/angular/angular-cli/commit/2c04f4a8f493781fda65f31e81ad86cdd3e510c0) | fix | update browserslist config to include last 2 Chrome version |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| [f31bf300b](https://github.com/angular/angular-cli/commit/f31bf300b9f226d9574060b0e4401c4da88c0ee3) | fix | avoid undefined module path for Sass imports in esbuild |
+| [c152a4a13](https://github.com/angular/angular-cli/commit/c152a4a13f482948c6aedbbc99d1423f2cf43aea) | fix | update browserslist config to include last 2 Chrome versions |
+
+### @angular-devkit/core
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------- |
+| [9de99202e](https://github.com/angular/angular-cli/commit/9de99202e9427973c7983940fcdea9e4580a79bd) | fix | handle number like strings in workspace writer |
+
+## Special Thanks
+
+Alan Agius, Charles Lyding and Doug Parker
+
+
+
+
+
+# 15.1.2 (2023-01-18)
+
+### @angular/cli
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------------- |
+| [387472a95](https://github.com/angular/angular-cli/commit/387472a956b71eaca89e210e64f4d75969abc9d3) | fix | register schematic aliases when providing collection name in `ng generate` |
+| [5d9fd788a](https://github.com/angular/angular-cli/commit/5d9fd788a997066dea1b2d69dced865a7c60f5c1) | fix | remove `--to` option from being required when using `--from` in `ng update` |
+
+### @schematics/angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------------------------------- |
+| [0f5fb7e59](https://github.com/angular/angular-cli/commit/0f5fb7e5944e3a521758c67f403d71928f93f7ac) | fix | replace existing `BrowserModule.withServerTransition` calls when running universal schematic |
### @angular-devkit/build-angular
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------- |
-| [67324b3e5](https://github.com/angular/angular-cli/commit/67324b3e5861510b1df9641bb4b10bb67e3a2325) | feat | add initial incremental code rebuilding to esbuild builder |
-| [3d94ca21b](https://github.com/angular/angular-cli/commit/3d94ca21bbb7496a2ff588166fd93c5f2339b823) | feat | add initial watch support to esbuild-based builder |
-| [2b6029245](https://github.com/angular/angular-cli/commit/2b602924538bf987e92f806c25c2a3d008a3f0a9) | feat | providing a karma config is now optional |
-| [f9a2c3a12](https://github.com/angular/angular-cli/commit/f9a2c3a1216cf9510e122df44a64ddd11d47226b) | fix | allow both script and module sourceTypes to be localized |
-| [b6df9c136](https://github.com/angular/angular-cli/commit/b6df9c1367ae5795a3895628ec9822d432b315bb) | fix | handle conditional exports in `scripts` and `styles` option |
-| [8f8e02c32](https://github.com/angular/angular-cli/commit/8f8e02c3221c9477ec931bb6983daf6a2c8dc8be) | fix | support Yarn PNP resolution in modern SASS API |
+| [bf4639a6e](https://github.com/angular/angular-cli/commit/bf4639a6e97670972c3d5b137230e2f08467010e) | fix | prevent hanging initial build during exception with esbuild |
-### @angular-devkit/schematics
+## Special Thanks
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- |
-| [8eb58bdbe](https://github.com/angular/angular-cli/commit/8eb58bdbe034e2cbae9cdae058ad4633c8f2a761) | fix | throw more relevant error when Rule returns invalid null value |
+Alan Agius, Charles Lyding and Doug Parker
+
+
+
+
+
+# 15.1.1 (2023-01-12)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------- |
+| [b94bf60ca](https://github.com/angular/angular-cli/commit/b94bf60ca828a22d548d65b819ea745eafb96deb) | fix | update `esbuild` to `0.16.17` |
## Special Thanks
-Alan Agius, Brent Schmidt, Charles Lyding, Cédric Exbrayat and minijus
+Alan Agius
-
+
-# 14.2.5 (2022-10-05)
+# 15.1.0 (2023-01-11)
+
+## Deprecations
### @angular-devkit/schematics
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- |
-| [17eb20c77](https://github.com/angular/angular-cli/commit/17eb20c77098841d45f0444f5f047c4d44fc614f) | fix | throw more relevant error when Rule returns invalid null value |
+- The Observable based `SchematicTestRunner.runSchematicAsync` and `SchematicTestRunner.runExternalSchematicAsync` method have been deprecated in favor of the Promise based `SchematicTestRunner.runSchematic` and `SchematicTestRunner.runExternalSchematic`.
+
+### @schematics/angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------- |
+| [5b18ce154](https://github.com/angular/angular-cli/commit/5b18ce1545d047d49851a64e81a1f8ef59624ef7) | feat | add `guardType` as an alias of `implements` in guard schematic |
+| [dd2b65943](https://github.com/angular/angular-cli/commit/dd2b65943d706833f449f76cf8c7278d0a5399ad) | feat | add configuration files generation schematic |
+| [8d000d156](https://github.com/angular/angular-cli/commit/8d000d1563684f9a9b6869e549e265f0997187c4) | feat | add environments generation schematic |
+| [6c39a162b](https://github.com/angular/angular-cli/commit/6c39a162bec67083bf6c11b54e84612f1d68c384) | feat | Add schematics for generating functional router guards and resolvers |
+| [62121f89a](https://github.com/angular/angular-cli/commit/62121f89abce54e0a1c2b816cdd32b57f2b5a5d1) | feat | add sideEffects:false to library package.json |
+| [9299dea64](https://github.com/angular/angular-cli/commit/9299dea6492527bcaea24c9c7f3116ee2779405b) | feat | generate functional interceptors |
+| [49b313f27](https://github.com/angular/angular-cli/commit/49b313f27adef6300063c9d6817d1454a8657fe2) | fix | add missing import for functional interceptor spec |
+| [2f92fe7e5](https://github.com/angular/angular-cli/commit/2f92fe7e589705b282102271897454ea852c4814) | fix | add missing semicolon in functional guard/resolver/interceptor |
+| [9b6d190f4](https://github.com/angular/angular-cli/commit/9b6d190f4a082c166d253b0f00162e0286238e45) | fix | remove EnvironmentInjector import in functional guard spec |
+| [b11d3f644](https://github.com/angular/angular-cli/commit/b11d3f6442d38f609471ab19c08a1c9a871e0ae3) | fix | use proper variable in functional guard spec |
+| [451975f76](https://github.com/angular/angular-cli/commit/451975f7650041a83994e1308f85fe7e33a31e32) | fix | use proper variable in resolver functional spec |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| [c29df6954](https://github.com/angular/angular-cli/commit/c29df695467c41feccd3846a55c91c6784af87b2) | feat | add `assets` option to server builder |
+| [839d0cb57](https://github.com/angular/angular-cli/commit/839d0cb57ad42896578c235354ffb918ea8bb146) | feat | implement stats-json option for esbuild builder |
+| [216991b9d](https://github.com/angular/angular-cli/commit/216991b9d9ca1d8f09992880a5fa92e7c98813fa) | feat | support inline component Sass styles with esbuild builder |
+| [7c87ce47c](https://github.com/angular/angular-cli/commit/7c87ce47c66a6426b6b7fbb2edd38d8da729221f) | fix | ensure Sass load paths are resolved from workspace root |
+| [7a063238b](https://github.com/angular/angular-cli/commit/7a063238b83eea8b5b3237fed12db5528d1f6912) | fix | explicitly send options to JS transformer workers |
+| [22cba7937](https://github.com/angular/angular-cli/commit/22cba79370ed60a27f932acda363ffd87f5d9983) | fix | provide an option to `exclude` specs in Karma builder |
+| [20376649c](https://github.com/angular/angular-cli/commit/20376649c5e3003b0aa99b9328e2b61699ccba78) | fix | transform async generator class methods for Zone.js support |
+| [0520608f6](https://github.com/angular/angular-cli/commit/0520608f68f1768a13a46fbdb9ecb65310492460) | fix | use relative css resource paths in esbuild JSON stats |
+| [0c01532cb](https://github.com/angular/angular-cli/commit/0c01532cb5a3072b96cd65845a38b88ed4543de6) | perf | use worker pool for JavaScript transforms in esbuild builder |
+
+### @angular-devkit/schematics
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------- |
+| [207358afb](https://github.com/angular/angular-cli/commit/207358afb89e6515cb8d73f5a3a63d9101e80d97) | feat | add `runSchematic` and `runExternalSchematic` methods |
+
+## Special Thanks
+
+Alan Agius, Andrew Scott, Charles Lyding, Cédric Exbrayat, Doug Parker, Felix Hamann, Jason Bedard, Joey Perrott and Kristiyan Kostadinov
+
+
+
+
+
+# 15.0.5 (2023-01-06)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- |
+| [c2030dec7](https://github.com/angular/angular-cli/commit/c2030dec7d9fecf42cca2de37cc3f7adaaa45e7f) | fix | format esbuild error messages to include more information |
+
+## Special Thanks
+
+Alan Agius, Kristiyan Kostadinov, Paul Gschwendtner and aanchal
+
+
+
+
+
+# 15.0.4 (2022-12-14)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------- |
+| [ccc8e0350](https://github.com/angular/angular-cli/commit/ccc8e0350810d123269f55de29acd7964e663f7e) | fix | display actionable error when a style does not exist in Karma builder |
+| [507f756c3](https://github.com/angular/angular-cli/commit/507f756c34171db842365398150460e1e29f531a) | fix | downlevel class private methods when targeting Safari <=v15 |
+| [a0da91dba](https://github.com/angular/angular-cli/commit/a0da91dba3d9b4c4a86102668f52ab933406e5da) | fix | include sources in generated |
+| [9fd356234](https://github.com/angular/angular-cli/commit/9fd356234210734ec5f44ae18f055308b7acc963) | fix | only set ngDevMode when script optimizations are enabled |
+| [8e85f4728](https://github.com/angular/angular-cli/commit/8e85f47284472f9df49f2ca6c59057ad28240e9c) | fix | update `css-loader` to `6.7.3` |
+| [b2d4415ca](https://github.com/angular/angular-cli/commit/b2d4415caa486bebe55e6147a153f120cf08b070) | fix | update locale setting snippet to use `globalThis`. |
## Special Thanks
@@ -61,14 +346,105 @@ Alan Agius and Charles Lyding
-
+
-# 15.0.0-next.3 (2022-09-28)
+# 15.0.3 (2022-12-07)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------- |
+| [3d9971edb](https://github.com/angular/angular-cli/commit/3d9971edb05e9b8de24bafc1b4381cbf4bad8dbf) | fix | default preserve symlinks to Node.js value for esbuild |
+| [24f4b51d2](https://github.com/angular/angular-cli/commit/24f4b51d22a0debc8ff853cf9040a15273654f7a) | fix | downlevel class fields with Safari <= v15 for esbuild |
+| [45afc42db](https://github.com/angular/angular-cli/commit/45afc42db86e58357d1618d9984dcf03bffea957) | fix | downlevel class properties when targeting Safari <=v15 |
+| [e6461badf](https://github.com/angular/angular-cli/commit/e6461badf7959ff8b8d9a3824a4a081f44e0b237) | fix | prevent optimization adding unsupported ECMASCript features |
+
+## Special Thanks
+
+Charles Lyding, Dominic Elm and Paul Gschwendtner
+
+
+
+
+
+# 15.0.2 (2022-11-30)
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------ |
+| [2891d5bc9](https://github.com/angular/angular-cli/commit/2891d5bc9eecf7fa8e3b80906d9c56e6a49f3d15) | fix | correctly set Sass quietDeps and verbose options |
+
+### @ngtools/webpack
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------- |
+| [d9cc4b028](https://github.com/angular/angular-cli/commit/d9cc4b0289eaf382782a994a15497e9526c5a4a2) | fix | elide unused type references |
+
+## Special Thanks
+
+Alan Agius and Juuso Valkeejärvi
+
+
+
+
+
+# 15.0.1 (2022-11-23)
+
+### @angular/cli
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------- |
+| [eda96def4](https://github.com/angular/angular-cli/commit/eda96def48e11533cd0a3353c96b7eac9a881e1e) | fix | use global version of the CLI when running `ng new` |
+
+### @schematics/angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ |
+| [48426852b](https://github.com/angular/angular-cli/commit/48426852b0c1d5541a3e7369dc2b343e33856968) | fix | show warning when a TS Config is not found during migrations |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------- |
+| [2af32fd3a](https://github.com/angular/angular-cli/commit/2af32fd3a981b1c29e1cf77b442982e1e07aae38) | fix | hide loader paths in webpack warnings |
+| [19f5cc746](https://github.com/angular/angular-cli/commit/19f5cc746ec724f15d1b89126c7c1b8a343818fe) | fix | improve package deep import Sass index resolution in esbuild plugin |
+| [2220a907d](https://github.com/angular/angular-cli/commit/2220a907daf9ccd9e22dfc8e5ddc259b9d495997) | fix | use url function lexer to rebase Sass URLs |
+
+## Special Thanks
+
+Alan Agius, Charles Lyding, Doug Parker, Joey Perrott and Piotr Wysocki
+
+
+
+
+
+# 15.0.0 (2022-11-16)
## Breaking Changes
+### @angular/cli
+
+- The Angular CLI no longer supports `16.10.x`, `16.11.x` and `16.12.x`. Current minimum versions of Node.js are `14.20.0`, `16.13.0` and `18.10.0`.
+- Node.js versions older than 14.20 are no longer supported.
+- The 'path' option in schematics schema no longer has a special meaning. Use 'workingDirectory' smart default provider should be used instead.
+
+### @schematics/angular
+
+- Removed unused `appDir` option from Universal and App-Shell schematic. This option can safely be removed if present since it no longer has effect.
+
+###
+
+- `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`.
+
+- analytics APIs have been removed without replacement from `@angular-devkit/core` and `@angular-devkit/architect`.
+
### @angular-devkit/build-angular
+- TypeScript versions older than 4.8.2 are no longer supported.
- The server builder `bundleDependencies` option has been removed. This option was used pre Ivy. Currently, using this option is unlikely to produce working server bundles.
The `externalDependencies` option can be used instead to exclude specific node_module packages from the final bundle.
@@ -89,196 +465,321 @@ Alan Agius and Charles Lyding
- By default the CLI will use Sass modern API, While not recommended, users can still opt to use legacy API by setting `NG_BUILD_LEGACY_SASS=1`.
+- Internally the Angular CLI now always set the TypeScript `target` to `ES2022` and `useDefineForClassFields` to `false` unless the target is set to `ES2022` or later in the TypeScript configuration. To control ECMA version and features use the Browerslist configuration.
- `require.context` are no longer parsed. Webpack specific features are not supported nor guaranteed to work in the future.
+- Producing ES5 output is no longer possible. This was needed for Internet Explorer which is no longer supported. All browsers that Angular supports work with ES2015+
+- server builder `bundleDependencies` option now only accept a boolean value.
+- Deprecated support for Stylus has been removed. The Stylus package has never reached a stable version and its usage in the Angular CLI is minimal. It's recommended to migrate to another CSS preprocessor that the Angular CLI supports.
+
+### @angular-devkit/core
+
+- Workspace projects with missing `root` is now an error.
+
+### @ngtools/webpack
+
+- TypeScript versions older than 4.8.2 are no longer supported.
### @schematics/angular
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------ |
-| [766d4a089](https://github.com/angular/angular-cli/commit/766d4a0895e7895211e93bc73ff131c6e47613a7) | feat | add migration to remove require calls from karma builder main file |
-| [597bfea1b](https://github.com/angular/angular-cli/commit/597bfea1b29cc7b25d1f466eb313cbeeb6dffc98) | feat | drop `polyfills.ts` file from new templates |
-| [283b564d1](https://github.com/angular/angular-cli/commit/283b564d1de985f0af8c2fcb6192801a90baacda) | feat | remove environment files in new applications |
-| [56a1e8f9f](https://github.com/angular/angular-cli/commit/56a1e8f9f52658488afb9d36007e96c96d08a03b) | feat | remove test.ts file from new projects |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------ |
+| [766d4a089](https://github.com/angular/angular-cli/commit/766d4a0895e7895211e93bc73ff131c6e47613a7) | feat | add migration to remove require calls from karma builder main file |
+| [d8bff4f1e](https://github.com/angular/angular-cli/commit/d8bff4f1e68a76da1983f9d0774f415e73dfd8c3) | feat | Added --project-root option to the library schematics |
+| [597bfea1b](https://github.com/angular/angular-cli/commit/597bfea1b29cc7b25d1f466eb313cbeeb6dffc98) | feat | drop `polyfills.ts` file from new templates |
+| [1c21e470c](https://github.com/angular/angular-cli/commit/1c21e470c76d69d08e5096b46b952dbce330f7ef) | feat | enable error on unknown properties and elements in tests |
+| [f2a0682dc](https://github.com/angular/angular-cli/commit/f2a0682dc82afa23a3d3481df59e4aaca5e90c78) | feat | generate new projects using TypeScript 4.8.2 |
+| [b06421d15](https://github.com/angular/angular-cli/commit/b06421d15e4b5e6daffcb73ee1c2c8703b72cb47) | feat | mark `projectRoot` as non hidden option in application schematic |
+| [b6897dbb0](https://github.com/angular/angular-cli/commit/b6897dbb0a1ef287644e117251c1c76cc8afcae0) | feat | remove `karma.conf.js` from newly generated projects |
+| [301b5669a](https://github.com/angular/angular-cli/commit/301b5669a724261d53444d5172334966903078c0) | feat | remove `ngOnInit` from component template |
+| [9beb878e2](https://github.com/angular/angular-cli/commit/9beb878e2eecd32e499c8af557f22f46548248fc) | feat | remove Browserslist configuration files from projects |
+| [283b564d1](https://github.com/angular/angular-cli/commit/283b564d1de985f0af8c2fcb6192801a90baacda) | feat | remove environment files in new applications |
+| [56a1e8f9f](https://github.com/angular/angular-cli/commit/56a1e8f9f52658488afb9d36007e96c96d08a03b) | feat | remove test.ts file from new projects |
+| [4e69e8050](https://github.com/angular/angular-cli/commit/4e69e80501dd2a9394b7df4518e0d6b0f2ebb7d9) | fix | add `@angular/localize` as type when localize package is installed |
+| [57d93fb7d](https://github.com/angular/angular-cli/commit/57d93fb7d979e68c2a4e6f6046ff633f69098afe) | fix | mark project as required option |
+| [84e3f7727](https://github.com/angular/angular-cli/commit/84e3f7727dc1de31484704c7c06d51ff5392a34a) | fix | remove empty lines |
+| [316a50d75](https://github.com/angular/angular-cli/commit/316a50d75e45962ea3efe4108aa48d9479245dd5) | fix | remove TypeScript target from universal schematic |
+| [69b221498](https://github.com/angular/angular-cli/commit/69b2214987c8fad6efd091782cf28b20be62d244) | refactor | remove deprecated appDir option |
### @angular/cli
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------------- |
-| [23c233c29](https://github.com/angular/angular-cli/commit/23c233c296d4e264b36241fbba0b92ec00a00374) | fix | add builders and schematic names as page titles in collected analytics |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
+| [4827d1b23](https://github.com/angular/angular-cli/commit/4827d1b23e564e4e4a8684c5e8ff035d8fa855a2) | feat | add support for Node.js version 18 |
+| [4b623461a](https://github.com/angular/angular-cli/commit/4b623461a4a938ba320b5e019f9c715d634a46c4) | feat | drop support for Node.js versions older than 14.20 |
+| [3dea1fa71](https://github.com/angular/angular-cli/commit/3dea1fa7173e846aff5b0d15b919d9786bbf7198) | fix | add unique user id as user parameter in GA |
+| [af07aa340](https://github.com/angular/angular-cli/commit/af07aa340a1c3c9f3d42446981be59a73effa498) | fix | add workspace information as part of analytics collection |
+| [83524f625](https://github.com/angular/angular-cli/commit/83524f62533f9a6bda0c1dbc76c6b16e730a7397) | fix | allow `ng add` to find prerelease versions when CLI is prerelease |
+| [22955f245](https://github.com/angular/angular-cli/commit/22955f24592df8044dbdeeb8e635beb1cc770c75) | fix | do not collect analytics when running in non TTY mode |
+| [35e5f4278](https://github.com/angular/angular-cli/commit/35e5f4278145b7ef55a75f1692c8e92d6bcd59db) | fix | exclude `@angular/localize@<10.0.0` from ng add pa… ([#24152](https://github.com/angular/angular-cli/pull/24152)) |
+| [1a584364e](https://github.com/angular/angular-cli/commit/1a584364e70cafd84770ef45f3da9ad58a46083f) | fix | exclude `@angular/material@7.x` from ng add package discovery |
+| [ff0382718](https://github.com/angular/angular-cli/commit/ff0382718af60923fe71f8b224d36a50449484e6) | fix | respect registry in RC when running update through yarn |
+| [774d349b7](https://github.com/angular/angular-cli/commit/774d349b73a436a99f2ea932b7509dab7c1d5e45) | refactor | remove deprecated path handler |
-### @angular-devkit/build-angular
+###
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------- |
-| [4ead45cab](https://github.com/angular/angular-cli/commit/4ead45caba08cb0b67dc7df2f6a9b304c75fff7d) | feat | add `ng-server-context` when using app-shell builder |
-| [c592ec584](https://github.com/angular/angular-cli/commit/c592ec584f1c0b126a2045e5ea1b01cb1569ce4d) | feat | amend `polyfills` option in all builders to support an array of module specifiers |
-| [05a98c029](https://github.com/angular/angular-cli/commit/05a98c02924f656be3257d5f459ae88c1ae29fba) | feat | karma builder `main` option is now optional |
-| [9c13fce16](https://github.com/angular/angular-cli/commit/9c13fce162eff8d01d1fa6a7f0e0029da2887c86) | feat | remove `bundleDependencies` from server builder |
-| [308e3a017](https://github.com/angular/angular-cli/commit/308e3a017f876bfc727e68803bfbce11e9d3396e) | feat | switch to use Sass modern API |
-| [fb5a66ae6](https://github.com/angular/angular-cli/commit/fb5a66ae66b595602d2a8aea8e938efe5df6d13c) | fix | fix crash when Sass error occurs |
-| [f393b0928](https://github.com/angular/angular-cli/commit/f393b09282582da47db683344e037fd1434b32a8) | refactor | disable `requireContext` parsing |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------- |
+| [639a3071c](https://github.com/angular/angular-cli/commit/639a3071c3630c1ccdf7e3c015e81e9423ab2678) | refactor | migrate analytics collector to use GA4 |
+| [c969152de](https://github.com/angular/angular-cli/commit/c969152de630a9afdef44ba2342e728b9353c8e7) | refactor | remove analytics API from core and architect |
-## Special Thanks
+### @angular-devkit/build-angular
-Alan Agius, Jason Bedard and Paul Gschwendtner
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------- |
+| [4ead45cab](https://github.com/angular/angular-cli/commit/4ead45caba08cb0b67dc7df2f6a9b304c75fff7d) | feat | add `ng-server-context` when using app-shell builder |
+| [1c527a9da](https://github.com/angular/angular-cli/commit/1c527a9da5b55a8421ebca787fd322e879f6d29d) | feat | add esbuild-based builder initial support for fileReplacements |
+| [67324b3e5](https://github.com/angular/angular-cli/commit/67324b3e5861510b1df9641bb4b10bb67e3a2325) | feat | add initial incremental code rebuilding to esbuild builder |
+| [3d94ca21b](https://github.com/angular/angular-cli/commit/3d94ca21bbb7496a2ff588166fd93c5f2339b823) | feat | add initial watch support to esbuild-based builder |
+| [c592ec584](https://github.com/angular/angular-cli/commit/c592ec584f1c0b126a2045e5ea1b01cb1569ce4d) | feat | amend `polyfills` option in all builders to support an array of module specifiers |
+| [a95d130ef](https://github.com/angular/angular-cli/commit/a95d130ef4249457ed2433d52eb43c94a1169782) | feat | auto include `@angular/localize/init` when found in `types` |
+| [979bce45e](https://github.com/angular/angular-cli/commit/979bce45e63eda9ac5402869ef3dc4c63aaca3f1) | feat | auto include `@angular/platform-server/init` during server builds |
+| [fd4175357](https://github.com/angular/angular-cli/commit/fd41753579affa78328bfc4b6108db15ff5053f9) | feat | drop support for TypeScript 4.6 and 4.7 |
+| [15d3fc6dc](https://github.com/angular/angular-cli/commit/15d3fc6dc3f74462818b3745f6fb4995212a4d22) | feat | export `@angular/platform-server` symbols in server bundle |
+| [05a98c029](https://github.com/angular/angular-cli/commit/05a98c02924f656be3257d5f459ae88c1ae29fba) | feat | karma builder `main` option is now optional |
+| [2b6029245](https://github.com/angular/angular-cli/commit/2b602924538bf987e92f806c25c2a3d008a3f0a9) | feat | providing a karma config is now optional |
+| [9c13fce16](https://github.com/angular/angular-cli/commit/9c13fce162eff8d01d1fa6a7f0e0029da2887c86) | feat | remove `bundleDependencies` from server builder |
+| [308e3a017](https://github.com/angular/angular-cli/commit/308e3a017f876bfc727e68803bfbce11e9d3396e) | feat | switch to use Sass modern API |
+| [1e5d4a750](https://github.com/angular/angular-cli/commit/1e5d4a75084dfd2aeebb6a0c0b3039417e14bc84) | feat | use Browserslist to determine ECMA output |
+| [3ff391738](https://github.com/angular/angular-cli/commit/3ff39173808f2beed97ee5deb91be541205f9a03) | fix | account for package.json exports fields with CSS import statements |
+| [001445982](https://github.com/angular/angular-cli/commit/0014459820dc1c127e93993414c154947a7f8da6) | fix | account for package.json exports with Sass in esbuild builder |
+| [6280741ce](https://github.com/angular/angular-cli/commit/6280741ce4a89882595c834f48a45cca6f9534e0) | fix | add `@angular/platform-server` as an optional peer dependency |
+| [f9a2c3a12](https://github.com/angular/angular-cli/commit/f9a2c3a1216cf9510e122df44a64ddd11d47226b) | fix | allow both script and module sourceTypes to be localized |
+| [4cb27b803](https://github.com/angular/angular-cli/commit/4cb27b8031d0f36e687c5116538ebe473acaa149) | fix | avoid attempted resolve of external CSS URLs with esbuild builder |
+| [192e0e6d7](https://github.com/angular/angular-cli/commit/192e0e6d77d4f0f20af3f88b653c5196a2c1e052) | fix | correct escaping of target warning text in esbuild builder |
+| [4fcb0a82b](https://github.com/angular/angular-cli/commit/4fcb0a82b5fa8a092d8c374cdea448edd80270d4) | fix | correctly resolve Sass partial files in node packages |
+| [fb5a66ae6](https://github.com/angular/angular-cli/commit/fb5a66ae66b595602d2a8aea8e938efe5df6d13c) | fix | fix crash when Sass error occurs |
+| [b6df9c136](https://github.com/angular/angular-cli/commit/b6df9c1367ae5795a3895628ec9822d432b315bb) | fix | handle conditional exports in `scripts` and `styles` option |
+| [0ee7625d6](https://github.com/angular/angular-cli/commit/0ee7625d6b4bd84be6fca0df82f3e74e4b94728c) | fix | ignore cache path when watching with esbuild builder |
+| [e34bfe5eb](https://github.com/angular/angular-cli/commit/e34bfe5eb1a559cbf53449ce213503e32fa27ae4) | fix | ignore specs in node_modules when finding specs |
+| [f143171fd](https://github.com/angular/angular-cli/commit/f143171fd030fa1cc8df84ed5f0b96f5ad0f9e10) | fix | only add `@angular/platform-server/init` when package is installed. |
+| [3a1970b76](https://github.com/angular/angular-cli/commit/3a1970b76e4da7424e2661664a1e9e669bd279b4) | fix | only import karma when running karma builder |
+| [8b84c18ed](https://github.com/angular/angular-cli/commit/8b84c18edd01e91c7ebf4327dde8ce60f7f700ca) | fix | provide workaround for V8 object spread performance defect |
+| [7dd122ad5](https://github.com/angular/angular-cli/commit/7dd122ad5f34a488f3784326b579b8a93511af7e) | fix | rebase Sass url() values when using esbuild-based builder |
+| [2105964af](https://github.com/angular/angular-cli/commit/2105964afc0285cc40c16d32c47d1eb60be5e279) | fix | resolve transitive dependencies in Sass when using Yarn PNP |
+| [54e1c01d8](https://github.com/angular/angular-cli/commit/54e1c01d8b608ff240f7559ca176cd50e991952c) | fix | show file replacement in TS missing file error in esbuild builder |
+| [6c3f281d9](https://github.com/angular/angular-cli/commit/6c3f281d927c9ae2d4ec76ff9f920752e2cb73d1) | fix | show warning when using TypeScript target older then ES2022 in esbuild builder |
+| [8f8e02c32](https://github.com/angular/angular-cli/commit/8f8e02c3221c9477ec931bb6983daf6a2c8dc8be) | fix | support Yarn PNP resolution in modern SASS API |
+| [fc82e3bec](https://github.com/angular/angular-cli/commit/fc82e3bec3f188d449e952d9955b845b2efdcd6b) | fix | update browerslist package |
+| [0d62157a3](https://github.com/angular/angular-cli/commit/0d62157a30a246c1e00273c2300b9251574e75ae) | fix | update sourcemaps when rebasing Sass url() functions in esbuild builder |
+| [1518133db](https://github.com/angular/angular-cli/commit/1518133db3b1c710500786f9f1fcfa05a016862e) | fix | use relative sourcemap source paths for Sass in esbuild builder |
+| [fb4ead2ce](https://github.com/angular/angular-cli/commit/fb4ead2ce0de824eef46ce8e27a8f6cc1d08c744) | fix | wait during file watching to improve multi-save rebuilds for esbuild builder |
+| [b059fc735](https://github.com/angular/angular-cli/commit/b059fc73597c12330a96fca5f6ab9b1ca226136c) | fix | warn when components styles sourcemaps are not generated when styles optimization is enabled |
+| [9d0872fb5](https://github.com/angular/angular-cli/commit/9d0872fb5e369f714633387d9ae39c4242ba1ea1) | perf | add initial global styles incremental rebuilds with esbuild builder |
+| [0fe6b3b75](https://github.com/angular/angular-cli/commit/0fe6b3b75b87f6f8050b196615e1c1543b707841) | perf | add vendor chunking to server builder |
+| [8c915d414](https://github.com/angular/angular-cli/commit/8c915d41496c99fb42ae3992d9c91de542260bf2) | perf | avoid extra babel file reads in esbuild builder rebuilds |
+| [919fe2148](https://github.com/angular/angular-cli/commit/919fe2148885c44655ce36085768b1eab2c8c246) | perf | avoid extra TypeScript emits with esbuild rebuilds |
+| [92145c4a7](https://github.com/angular/angular-cli/commit/92145c4a7d2c835b703319676bafd8ea3b4a19f0) | perf | avoid template diagnostics for declaration files in esbuild builder |
+| [52db3c000](https://github.com/angular/angular-cli/commit/52db3c00076dfe118cd39d7724229210c30665e0) | perf | minimize Angular diagnostics incremental analysis in esbuild-based builder |
+| [feb06753d](https://github.com/angular/angular-cli/commit/feb06753d59f782c6ad8fd59a60537863094f498) | perf | use esbuild-based builder to directly downlevel for await...of |
+| [9d83fb91b](https://github.com/angular/angular-cli/commit/9d83fb91b654eed79a5c9c9691d0f1c094f37771) | perf | use Sass worker pool for Sass support in esbuild builder |
+| [45a94228f](https://github.com/angular/angular-cli/commit/45a94228fb23acbd0d1a9329448f07b759c8654b) | perf | use Uint8Arrays for incremental caching with esbuild-based builder |
+| [f393b0928](https://github.com/angular/angular-cli/commit/f393b09282582da47db683344e037fd1434b32a8) | refactor | disable `requireContext` parsing |
+| [12931ba8c](https://github.com/angular/angular-cli/commit/12931ba8c3772b1dd65846cbd6146804b08eab31) | refactor | remove deprecated ES5 support |
+| [7f1017e60](https://github.com/angular/angular-cli/commit/7f1017e60f82389568065478d666ae4be6ebfea2) | refactor | remove old `bundleDependencies` enum logic |
+| [2ba44a433](https://github.com/angular/angular-cli/commit/2ba44a433c827413a53d12de0ef203f8988ddc2a) | refactor | remove support for Stylus |
-
+### @angular-devkit/core
-
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------- |
+| [ea4c0aa2e](https://github.com/angular/angular-cli/commit/ea4c0aa2e84d48be37b75e37c99ad381122297c3) | fix | throw error when project has missing root property |
+| [de467f46d](https://github.com/angular/angular-cli/commit/de467f46de63059f9c701dfe8695513c742f22b5) | fix | update logger `forEach` `promiseCtor` type |
-# 14.2.4 (2022-09-28)
+### @angular-devkit/schematics
-### @angular/cli
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------ |
+| [9b07b469b](https://github.com/angular/angular-cli/commit/9b07b469b622e083a9915ed3c24e1d53d8abf38f) | refactor | remove `UpdateBuffer` and rename `UpdateBuffer2` to `UpdateBuffer` |
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------------- |
-| [05b18f4e4](https://github.com/angular/angular-cli/commit/05b18f4e4b39d73c8a3532507c4b7bba8722bf80) | fix | add builders and schematic names as page titles in collected analytics |
+### @ngtools/webpack
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------------- |
+| [43bd0abc1](https://github.com/angular/angular-cli/commit/43bd0abc147cf3177e707624bf6163b3dc9e06f8) | feat | drop support for TypeScript 4.6 and 4.7 |
+| [1c1f985b9](https://github.com/angular/angular-cli/commit/1c1f985b9c9913f28915f101ee1717c0da540362) | fix | support inline style sourcemaps when using css-loader for component styles |
## Special Thanks
-Alan Agius, Jason Bedard and Paul Gschwendtner
+Alan Agius, Brent Schmidt, Charles Lyding, Cédric Exbrayat, Dariusz Ostolski, Doug Parker, Günhan Gülsoy, Jason Bedard, Lukas Spirig, Ruslan Lekhman, angular-robot[bot] and minijus
-
+
-# 15.0.0-next.2 (2022-09-21)
+# 14.2.10 (2022-11-17)
-## Breaking Changes
+### @angular/cli
-### @angular-devkit/build-angular
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------------- |
+| [9ce386caf](https://github.com/angular/angular-cli/commit/9ce386caf6037f21f422a785fec977634406d208) | fix | exclude `@angular/localize@<10.0.0` from ng add pa… ([#24152](https://github.com/angular/angular-cli/pull/24152)) |
+| [6446091a3](https://github.com/angular/angular-cli/commit/6446091a310f327ceeb68ae85f3673f6e3e83286) | fix | exclude `@angular/material@7.x` from ng add package discovery |
+| [7541e04f3](https://github.com/angular/angular-cli/commit/7541e04f36ff32118e93588be38dcbb5cc2c92a9) | fix | respect registry in RC when running update through yarn |
-- Internally the Angular CLI now always sets the TypeScript `target` to `ES2022` and `useDefineForClassFields` to `false` unless the target is set to `ES2022` or later in the TypeScript configuration. To control ECMA version and features use the Browerslist configuration.
-- Producing ES5 output is no longer possible. This was needed for Internet Explorer which is no longer supported. All browsers that Angular supports work with ES2015+
-- Deprecated support for Stylus has been removed. The Stylus package has never reached a stable version and its usage in the Angular CLI is minimal. It's recommended to migrate to another CSS preprocessor that the Angular CLI supports.
+### @angular-devkit/build-angular
-### @angular-devkit/core
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------- |
+| [21cea0b42](https://github.com/angular/angular-cli/commit/21cea0b42f08bf56990bdade82e2daa7c33011ed) | fix | update `loader-utils` to `3.2.1` |
-- Workspace projects with missing `root` is now an error.
+## Special Thanks
-### @schematics/angular
+Alan Agius and Charles Lyding
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------- |
-| [1c21e470c](https://github.com/angular/angular-cli/commit/1c21e470c76d69d08e5096b46b952dbce330f7ef) | feat | enable error on unknown properties and elements in tests |
+
-### @angular-devkit/build-angular
+
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------- |
-| [1c527a9da](https://github.com/angular/angular-cli/commit/1c527a9da5b55a8421ebca787fd322e879f6d29d) | feat | add esbuild-based builder initial support for fileReplacements |
-| [15d3fc6dc](https://github.com/angular/angular-cli/commit/15d3fc6dc3f74462818b3745f6fb4995212a4d22) | feat | export `@angular/platform-server` symbols in server bundle |
-| [1e5d4a750](https://github.com/angular/angular-cli/commit/1e5d4a75084dfd2aeebb6a0c0b3039417e14bc84) | feat | use Browserslist to determine ECMA output |
-| [12931ba8c](https://github.com/angular/angular-cli/commit/12931ba8c3772b1dd65846cbd6146804b08eab31) | refactor | remove deprecated ES5 support |
-| [2ba44a433](https://github.com/angular/angular-cli/commit/2ba44a433c827413a53d12de0ef203f8988ddc2a) | refactor | remove support for Stylus |
+# 13.3.10 (2022-11-17)
-### @angular-devkit/core
+### @angular-devkit/build-angular
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------- |
-| [ea4c0aa2e](https://github.com/angular/angular-cli/commit/ea4c0aa2e84d48be37b75e37c99ad381122297c3) | fix | throw error when project has missing root property |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------- |
+| [f298ebbd5](https://github.com/angular/angular-cli/commit/f298ebbd5f86077985d994662314379df92b6771) | fix | update `loader-utils` to `3.2.1` |
## Special Thanks
-Alan Agius, Charles Lyding, Cédric Exbrayat, Doug Parker, Jason Bedard and Paul Gschwendtner
+Alan Agius
-
+
-# 15.0.0-next.1 (2022-09-15)
+# 14.2.9 (2022-11-09)
-## Breaking Changes
+### @angular-devkit/architect
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------- |
+| [e3e787767](https://github.com/angular/angular-cli/commit/e3e78776782da9d933f7b0e4c6bf391a62585bee) | fix | default to failure if no builder result is provided |
### @angular-devkit/build-angular
-- server builder `bundleDependencies` option now only accept a boolean value.
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------- |
+| [12b2dc5a2](https://github.com/angular/angular-cli/commit/12b2dc5a2374f992df151af32cc80e2c2d7c4dee) | fix | isolate zone.js usage when rendering server bundles |
+
+## Special Thanks
+
+Alan Agius and Charles Lyding
+
+
+
+
+
+# 14.2.8 (2022-11-02)
### @schematics/angular
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------- |
-| [9beb878e2](https://github.com/angular/angular-cli/commit/9beb878e2eecd32e499c8af557f22f46548248fc) | feat | remove Browserslist configuration files from projects |
+| [4b0ee8ad1](https://github.com/angular/angular-cli/commit/4b0ee8ad15efcb513ab5d9e38bf9b1e08857e798) | fix | guard schematics should include all guards (CanMatch) |
-### @angular-devkit/build-angular
+## Special Thanks
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------- |
-| [4f8a3d258](https://github.com/angular/angular-cli/commit/4f8a3d258230d6b6645600f9d17e8582a36c8682) | fix | correctly display error messages that contain "at" text. |
-| [2021e66a1](https://github.com/angular/angular-cli/commit/2021e66a12fb873140d54cff82968a10e3ffa010) | fix | watch symbolic links |
-| [7f1017e60](https://github.com/angular/angular-cli/commit/7f1017e60f82389568065478d666ae4be6ebfea2) | refactor | remove old `bundleDependencies` enum logic |
+Andrew Scott
-### @ngtools/webpack
+
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- |
-| [4fa8392a1](https://github.com/angular/angular-cli/commit/4fa8392a138122bc2c8ed5e433cfbf9786da8baa) | perf | avoid bootstrap conversion AST traversal where possible |
+
+
+# 14.2.7 (2022-10-26)
+
+### @angular/cli
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- |
+| [91b5bcbb3](https://github.com/angular/angular-cli/commit/91b5bcbb31715a3c2e183e264ebd5ec1188d5437) | fix | disable version check during auto completion |
+| [02a3d7b71](https://github.com/angular/angular-cli/commit/02a3d7b715f4069650389ba26a3601747e67d9c2) | fix | skip node.js compatibility checks when running completion |
+
+### @angular-devkit/build-angular
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------- |
+| [bebed9df8](https://github.com/angular/angular-cli/commit/bebed9df834d01f72753aa0e60dc104f1781bd67) | fix | issue dev-server support warning when using esbuild builder |
## Special Thanks
-Alan Agius, Charles Lyding, Doug Parker, Jason Bedard, Joey Perrott and angular-robot[bot]
+Alan Agius and Charles Lyding
-
+
-# 14.2.3 (2022-09-15)
+# 14.2.6 (2022-10-12)
-### @angular-devkit/build-angular
+### @angular/cli
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------- |
-| [e7e0cb78f](https://github.com/angular/angular-cli/commit/e7e0cb78f4c6d684fdf25e23a11599b82807cd25) | fix | correctly display error messages that contain "at" text. |
-| [4756d7e06](https://github.com/angular/angular-cli/commit/4756d7e0675aa9a8bed11b830b66288141fa6e16) | fix | watch symbolic links |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------ |
+| [1c9cf594f](https://github.com/angular/angular-cli/commit/1c9cf594f7a855ea4b462fad53acd3bf3a2e7622) | fix | handle missing `which` binary in path |
+| [28b2cd18e](https://github.com/angular/angular-cli/commit/28b2cd18e3c490cf2db64d4a6744bbd26c0aeabb) | fix | skip downloading temp CLI when running `ng update` without package names |
-### @ngtools/webpack
+### @angular-devkit/core
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- |
-| [1e3ecbdb1](https://github.com/angular/angular-cli/commit/1e3ecbdb138861eff550e05d9662a10d106c0990) | perf | avoid bootstrap conversion AST traversal where possible |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------- |
+| [ad6928184](https://github.com/angular/angular-cli/commit/ad692818413a97afe54aee6a39f0447ee9239343) | fix | project extension warning message should identify concerned project |
## Special Thanks
-Alan Agius, Charles Lyding, Jason Bedard and Joey Perrott
+AgentEnder and Alan Agius
-
+
-# 15.0.0-next.0 (2022-09-08)
+# 14.2.5 (2022-10-05)
-## Breaking Changes
+### @angular-devkit/schematics
-### @angular/cli
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- |
+| [17eb20c77](https://github.com/angular/angular-cli/commit/17eb20c77098841d45f0444f5f047c4d44fc614f) | fix | throw more relevant error when Rule returns invalid null value |
-- The 'path' option in schematics schema no longer has a special meaning. Use 'workingDirectory' smart default provider should be used instead.
+## Special Thanks
-### @schematics/angular
+Alan Agius and Charles Lyding
-- Removed unused`appDir` option from Universal and App-Shell schematic. This option can safely be removed if present since it no longer has effect.
+
-### @schematics/angular
+
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | -------- | ------------------------------- |
-| [57d93fb7d](https://github.com/angular/angular-cli/commit/57d93fb7d979e68c2a4e6f6046ff633f69098afe) | fix | mark project as required option |
-| [69b221498](https://github.com/angular/angular-cli/commit/69b2214987c8fad6efd091782cf28b20be62d244) | refactor | remove deprecated appDir option |
+# 14.2.4 (2022-09-28)
### @angular/cli
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | -------- | ------------------------------ |
-| [774d349b7](https://github.com/angular/angular-cli/commit/774d349b73a436a99f2ea932b7509dab7c1d5e45) | refactor | remove deprecated path handler |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------------- |
+| [05b18f4e4](https://github.com/angular/angular-cli/commit/05b18f4e4b39d73c8a3532507c4b7bba8722bf80) | fix | add builders and schematic names as page titles in collected analytics |
+
+## Special Thanks
+
+Alan Agius, Jason Bedard and Paul Gschwendtner
+
+
+
+
+
+# 14.2.3 (2022-09-15)
### @angular-devkit/build-angular
-| Commit | Type | Description |
-| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------- |
-| [feb06753d](https://github.com/angular/angular-cli/commit/feb06753d59f782c6ad8fd59a60537863094f498) | perf | use esbuild-based builder to directly downlevel for await...of |
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------- |
+| [e7e0cb78f](https://github.com/angular/angular-cli/commit/e7e0cb78f4c6d684fdf25e23a11599b82807cd25) | fix | correctly display error messages that contain "at" text. |
+| [4756d7e06](https://github.com/angular/angular-cli/commit/4756d7e0675aa9a8bed11b830b66288141fa6e16) | fix | watch symbolic links |
+
+### @ngtools/webpack
+
+| Commit | Type | Description |
+| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------- |
+| [1e3ecbdb1](https://github.com/angular/angular-cli/commit/1e3ecbdb138861eff550e05d9662a10d106c0990) | perf | avoid bootstrap conversion AST traversal where possible |
## Special Thanks
-Alan Agius, Charles Lyding, Doug Parker, Ruslan Lekhman and angular-robot[bot]
+Alan Agius, Charles Lyding, Jason Bedard and Joey Perrott
diff --git a/SECURITY.md b/SECURITY.md
index 3d599f9d423e..cb2de27fcad5 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,3 +1,3 @@
-Angular is part of Google [Open Source Software Vulnerability Reward Program](https://bughunters.google.com/about/rules/6521337925468160/google-open-source-software-vulnerability-reward-program-rules), for vulnerabilities in Angular please submit your report [here](https://bughunters.google.com/report).
+Angular is part of Google [Open Source Software Vulnerability Reward Program](https://bughunters.google.com/about/rules/6521337925468160/google-open-source-software-vulnerability-reward-program-rules). For vulnerabilities in Angular, please submit your report [here](https://bughunters.google.com/report).
-For more information on Angular's security policy visit: https://angular.io/guide/security
+For more information, check out [Angular's security policy](https://angular.io/guide/security).
diff --git a/WORKSPACE b/WORKSPACE
index 86523398dfeb..8cdf26b35606 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -7,10 +7,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
- sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
+ sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7",
urls = [
- "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
- "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
+ "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz",
+ "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz",
],
)
@@ -22,8 +22,8 @@ http_archive(
http_archive(
name = "build_bazel_rules_nodejs",
- sha256 = "c29944ba9b0b430aadcaf3bf2570fece6fc5ebfb76df145c6cdad40d65c20811",
- urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.0/rules_nodejs-5.7.0.tar.gz"],
+ sha256 = "dcc55f810142b6cf46a44d0180a5a7fb923c04a5061e2e8d8eb05ccccc60864b",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.0/rules_nodejs-5.8.0.tar.gz"],
)
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
@@ -32,8 +32,8 @@ build_bazel_rules_nodejs_dependencies()
http_archive(
name = "rules_pkg",
- sha256 = "451e08a4d78988c06fa3f9306ec813b836b1d076d0f055595444ba4ff22b867f",
- urls = ["https://github.com/bazelbuild/rules_pkg/releases/download/0.7.1/rules_pkg-0.7.1.tar.gz"],
+ sha256 = "8c20f74bca25d2d442b327ae26768c02cf3c99e93fad0381f32be9aab1967675",
+ urls = ["https://github.com/bazelbuild/rules_pkg/releases/download/0.8.1/rules_pkg-0.8.1.tar.gz"],
)
load("@bazel_tools//tools/sh:sh_configure.bzl", "sh_configure")
@@ -78,9 +78,9 @@ yarn_install(
http_archive(
name = "aspect_bazel_lib",
- sha256 = "0154b46f350c7941919eaa30a4f2284a0128ac13c706901a5c768a829af49e11",
- strip_prefix = "bazel-lib-1.13.0",
- url = "https://github.com/aspect-build/bazel-lib/archive/v1.13.0.tar.gz",
+ sha256 = "ef83252dea2ed8254c27e65124b756fc9476be2b73a7799b7a2a0935937fc573",
+ strip_prefix = "bazel-lib-1.24.2",
+ url = "https://github.com/aspect-build/bazel-lib/archive/v1.24.2.tar.gz",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "register_jq_toolchains")
@@ -98,3 +98,19 @@ nodejs_register_toolchains(
name = "node16",
node_version = "16.13.1",
)
+
+nodejs_register_toolchains(
+ name = "node18",
+ node_version = "18.10.0",
+)
+
+register_toolchains(
+ "@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
+ "@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",
+ "@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_arm64_toolchain",
+ "@npm//@angular/build-tooling/bazel/git-toolchain:git_windows_toolchain",
+)
+
+load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories")
+
+browser_repositories()
diff --git a/docs/DEVELOPER.md b/docs/DEVELOPER.md
index cc06b685550c..2d0c9a6b1e61 100644
--- a/docs/DEVELOPER.md
+++ b/docs/DEVELOPER.md
@@ -78,22 +78,22 @@ There are two different test suites which can be run locally:
- Run a subset of the tests, use the full Bazel target example: `yarn bazel test //packages/schematics/angular:angular_test`
- For a complete list of test targets use the following Bazel query: `yarn bazel query "tests(//packages/...)"`
+When debugging a specific test, change `describe()` or `it()` to `fdescribe()`
+and `fit()` to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.
+
You can find more info about debugging [tests with Bazel in the docs.](https://github.com/angular/angular-cli/blob/main/docs/process/bazel.md#debugging-jasmine_node_test)
### End to end tests
-- Compile the packages being tested: `yarn build`
-- Run all tests: `node tests/legacy-cli/run_e2e.js`
-- Run a subset of the tests: `node tests/legacy-cli/run_e2e.js tests/legacy-cli/e2e/tests/i18n/ivy-localize-*`
-- Run on a custom set of npm packages (tar files): `node tests/legacy-cli/run_e2e.js --package _angular_cli.tgz _angular_create.tgz dist/*.tgz ...`
+- For a complete list of test targets use the following Bazel query: `yarn bazel query "tests(//tests/...)"`
+- Run a subset of the tests: `yarn bazel test //tests/legacy-cli:e2e_node16 --test_filter="tests/i18n/ivy-localize-*"`
+- Use `bazel run` to debug failing tests debugging: `yarn bazel run //tests/legacy-cli:e2e_node16 --test_arg="--glob=tests/basic/aot.ts"`
+- Provide additional `e2e_runner` options using `--test_arg`: `--test_arg="--yarn"`
When running the debug commands, Node will stop and wait for a debugger to attach.
You can attach your IDE to the debugger to stop on breakpoints and step through the code. Also, see [IDE Specific Usage](#ide-specific-usage) for a
simpler debug story.
-When debugging a specific test, change `describe()` or `it()` to `fdescribe()`
-and `fit()` to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.
-
## IDE Specific Usage
Some additional tips for developing in specific IDEs.
diff --git a/docs/design/analytics.md b/docs/design/analytics.md
index 7d439853ecf9..3b7928320f9b 100644
--- a/docs/design/analytics.md
+++ b/docs/design/analytics.md
@@ -14,13 +14,13 @@ simplicity it should remain unique across all CLI commands. The dimension is the
`x-user-analytics` field in the `schema.json` files.
### Adding dimension or metic.
-1. Create the dimension or metric in (https://analytics.google.com/)[Google Analytics] first. These are not tracked if they aren't
+1. Create the dimension or metric in [Google Analytics](https://analytics.google.com/) first. These are not tracked if they aren't
defined in Google Analytics.
1. Use the ID of the dimension as the `x-user-analytics` value in the `schema.json` file.
-1. New dimension and metrics PRs need to be approved by the tooling lead and require a new (http://go/launch)[Launch].
+1. New dimension and metrics PRs need to be approved by the tooling lead and require a new [Launch](http://go/launch).
### Deleting a dimension or metic.
-1. Archive the dimension and metric in (https://analytics.google.com/)[Google Analytics].
+1. Archive the dimension and metric in [Google Analytics](https://analytics.google.com/).
**DO NOT ADD `x-user-analytics` FOR VALUES THAT ARE USER IDENTIFIABLE (PII), FOR EXAMPLE A
@@ -38,6 +38,7 @@ PROJECT NAME TO BUILD OR A MODULE NAME.**
| Name | Parameter | Type |
|:---:|:---|:---|
+| UserId | `up.ng_user_id` | `string` |
| OsArchitecture | `up.ng_os_architecture` | `string` |
| NodeVersion | `up.ng_node_version` | `string` |
| NodeMajorVersion | `upn.ng_node_major_version` | `number` |
@@ -79,6 +80,9 @@ PROJECT NAME TO BUILD OR A MODULE NAME.**
| CssSizeInBytes | `epn.ng_css_size_bytes` | `number` |
| JsSizeInBytes | `epn.ng_js_size_bytes` | `number` |
| NgComponentCount | `epn.ng_component_count` | `number` |
+| AllProjectsCount | `epn.all_projects_count` | `number` |
+| LibraryProjectsCount | `epn.libs_projects_count` | `number` |
+| ApplicationProjectsCount | `epn.apps_projects_count` | `number` |
## Debugging
diff --git a/docs/process/release.md b/docs/process/release.md
index c8825eb5fbac..bbef11e8c151 100644
--- a/docs/process/release.md
+++ b/docs/process/release.md
@@ -74,6 +74,7 @@ Releasing is performed using Angular's unified release tooling. Each week, two r
After FW releases `-rc.0` for an upcoming minor/major version, update the corresponding version in:
- [`latest-versions.ts`](/packages/schematics/angular/utility/latest-versions.ts#L=18)
+- [`latest-versions/package.json`](/packages/schematics/angular/utility/latest-versions/package.json)
- [`@angular-devkit/build-angular`](/packages/angular_devkit/build_angular/package.json)
- [`@ngtools/webpack`](/packages/ngtools/webpack/package.json)
@@ -86,18 +87,7 @@ which lands after FW releases (or else CI will fail) but _before_ the CLI releas
built before the PR is sent for review, so any changes after that point won't be included in the
release.
-**For a major release:**
-
-**As part of the release PR**, make sure to:
-
-- modify
- [`latest-versions.ts`](https://github.com/angular/angular-cli/blob/main/packages/schematics/angular/utility/latest-versions.ts#L18)
- so the Angular semver is updated from `~13.0.0-rc` to just `~13.0.0`.
- - This is the version generated in `ng new` schematics and needs to be updated to avoid having
- users generate projects with `-rc` in the dependencies.
-- update the
- [`ng-packagr`](https://github.com/angular/angular-cli/blob/main/packages/schematics/angular/utility/latest-versions/package.json#L15)
- dependency to a stable version (ex. from `^13.0.0-next.0` to `^13.0.0`).
+**Following a major release:**
When a release is transitioning from a prerelease to a stable release, the semver ranges for Angular
dependencies within the packages' `package.json` files will need to be updated to remove the
diff --git a/goldens/public-api/angular_devkit/build_angular/index.md b/goldens/public-api/angular_devkit/build_angular/index.md
index 1fdb8b73e0e3..032ae5741772 100644
--- a/goldens/public-api/angular_devkit/build_angular/index.md
+++ b/goldens/public-api/angular_devkit/build_angular/index.md
@@ -7,7 +7,7 @@
import { BuilderContext } from '@angular-devkit/architect';
import { BuilderOutput } from '@angular-devkit/architect';
import { BuildResult } from '@angular-devkit/build-webpack';
-import { ConfigOptions } from 'karma';
+import type { ConfigOptions } from 'karma';
import { Configuration } from 'webpack';
import { DevServerBuildOutput } from '@angular-devkit/build-webpack';
import { Observable } from 'rxjs';
@@ -176,6 +176,7 @@ export interface KarmaBuilderOptions {
browsers?: string;
codeCoverage?: boolean;
codeCoverageExclude?: string[];
+ exclude?: string[];
fileReplacements?: FileReplacement_2[];
include?: string[];
inlineStyleLanguage?: InlineStyleLanguage_2;
@@ -246,6 +247,7 @@ export interface ProtractorBuilderOptions {
// @public (undocumented)
export interface ServerBuilderOptions {
+ assets?: AssetPattern_3[];
deleteOutputPath?: boolean;
// @deprecated
deployUrl?: string;
@@ -269,6 +271,7 @@ export interface ServerBuilderOptions {
statsJson?: boolean;
stylePreprocessorOptions?: StylePreprocessorOptions_3;
tsConfig: string;
+ vendorChunk?: boolean;
verbose?: boolean;
watch?: boolean;
}
diff --git a/goldens/public-api/angular_devkit/core/index.md b/goldens/public-api/angular_devkit/core/index.md
index 23cda881f1fb..626dc8eaf772 100644
--- a/goldens/public-api/angular_devkit/core/index.md
+++ b/goldens/public-api/angular_devkit/core/index.md
@@ -459,7 +459,7 @@ class Logger extends Observable implements LoggerApi {
// (undocumented)
fatal(message: string, metadata?: JsonObject): void;
// (undocumented)
- forEach(next: (value: LogEntry) => void, promiseCtor?: typeof Promise): Promise;
+ forEach(next: (value: LogEntry) => void, promiseCtor?: PromiseConstructorLike): Promise;
// (undocumented)
info(message: string, metadata?: JsonObject): void;
// (undocumented)
diff --git a/goldens/public-api/angular_devkit/core/node/index.md b/goldens/public-api/angular_devkit/core/node/index.md
index 59cda60a3ad8..23d7c5f98c79 100644
--- a/goldens/public-api/angular_devkit/core/node/index.md
+++ b/goldens/public-api/angular_devkit/core/node/index.md
@@ -9,7 +9,7 @@
import { Observable } from 'rxjs';
import { Operator } from 'rxjs';
import { PartialObserver } from 'rxjs';
-import { Stats as Stats_2 } from 'fs';
+import { Stats as Stats_2 } from 'node:fs';
import { Subject } from 'rxjs';
import { Subscription } from 'rxjs';
diff --git a/goldens/public-api/angular_devkit/schematics/testing/index.md b/goldens/public-api/angular_devkit/schematics/testing/index.md
index 854dbd7728b0..52b1cdb763df 100644
--- a/goldens/public-api/angular_devkit/schematics/testing/index.md
+++ b/goldens/public-api/angular_devkit/schematics/testing/index.md
@@ -25,8 +25,12 @@ export class SchematicTestRunner {
// (undocumented)
registerCollection(collectionName: string, collectionPath: string): void;
// (undocumented)
+ runExternalSchematic(collectionName: string, schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Promise;
+ // @deprecated (undocumented)
runExternalSchematicAsync(collectionName: string, schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Observable;
// (undocumented)
+ runSchematic(schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Promise;
+ // @deprecated (undocumented)
runSchematicAsync(schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Observable;
// (undocumented)
get tasks(): TaskConfiguration[];
diff --git a/package.json b/package.json
index 1556baca4d6e..c2b863a03375 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@angular/devkit-repo",
- "version": "15.0.0-next.4",
+ "version": "15.2.4",
"private": true,
"description": "Software Development Kit for Angular",
"bin": {
@@ -24,7 +24,7 @@
"build:bazel": "node ./bin/devkit-admin build-bazel",
"build-tsc": "tsc -p tsconfig.json",
"lint": "eslint --cache --max-warnings=0 \"**/*.ts\"",
- "ng-dev": "cross-env TS_NODE_PROJECT=$PWD/.ng-dev/tsconfig.json TS_NODE_TRANSPILE_ONLY=1 node --no-warnings --loader ts-node/esm node_modules/@angular/ng-dev/bundles/cli.mjs",
+ "ng-dev": "ts-node --esm --project .ng-dev/tsconfig.json --transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs",
"templates": "node ./bin/devkit-admin templates",
"validate": "node ./bin/devkit-admin validate",
"postinstall": "yarn webdriver-update && yarn husky install",
@@ -60,42 +60,43 @@
]
},
"resolutions": {
- "**/ajv-formats/ajv": "8.11.0",
+ "**/ajv-formats/ajv": "8.12.0",
"@types/parse5-html-rewriting-stream/@types/parse5-sax-parser": "^5.0.2"
},
"devDependencies": {
"@ampproject/remapping": "2.2.0",
- "@angular/animations": "15.0.0-next.5",
- "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#45ba3918d1656d4e746300bdc4d5ab8b4b825c71",
- "@angular/cdk": "14.2.4",
- "@angular/common": "15.0.0-next.5",
- "@angular/compiler": "15.0.0-next.5",
- "@angular/compiler-cli": "15.0.0-next.5",
- "@angular/core": "15.0.0-next.5",
- "@angular/forms": "15.0.0-next.5",
- "@angular/localize": "15.0.0-next.5",
- "@angular/material": "14.2.4",
- "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#7297d58b25df3e1ed4f01e00e4eaae00444411d8",
- "@angular/platform-browser": "15.0.0-next.5",
- "@angular/platform-browser-dynamic": "15.0.0-next.5",
- "@angular/platform-server": "15.0.0-next.5",
- "@angular/router": "15.0.0-next.5",
- "@angular/service-worker": "15.0.0-next.5",
- "@babel/core": "7.19.3",
- "@babel/generator": "7.19.5",
+ "@angular/animations": "15.2.0-rc.0",
+ "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#26fc36d66eb747768721cdb9eff3385187456a32",
+ "@angular/cdk": "15.1.4",
+ "@angular/common": "15.2.0-rc.0",
+ "@angular/compiler": "15.2.0-rc.0",
+ "@angular/compiler-cli": "15.2.0-rc.0",
+ "@angular/core": "15.2.0-rc.0",
+ "@angular/forms": "15.2.0-rc.0",
+ "@angular/localize": "15.2.0-rc.0",
+ "@angular/material": "15.1.4",
+ "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#fa4d4694084d46886ca28fd09768a7df69b5b84d",
+ "@angular/platform-browser": "15.2.0-rc.0",
+ "@angular/platform-browser-dynamic": "15.2.0-rc.0",
+ "@angular/platform-server": "15.2.0-rc.0",
+ "@angular/router": "15.2.0-rc.0",
+ "@angular/service-worker": "15.2.0-rc.0",
+ "@babel/core": "7.20.12",
+ "@babel/generator": "7.20.14",
"@babel/helper-annotate-as-pure": "7.18.6",
- "@babel/plugin-proposal-async-generator-functions": "7.19.1",
- "@babel/plugin-transform-async-to-generator": "7.18.6",
- "@babel/plugin-transform-runtime": "7.19.1",
- "@babel/preset-env": "7.19.4",
- "@babel/runtime": "7.19.4",
- "@babel/template": "7.18.10",
+ "@babel/helper-split-export-declaration": "7.18.6",
+ "@babel/plugin-proposal-async-generator-functions": "7.20.7",
+ "@babel/plugin-transform-async-to-generator": "7.20.7",
+ "@babel/plugin-transform-runtime": "7.19.6",
+ "@babel/preset-env": "7.20.2",
+ "@babel/runtime": "7.20.13",
+ "@babel/template": "7.20.7",
"@bazel/bazelisk": "1.12.1",
- "@bazel/buildifier": "5.1.0",
- "@bazel/concatjs": "5.7.0",
- "@bazel/jasmine": "5.7.0",
+ "@bazel/buildifier": "6.0.1",
+ "@bazel/concatjs": "5.7.3",
+ "@bazel/jasmine": "5.7.3",
"@discoveryjs/json-ext": "0.5.7",
- "@types/babel__core": "7.1.19",
+ "@types/babel__core": "7.20.0",
"@types/babel__template": "7.4.1",
"@types/browserslist": "^4.15.0",
"@types/cacache": "^15.0.0",
@@ -106,55 +107,56 @@
"@types/inquirer": "^8.0.0",
"@types/jasmine": "~4.3.0",
"@types/karma": "^6.3.0",
+ "@types/less": "^3.0.3",
"@types/loader-utils": "^2.0.0",
"@types/minimatch": "5.1.2",
"@types/node": "^14.15.0",
"@types/node-fetch": "^2.1.6",
"@types/npm-package-arg": "^6.1.0",
"@types/pacote": "^11.1.3",
- "@types/parse5-html-rewriting-stream": "^5.1.2",
"@types/pidusage": "^2.0.1",
"@types/progress": "^2.0.3",
"@types/resolve": "^1.17.1",
"@types/semver": "^7.3.12",
+ "@types/shelljs": "^0.8.11",
"@types/tar": "^6.1.2",
"@types/text-table": "^0.2.1",
- "@types/yargs": "^17.0.8",
+ "@types/yargs": "^17.0.20",
"@types/yargs-parser": "^21.0.0",
"@types/yarnpkg__lockfile": "^1.1.5",
- "@typescript-eslint/eslint-plugin": "5.40.0",
- "@typescript-eslint/parser": "5.40.0",
+ "@typescript-eslint/eslint-plugin": "5.52.0",
+ "@typescript-eslint/parser": "5.52.0",
"@yarnpkg/lockfile": "1.1.0",
- "ajv": "8.11.0",
+ "ajv": "8.12.0",
"ajv-formats": "2.1.1",
"ansi-colors": "4.1.3",
- "autoprefixer": "10.4.12",
- "babel-loader": "8.2.5",
+ "autoprefixer": "10.4.13",
+ "babel-loader": "9.1.2",
"babel-plugin-istanbul": "6.1.1",
"bootstrap": "^4.0.0",
- "browserslist": "^4.9.1",
- "cacache": "16.1.3",
+ "browserslist": "4.21.5",
+ "buffer": "6.0.3",
+ "cacache": "17.0.4",
"chokidar": "3.5.3",
"copy-webpack-plugin": "11.0.0",
"critters": "0.0.16",
- "cross-env": "^7.0.3",
- "css-loader": "6.7.1",
+ "css-loader": "6.7.3",
"debug": "^4.1.1",
- "esbuild": "0.15.10",
- "esbuild-wasm": "0.15.10",
- "eslint": "8.25.0",
- "eslint-config-prettier": "8.5.0",
+ "esbuild": "0.17.8",
+ "esbuild-wasm": "0.17.8",
+ "eslint": "8.34.0",
+ "eslint-config-prettier": "8.6.0",
"eslint-plugin-header": "3.1.1",
- "eslint-plugin-import": "2.26.0",
+ "eslint-plugin-import": "2.27.5",
"express": "4.18.2",
- "glob": "8.0.3",
+ "glob": "8.1.0",
"http-proxy": "^1.18.1",
"https-proxy-agent": "5.0.1",
- "husky": "8.0.1",
+ "husky": "8.0.3",
"ini": "3.0.1",
"inquirer": "8.2.4",
"jasmine": "^4.0.0",
- "jasmine-core": "~4.4.0",
+ "jasmine-core": "~4.5.0",
"jasmine-spec-reporter": "~7.0.0",
"jquery": "^3.3.1",
"jsonc-parser": "3.2.0",
@@ -168,34 +170,32 @@
"less-loader": "11.1.0",
"license-checker": "^25.0.0",
"license-webpack-plugin": "4.0.2",
- "loader-utils": "3.2.0",
- "magic-string": "0.26.7",
- "mini-css-extract-plugin": "2.6.1",
- "minimatch": "5.1.0",
- "ng-packagr": "15.0.0-next.4",
+ "loader-utils": "3.2.1",
+ "magic-string": "0.29.0",
+ "mini-css-extract-plugin": "2.7.2",
+ "minimatch": "~6.2.0",
+ "ng-packagr": "15.1.2",
"node-fetch": "^2.2.0",
"npm": "^8.11.0",
- "npm-package-arg": "9.1.2",
- "open": "8.4.0",
+ "npm-package-arg": "10.1.0",
+ "open": "8.4.1",
"ora": "5.4.1",
- "pacote": "14.0.0",
- "parse5-html-rewriting-stream": "6.0.1",
+ "pacote": "15.1.0",
+ "parse5-html-rewriting-stream": "7.0.0",
"pidtree": "^0.6.0",
"pidusage": "^3.0.0",
"piscina": "3.2.0",
"popper.js": "^1.14.1",
- "postcss": "8.4.17",
- "postcss-import": "15.0.0",
- "postcss-loader": "7.0.1",
+ "postcss": "8.4.21",
+ "postcss-loader": "7.0.2",
"prettier": "^2.0.0",
"protractor": "~7.0.0",
"puppeteer": "18.2.1",
- "quicktype-core": "6.0.69",
- "regenerator-runtime": "0.13.9",
+ "quicktype-core": "22.0.0",
"resolve-url-loader": "5.0.0",
"rxjs": "6.6.7",
- "sass": "1.55.0",
- "sass-loader": "13.1.0",
+ "sass": "1.58.1",
+ "sass-loader": "13.2.0",
"sauce-connect-proxy": "https://saucelabs.com/downloads/sc-4.8.1-linux.tar.gz",
"semver": "7.3.8",
"shelljs": "^0.8.5",
@@ -205,21 +205,21 @@
"spdx-satisfies": "^5.0.0",
"symbol-observable": "4.0.0",
"tar": "^6.1.6",
- "terser": "5.15.1",
+ "terser": "5.16.3",
"text-table": "0.2.0",
"tree-kill": "1.2.2",
- "ts-node": "^10.0.0",
- "tslib": "2.4.0",
- "typescript": "4.8.4",
- "verdaccio": "5.15.4",
+ "ts-node": "^10.9.1",
+ "tslib": "2.5.0",
+ "typescript": "4.9.5",
+ "verdaccio": "5.21.1",
"verdaccio-auth-memory": "^10.0.0",
- "webpack": "5.74.0",
- "webpack-dev-middleware": "5.3.3",
+ "webpack": "5.76.1",
+ "webpack-dev-middleware": "6.0.1",
"webpack-dev-server": "4.11.1",
"webpack-merge": "5.8.0",
"webpack-subresource-integrity": "5.1.0",
- "yargs": "17.6.0",
+ "yargs": "17.6.2",
"yargs-parser": "21.1.1",
- "zone.js": "^0.11.3"
+ "zone.js": "^0.12.0"
}
}
diff --git a/packages/angular/cli/BUILD.bazel b/packages/angular/cli/BUILD.bazel
index e315e76af3dc..ac63f01cbf10 100644
--- a/packages/angular/cli/BUILD.bazel
+++ b/packages/angular/cli/BUILD.bazel
@@ -176,6 +176,7 @@ pkg_npm(
"//packages/angular_devkit/schematics:package.json",
"//packages/schematics/angular:package.json",
],
+ tags = ["release-package"],
deps = [
":README.md",
":angular-cli",
diff --git a/packages/angular/cli/bin/ng.js b/packages/angular/cli/bin/ng.js
index b540e4bcf93f..f5175ea22d29 100755
--- a/packages/angular/cli/bin/ng.js
+++ b/packages/angular/cli/bin/ng.js
@@ -20,6 +20,16 @@ try {
process.title = 'ng';
}
+const rawCommandName = process.argv[2];
+
+if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completion') {
+ // Skip Node.js supported checks when running ng completion.
+ // A warning at this stage could cause a broken source action (`source <(ng completion script)`) when in the shell init script.
+ require('./bootstrap');
+
+ return;
+}
+
// This node version check ensures that extremely old versions of node are not used.
// These may not support ES2015 features such as const/let/async/await/etc.
// These would then crash with a hard to diagnose error message.
diff --git a/packages/angular/cli/lib/config/workspace-schema.json b/packages/angular/cli/lib/config/workspace-schema.json
index 433fbea32501..a50caa1bd33d 100644
--- a/packages/angular/cli/lib/config/workspace-schema.json
+++ b/packages/angular/cli/lib/config/workspace-schema.json
@@ -193,9 +193,7 @@
"$ref": "../../../../schematics/angular/web-worker/schema.json"
}
},
- "additionalProperties": {
- "type": "object"
- }
+ "additionalProperties": true
},
"fileVersion": {
"type": "integer",
diff --git a/packages/angular/cli/lib/init.ts b/packages/angular/cli/lib/init.ts
index 401fb06485a2..feed3a56d901 100644
--- a/packages/angular/cli/lib/init.ts
+++ b/packages/angular/cli/lib/init.ts
@@ -33,17 +33,21 @@ let forceExit = false;
* See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
*/
process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
+ const rawCommandName = process.argv[2];
/**
* Disable CLI version mismatch checks and forces usage of the invoked CLI
* instead of invoking the local installed version.
+ *
+ * When running `ng new` always favor the global version. As in some
+ * cases orphan `node_modules` would cause the non global CLI to be used.
+ * @see: https://github.com/angular/angular-cli/issues/14603
*/
- if (disableVersionCheck) {
+ if (disableVersionCheck || rawCommandName === 'new') {
return (await import('./cli')).default;
}
let cli;
- const rawCommandName = process.argv[2];
try {
// No error implies a projectLocalCli, which will load whatever
@@ -88,7 +92,11 @@ let forceExit = false;
}
// When using the completion command, don't show the warning as otherwise this will break completion.
- if (isGlobalGreater && rawCommandName !== 'completion') {
+ if (
+ isGlobalGreater &&
+ rawCommandName !== '--get-yargs-completions' &&
+ rawCommandName !== 'completion'
+ ) {
// If using the update command and the global version is greater, use the newer update command
// This allows improvements in update to be used in older versions that do not have bootstrapping
if (
diff --git a/packages/angular/cli/package.json b/packages/angular/cli/package.json
index 6d6f2a84eee2..a2894fd910c8 100644
--- a/packages/angular/cli/package.json
+++ b/packages/angular/cli/package.json
@@ -31,15 +31,15 @@
"ini": "3.0.1",
"inquirer": "8.2.4",
"jsonc-parser": "3.2.0",
- "npm-package-arg": "9.1.2",
- "npm-pick-manifest": "7.0.2",
- "open": "8.4.0",
+ "npm-package-arg": "10.1.0",
+ "npm-pick-manifest": "8.0.1",
+ "open": "8.4.1",
"ora": "5.4.1",
- "pacote": "14.0.0",
+ "pacote": "15.1.0",
"resolve": "1.22.1",
"semver": "7.3.8",
"symbol-observable": "4.0.0",
- "yargs": "17.6.0"
+ "yargs": "17.6.2"
},
"devDependencies": {
"rxjs": "6.6.7"
diff --git a/packages/angular/cli/src/analytics/analytics-collector.ts b/packages/angular/cli/src/analytics/analytics-collector.ts
index e80f23814fa6..5d3746899d38 100644
--- a/packages/angular/cli/src/analytics/analytics-collector.ts
+++ b/packages/angular/cli/src/analytics/analytics-collector.ts
@@ -10,6 +10,7 @@ import { randomUUID } from 'crypto';
import * as https from 'https';
import * as os from 'os';
import * as querystring from 'querystring';
+import * as semver from 'semver';
import type { CommandContext } from '../command-builder/command-module';
import { ngDebug } from '../utilities/environment-options';
import { assertIsError } from '../utilities/error';
@@ -44,24 +45,29 @@ export class AnalyticsCollector {
[RequestParameter.SessionId]: randomUUID(),
[RequestParameter.UserAgentArchitecture]: os.arch(),
[RequestParameter.UserAgentPlatform]: os.platform(),
- [RequestParameter.UserAgentPlatformVersion]: os.version(),
-
- // Set undefined to disable debug view.
- [RequestParameter.DebugView]: ngDebug ? 1 : undefined,
+ [RequestParameter.UserAgentPlatformVersion]: os.release(),
+ [RequestParameter.SessionEngaged]: 1,
};
+ if (ngDebug) {
+ requestParameters[RequestParameter.DebugView] = 1;
+ }
+
this.requestParameterStringified = querystring.stringify(requestParameters);
- // Remove the `v` at the beginning.
- const nodeVersion = process.version.substring(1);
+ const parsedVersion = semver.parse(process.version);
const packageManagerVersion = context.packageManager.version;
this.userParameters = {
// While architecture is being collect by GA as UserAgentArchitecture.
// It doesn't look like there is a way to query this. Therefore we collect this as a custom user dimension too.
[UserCustomDimension.OsArchitecture]: os.arch(),
- [UserCustomDimension.NodeVersion]: nodeVersion,
- [UserCustomDimension.NodeMajorVersion]: +nodeVersion.split('.', 1)[0],
+ // While User ID is being collected by GA, this is not visible in reports/for filtering.
+ [UserCustomDimension.UserId]: userId,
+ [UserCustomDimension.NodeVersion]: parsedVersion
+ ? `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}`
+ : 'other',
+ [UserCustomDimension.NodeMajorVersion]: parsedVersion?.major,
[UserCustomDimension.PackageManager]: context.packageManager.name,
[UserCustomDimension.PackageManagerVersion]: packageManagerVersion,
[UserCustomDimension.PackageManagerMajorVersion]: packageManagerVersion
@@ -72,6 +78,12 @@ export class AnalyticsCollector {
};
}
+ reportWorkspaceInfoEvent(
+ parameters: Partial>,
+ ): void {
+ this.event('workspace_info', parameters);
+ }
+
reportRebuildRunEvent(
parameters: Partial<
Record
diff --git a/packages/angular/cli/src/analytics/analytics-parameters.ts b/packages/angular/cli/src/analytics/analytics-parameters.ts
index 04aa550b8cf0..f6902eb33b2e 100644
--- a/packages/angular/cli/src/analytics/analytics-parameters.ts
+++ b/packages/angular/cli/src/analytics/analytics-parameters.ts
@@ -48,6 +48,7 @@ export enum RequestParameter {
* @see https://support.google.com/analytics/answer/10075209?hl=en
*/
export enum UserCustomDimension {
+ UserId = 'up.ng_user_id',
OsArchitecture = 'up.ng_os_architecture',
NodeVersion = 'up.ng_node_version',
NodeMajorVersion = 'upn.ng_node_major_version',
@@ -97,4 +98,7 @@ export enum EventCustomMetric {
CssSizeInBytes = 'epn.ng_css_size_bytes',
JsSizeInBytes = 'epn.ng_js_size_bytes',
NgComponentCount = 'epn.ng_component_count',
+ AllProjectsCount = 'epn.all_projects_count',
+ LibraryProjectsCount = 'epn.libs_projects_count',
+ ApplicationProjectsCount = 'epn.apps_projects_count',
}
diff --git a/packages/angular/cli/src/analytics/analytics.ts b/packages/angular/cli/src/analytics/analytics.ts
index 1f37d21bb50d..2e610afb5dac 100644
--- a/packages/angular/cli/src/analytics/analytics.ts
+++ b/packages/angular/cli/src/analytics/analytics.ts
@@ -128,7 +128,7 @@ async function getAnalyticsUserIdForLevel(
}
const workspace = await getWorkspace(level);
- const analyticsConfig: string | undefined | null | { uid?: string } =
+ const analyticsConfig: string | undefined | null | { uid?: string } | boolean =
workspace?.getCli()?.['analytics'];
if (analyticsConfig === false) {
@@ -184,7 +184,7 @@ export async function getAnalyticsUserId(
}
}
- return globalConfig || randomUUID();
+ return globalConfig;
}
function analyticsConfigValueToHumanFormat(value: unknown): 'enabled' | 'disabled' | 'not set' {
diff --git a/packages/angular/cli/src/command-builder/command-module.ts b/packages/angular/cli/src/command-builder/command-module.ts
index 8cb7469fa4a5..3e3a13e3ce38 100644
--- a/packages/angular/cli/src/command-builder/command-module.ts
+++ b/packages/angular/cli/src/command-builder/command-module.ts
@@ -146,22 +146,9 @@ export abstract class CommandModule implements CommandModuleI
let exitCode: number | void | undefined;
try {
- // Run and time command.
if (analytics) {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const internalMethods = (yargs as any).getInternalMethods();
- // $0 generate component [name] -> generate_component
- // $0 add -> add
- const fullCommand = (internalMethods.getUsageInstance().getUsage()[0][0] as string)
- .split(' ')
- .filter((x) => {
- const code = x.charCodeAt(0);
-
- return code >= 97 && code <= 122;
- })
- .join('_');
-
- analytics.reportCommandRunEvent(fullCommand);
+ this.reportCommandRunAnalytics(analytics);
+ this.reportWorkspaceInfoAnalytics(analytics);
}
exitCode = await this.run(camelCasedOptions as Options & OtherOptions);
@@ -307,6 +294,49 @@ export abstract class CommandModule implements CommandModuleI
return parameters;
}
+
+ private reportCommandRunAnalytics(analytics: AnalyticsCollector): void {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const internalMethods = (yargs as any).getInternalMethods();
+ // $0 generate component [name] -> generate_component
+ // $0 add -> add
+ const fullCommand = (internalMethods.getUsageInstance().getUsage()[0][0] as string)
+ .split(' ')
+ .filter((x) => {
+ const code = x.charCodeAt(0);
+
+ return code >= 97 && code <= 122;
+ })
+ .join('_');
+
+ analytics.reportCommandRunEvent(fullCommand);
+ }
+
+ private reportWorkspaceInfoAnalytics(analytics: AnalyticsCollector): void {
+ const { workspace } = this.context;
+ if (!workspace) {
+ return;
+ }
+
+ let applicationProjectsCount = 0;
+ let librariesProjectsCount = 0;
+ for (const project of workspace.projects.values()) {
+ switch (project.extensions['projectType']) {
+ case 'application':
+ applicationProjectsCount++;
+ break;
+ case 'library':
+ librariesProjectsCount++;
+ break;
+ }
+ }
+
+ analytics.reportWorkspaceInfoEvent({
+ [EventCustomMetric.AllProjectsCount]: librariesProjectsCount + applicationProjectsCount,
+ [EventCustomMetric.ApplicationProjectsCount]: applicationProjectsCount,
+ [EventCustomMetric.LibraryProjectsCount]: librariesProjectsCount,
+ });
+ }
}
/**
diff --git a/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts b/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts
index 0007ffe2f673..1be2e0a9aee1 100644
--- a/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts
+++ b/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts
@@ -12,6 +12,7 @@ import { readFileSync } from 'fs';
import { parse as parseJson } from 'jsonc-parser';
import { createRequire } from 'module';
import { dirname, resolve } from 'path';
+import { TextEncoder } from 'util';
import { Script } from 'vm';
import { assertIsError } from '../../utilities/error';
@@ -43,6 +44,13 @@ function shouldWrapSchematic(schematicFile: string, schematicEncapsulation: bool
return false;
}
+ // @angular/pwa uses dynamic imports which causes `[1] 2468039 segmentation fault` when wrapped.
+ // We should remove this when make `importModuleDynamically` work.
+ // See: https://nodejs.org/docs/latest-v14.x/api/vm.html
+ if (normalizedSchematicFile.includes('@angular/pwa')) {
+ return false;
+ }
+
// Check for first-party Angular schematic packages
// Angular schematics are safe to use in the wrapped VM context
if (/\/node_modules\/@(?:angular|schematics|nguniversal)\//.test(normalizedSchematicFile)) {
@@ -211,6 +219,12 @@ function wrap(
__dirname: schematicDirectory,
__filename: schematicFile,
Buffer,
+ // TextEncoder is used by the compiler to generate i18n message IDs. See:
+ // https://github.com/angular/angular/blob/main/packages/compiler/src/i18n/digest.ts#L17
+ // It is referenced globally, because it may be run either on the browser or the server.
+ // Usually Node exposes it globally, but in order for it to work, our custom context
+ // has to expose it too. Issue context: https://github.com/angular/angular/issues/48940.
+ TextEncoder,
console,
process,
get global() {
diff --git a/packages/angular/cli/src/commands/add/cli.ts b/packages/angular/cli/src/commands/add/cli.ts
index e861a45ab76f..16bcc2d9f30a 100644
--- a/packages/angular/cli/src/commands/add/cli.ts
+++ b/packages/angular/cli/src/commands/add/cli.ts
@@ -11,7 +11,7 @@ import { NodePackageDoesNotSupportSchematics } from '@angular-devkit/schematics/
import { createRequire } from 'module';
import npa from 'npm-package-arg';
import { dirname, join } from 'path';
-import { compare, intersects, prerelease, satisfies, valid } from 'semver';
+import { Range, compare, intersects, prerelease, satisfies, valid } from 'semver';
import { Argv } from 'yargs';
import { PackageManager } from '../../../lib/config/workspace-schema';
import {
@@ -34,6 +34,7 @@ import {
import { askConfirmation } from '../../utilities/prompt';
import { Spinner } from '../../utilities/spinner';
import { isTTY } from '../../utilities/tty';
+import { VERSION } from '../../utilities/version';
interface AddCommandArgs extends SchematicsCommandArgs {
collection: string;
@@ -47,9 +48,11 @@ interface AddCommandArgs extends SchematicsCommandArgs {
* when attempting to find a compatible version for a package.
* The key is a package name and the value is a SemVer range of versions to exclude.
*/
-const packageVersionExclusions: Record = {
- // @angular/localize@9.x versions do not have peer dependencies setup
- '@angular/localize': '9.x',
+const packageVersionExclusions: Record = {
+ // @angular/localize@9.x and earlier versions as well as @angular/localize@10.0 prereleases do not have peer dependencies setup.
+ '@angular/localize': '<10.0.0',
+ // @angular/material@7.x versions have unbounded peer dependency ranges (>=7.0.0).
+ '@angular/material': '7.x',
};
export class AddCommandModule
@@ -141,7 +144,11 @@ export class AddCommandModule
const usingYarn = packageManager.name === PackageManager.Yarn;
spinner.info(`Using package manager: ${colors.grey(packageManager.name)}`);
- if (packageIdentifier.name && packageIdentifier.type === 'tag' && !packageIdentifier.rawSpec) {
+ if (
+ packageIdentifier.name &&
+ packageIdentifier.type === 'range' &&
+ packageIdentifier.rawSpec === '*'
+ ) {
// only package name provided; search for viable version
// plus special cases for packages that did not have peer deps setup
spinner.start('Searching for compatible package version...');
@@ -176,11 +183,15 @@ export class AddCommandModule
);
} else if (!latestManifest || (await this.hasMismatchedPeer(latestManifest))) {
// 'latest' is invalid so search for most recent matching package
+
+ // Allow prelease versions if the CLI itself is a prerelease
+ const allowPrereleases = prerelease(VERSION.full);
+
const versionExclusions = packageVersionExclusions[packageMetadata.name];
const versionManifests = Object.values(packageMetadata.versions).filter(
(value: PackageManifest) => {
// Prerelease versions are not stable and should not be considered by default
- if (prerelease(value.version)) {
+ if (!allowPrereleases && prerelease(value.version)) {
return false;
}
// Deprecated versions should not be used or considered
@@ -188,7 +199,10 @@ export class AddCommandModule
return false;
}
// Excluded package versions should not be considered
- if (versionExclusions && satisfies(value.version, versionExclusions)) {
+ if (
+ versionExclusions &&
+ satisfies(value.version, versionExclusions, { includePrerelease: true })
+ ) {
return false;
}
@@ -196,7 +210,8 @@ export class AddCommandModule
},
);
- versionManifests.sort((a, b) => compare(a.version, b.version, true));
+ // Sort in reverse SemVer order so that the newest compatible version is chosen
+ versionManifests.sort((a, b) => compare(b.version, a.version, true));
let newIdentifier;
for (const versionManifest of versionManifests) {
@@ -305,21 +320,31 @@ export class AddCommandModule
return false;
}
- let validVersion = false;
const installedVersion = await this.findProjectVersion(packageIdentifier.name);
- if (installedVersion) {
- if (packageIdentifier.type === 'range' && packageIdentifier.fetchSpec) {
- validVersion = satisfies(installedVersion, packageIdentifier.fetchSpec);
- } else if (packageIdentifier.type === 'version') {
- const v1 = valid(packageIdentifier.fetchSpec);
- const v2 = valid(installedVersion);
- validVersion = v1 !== null && v1 === v2;
- } else if (!packageIdentifier.rawSpec) {
- validVersion = true;
- }
+ if (!installedVersion) {
+ return false;
+ }
+
+ if (packageIdentifier.rawSpec === '*') {
+ return true;
+ }
+
+ if (
+ packageIdentifier.type === 'range' &&
+ packageIdentifier.fetchSpec &&
+ packageIdentifier.fetchSpec !== '*'
+ ) {
+ return satisfies(installedVersion, packageIdentifier.fetchSpec);
}
- return validVersion;
+ if (packageIdentifier.type === 'version') {
+ const v1 = valid(packageIdentifier.fetchSpec);
+ const v2 = valid(installedVersion);
+
+ return v1 !== null && v1 === v2;
+ }
+
+ return false;
}
private async getCollectionName(): Promise {
diff --git a/packages/angular/cli/src/commands/analytics/cli.ts b/packages/angular/cli/src/commands/analytics/cli.ts
index 828f2d6cb4c3..bdba1ccafd11 100644
--- a/packages/angular/cli/src/commands/analytics/cli.ts
+++ b/packages/angular/cli/src/commands/analytics/cli.ts
@@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
+import { join } from 'node:path';
import { Argv } from 'yargs';
import {
CommandModule,
@@ -25,9 +26,8 @@ import {
export class AnalyticsCommandModule extends CommandModule implements CommandModuleImplementation {
command = 'analytics';
- describe =
- 'Configures the gathering of Angular CLI usage metrics. See https://angular.io/cli/usage-analytics-gathering';
- longDescriptionPath?: string;
+ describe = 'Configures the gathering of Angular CLI usage metrics.';
+ longDescriptionPath = join(__dirname, 'long-description.md');
builder(localYargs: Argv): Argv {
const subcommands = [
diff --git a/packages/angular/cli/src/commands/analytics/long-description.md b/packages/angular/cli/src/commands/analytics/long-description.md
new file mode 100644
index 000000000000..69ee9ad7ee00
--- /dev/null
+++ b/packages/angular/cli/src/commands/analytics/long-description.md
@@ -0,0 +1,20 @@
+You can help the Angular Team to prioritize features and improvements by permitting the Angular team to send command-line command usage statistics to Google.
+The Angular Team does not collect usage statistics unless you explicitly opt in. When installing the Angular CLI you are prompted to allow global collection of usage statistics.
+If you say no or skip the prompt, no data is collected.
+
+### What is collected?
+
+Usage analytics include the commands and selected flags for each execution.
+Usage analytics may include the following information:
+
+- Your operating system \(macOS, Linux distribution, Windows\) and its version.
+- Package manager name and version \(local version only\).
+- Node.js version \(local version only\).
+- Angular CLI version \(local version only\).
+- Command name that was run.
+- Workspace information, the number of application and library projects.
+- For schematics commands \(add, generate and new\), the schematic collection and name and a list of selected flags.
+- For build commands \(build, serve\), the builder name, the number and size of bundles \(initial and lazy\), compilation units, the time it took to build and rebuild, and basic Angular-specific API usage.
+
+Only Angular owned and developed schematics and builders are reported.
+Third-party schematics and builders do not send data to the Angular Team.
diff --git a/packages/angular/cli/src/commands/config/long-description.md b/packages/angular/cli/src/commands/config/long-description.md
index 78cc49e45662..94ebfca237eb 100644
--- a/packages/angular/cli/src/commands/config/long-description.md
+++ b/packages/angular/cli/src/commands/config/long-description.md
@@ -10,4 +10,4 @@ while on the command line options can be given dash-case.
For further details, see [Workspace Configuration](guide/workspace-config).
-For configuration of CLI usage analytics, see [Gathering an Viewing CLI Usage Analytics](cli/usage-analytics-gathering).
+For configuration of CLI usage analytics, see [ng analytics](cli/analytics).
diff --git a/packages/angular/cli/src/commands/generate/cli.ts b/packages/angular/cli/src/commands/generate/cli.ts
index 43e66ae18ffe..c4029e5a7e1f 100644
--- a/packages/angular/cli/src/commands/generate/cli.ts
+++ b/packages/angular/cli/src/commands/generate/cli.ts
@@ -7,7 +7,12 @@
*/
import { strings } from '@angular-devkit/core';
-import { Argv } from 'yargs';
+import { Collection } from '@angular-devkit/schematics';
+import {
+ FileSystemCollectionDescription,
+ FileSystemSchematicDescription,
+} from '@angular-devkit/schematics/tools';
+import { ArgumentsCamelCase, Argv } from 'yargs';
import {
CommandModuleError,
CommandModuleImplementation,
@@ -35,7 +40,7 @@ export class GenerateCommandModule
longDescriptionPath?: string | undefined;
override async builder(argv: Argv): Promise> {
- let localYargs = (await super.builder(argv)).command({
+ let localYargs = (await super.builder(argv)).command({
command: '$0 ',
describe: 'Run the provided schematic.',
builder: (localYargs) =>
@@ -46,7 +51,7 @@ export class GenerateCommandModule
demandOption: true,
})
.strict(),
- handler: (options) => this.handler(options),
+ handler: (options) => this.handler(options as ArgumentsCamelCase),
});
for (const [schematicName, collectionName] of await this.getSchematicsToRegister()) {
@@ -69,7 +74,6 @@ export class GenerateCommandModule
const {
'x-deprecated': xDeprecated,
description = schematicDescription,
- aliases = schematicAliases,
hidden = schematicHidden,
} = schemaJson;
const options = await this.getSchematicOptions(collection, schematicName, workflow);
@@ -79,10 +83,19 @@ export class GenerateCommandModule
// When 'describe' is set to false, it results in a hidden command.
describe: hidden === true ? false : typeof description === 'string' ? description : '',
deprecated: xDeprecated === true || typeof xDeprecated === 'string' ? xDeprecated : false,
- aliases: Array.isArray(aliases) ? (aliases as string[]) : undefined,
+ aliases: Array.isArray(schematicAliases)
+ ? await this.generateCommandAliasesStrings(collectionName, schematicAliases)
+ : undefined,
builder: (localYargs) => this.addSchemaOptionsToCommand(localYargs, options).strict(),
handler: (options) =>
- this.handler({ ...options, schematic: `${collectionName}:${schematicName}` }),
+ this.handler({
+ ...options,
+ schematic: `${collectionName}:${schematicName}`,
+ } as ArgumentsCamelCase<
+ SchematicsCommandArgs & {
+ schematic: string;
+ }
+ >),
});
}
@@ -120,6 +133,41 @@ export class GenerateCommandModule
return collectionName ? [collectionName] : [...(await this.getSchematicCollections())];
}
+ private async shouldAddCollectionNameAsPartOfCommand(): Promise {
+ const [collectionNameFromArgs] = this.parseSchematicInfo(
+ // positional = [generate, component] or [generate]
+ this.context.args.positional[1],
+ );
+
+ const schematicCollectionsFromConfig = await this.getSchematicCollections();
+ const collectionNames = await this.getCollectionNames();
+
+ // Only add the collection name as part of the command when it's not a known
+ // schematics collection or when it has been provided via the CLI.
+ // Ex:`ng generate @schematics/angular:c`
+ return (
+ !!collectionNameFromArgs ||
+ !collectionNames.some((c) => schematicCollectionsFromConfig.has(c))
+ );
+ }
+
+ /**
+ * Generate an aliases string array to be passed to the command builder.
+ *
+ * @example `[component]` or `[@schematics/angular:component]`.
+ */
+ private async generateCommandAliasesStrings(
+ collectionName: string,
+ schematicAliases: string[],
+ ): Promise {
+ // Only add the collection name as part of the command when it's not a known
+ // schematics collection or when it has been provided via the CLI.
+ // Ex:`ng generate @schematics/angular:c`
+ return (await this.shouldAddCollectionNameAsPartOfCommand())
+ ? schematicAliases.map((alias) => `${collectionName}:${alias}`)
+ : schematicAliases;
+ }
+
/**
* Generate a command string to be passed to the command builder.
*
@@ -130,23 +178,14 @@ export class GenerateCommandModule
schematicName: string,
options: Option[],
): Promise {
- const [collectionNameFromArgs] = this.parseSchematicInfo(
- // positional = [generate, component] or [generate]
- this.context.args.positional[1],
- );
-
const dasherizedSchematicName = strings.dasherize(schematicName);
- const schematicCollectionsFromConfig = await this.getSchematicCollections();
- const collectionNames = await this.getCollectionNames();
// Only add the collection name as part of the command when it's not a known
// schematics collection or when it has been provided via the CLI.
// Ex:`ng generate @schematics/angular:component`
- const commandName =
- !!collectionNameFromArgs ||
- !collectionNames.some((c) => schematicCollectionsFromConfig.has(c))
- ? collectionName + ':' + dasherizedSchematicName
- : dasherizedSchematicName;
+ const commandName = (await this.shouldAddCollectionNameAsPartOfCommand())
+ ? collectionName + ':' + dasherizedSchematicName
+ : dasherizedSchematicName;
const positionalArgs = options
.filter((o) => o.positional !== undefined)
@@ -165,6 +204,7 @@ export class GenerateCommandModule
*/
private async *getSchematics(): AsyncGenerator<{
schematicName: string;
+ schematicAliases?: Set;
collectionName: string;
}> {
const seenNames = new Set();
@@ -176,10 +216,37 @@ export class GenerateCommandModule
// If a schematic with this same name is already registered skip.
if (!seenNames.has(schematicName)) {
seenNames.add(schematicName);
- yield { schematicName, collectionName };
+
+ yield {
+ schematicName,
+ collectionName,
+ schematicAliases: this.listSchematicAliases(collection, schematicName),
+ };
+ }
+ }
+ }
+ }
+
+ private listSchematicAliases(
+ collection: Collection,
+ schematicName: string,
+ ): Set | undefined {
+ const description = collection.description.schematics[schematicName];
+ if (description) {
+ return description.aliases && new Set(description.aliases);
+ }
+
+ // Extended collections
+ if (collection.baseDescriptions) {
+ for (const base of collection.baseDescriptions) {
+ const description = base.schematics[schematicName];
+ if (description) {
+ return description.aliases && new Set(description.aliases);
}
}
}
+
+ return undefined;
}
/**
@@ -196,8 +263,11 @@ export class GenerateCommandModule
this.context.args.positional[1],
);
- for await (const { schematicName, collectionName } of this.getSchematics()) {
- if (schematicName === schematicNameFromArgs) {
+ for await (const { schematicName, collectionName, schematicAliases } of this.getSchematics()) {
+ if (
+ schematicNameFromArgs &&
+ (schematicName === schematicNameFromArgs || schematicAliases?.has(schematicNameFromArgs))
+ ) {
return [[schematicName, collectionName]];
}
diff --git a/packages/angular/cli/src/commands/new/cli.ts b/packages/angular/cli/src/commands/new/cli.ts
index e5014dac3753..c4f8bdebcece 100644
--- a/packages/angular/cli/src/commands/new/cli.ts
+++ b/packages/angular/cli/src/commands/new/cli.ts
@@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
+import { join } from 'node:path';
import { Argv } from 'yargs';
import {
CommandModuleImplementation,
@@ -35,7 +36,7 @@ export class NewCommandModule
command = 'new [name]';
aliases = 'n';
describe = 'Creates a new Angular workspace.';
- longDescriptionPath?: string | undefined;
+ longDescriptionPath = join(__dirname, 'long-description.md');
override async builder(argv: Argv): Promise> {
const localYargs = (await super.builder(argv)).option('collection', {
diff --git a/packages/angular/cli/src/commands/new/long-description.md b/packages/angular/cli/src/commands/new/long-description.md
new file mode 100644
index 000000000000..1166f974887a
--- /dev/null
+++ b/packages/angular/cli/src/commands/new/long-description.md
@@ -0,0 +1,15 @@
+Creates and initializes a new Angular application that is the default project for a new workspace.
+
+Provides interactive prompts for optional configuration, such as adding routing support.
+All prompts can safely be allowed to default.
+
+- The new workspace folder is given the specified project name, and contains configuration files at the top level.
+
+- By default, the files for a new initial application (with the same name as the workspace) are placed in the `src/` subfolder.
+- The new application's configuration appears in the `projects` section of the `angular.json` workspace configuration file, under its project name.
+
+- Subsequent applications that you generate in the workspace reside in the `projects/` subfolder.
+
+If you plan to have multiple applications in the workspace, you can create an empty workspace by using the `--no-create-application` option.
+You can then use `ng generate application` to create an initial application.
+This allows a workspace name different from the initial app name, and ensures that all applications reside in the `/projects` subfolder, matching the structure of the configuration file.
diff --git a/packages/angular/cli/src/commands/run/cli.ts b/packages/angular/cli/src/commands/run/cli.ts
index 46d0b9268929..de7c185e9f3d 100644
--- a/packages/angular/cli/src/commands/run/cli.ts
+++ b/packages/angular/cli/src/commands/run/cli.ts
@@ -38,7 +38,8 @@ export class RunCommandModule
const localYargs: Argv = argv
.positional('target', {
- describe: 'The Architect target to run.',
+ describe:
+ 'The Architect target to run provided in the the following format `project:target[:configuration]`.',
type: 'string',
demandOption: true,
// Show only in when using --help and auto completion because otherwise comma seperated configuration values will be invalid.
diff --git a/packages/angular/cli/src/commands/run/long-description.md b/packages/angular/cli/src/commands/run/long-description.md
index 65a307fcd771..e74f8756679d 100644
--- a/packages/angular/cli/src/commands/run/long-description.md
+++ b/packages/angular/cli/src/commands/run/long-description.md
@@ -1,16 +1,10 @@
Architect is the tool that the CLI uses to perform complex tasks such as compilation, according to provided configurations.
The CLI commands run Architect targets such as `build`, `serve`, `test`, and `lint`.
-Each named target has a default configuration, specified by an "options" object,
-and an optional set of named alternate configurations in the "configurations" object.
+Each named target has a default configuration, specified by an `options` object,
+and an optional set of named alternate configurations in the `configurations` object.
-For example, the "serve" target for a newly generated app has a predefined
-alternate configuration named "production".
+For example, the `serve` target for a newly generated app has a predefined
+alternate configuration named `production`.
-You can define new targets and their configuration options in the "architect" section
-of the `angular.json` file.
-If you do so, you can run them from the command line using the `ng run` command.
-Execute the command using the following format.
-
-```
-ng run project:target[:configuration]
-```
+You can define new targets and their configuration options in the `architect` section
+of the `angular.json` file which you can run them from the command line using the `ng run` command.
diff --git a/packages/angular/cli/src/commands/update/cli.ts b/packages/angular/cli/src/commands/update/cli.ts
index 53e657498a45..c2c7ed05f58c 100644
--- a/packages/angular/cli/src/commands/update/cli.ts
+++ b/packages/angular/cli/src/commands/update/cli.ts
@@ -102,7 +102,7 @@ export class UpdateCommandModule extends CommandModule {
'Version from which to migrate from. ' +
`Only available with a single package being updated, and only with 'migrate-only'.`,
type: 'string',
- implies: ['to', 'migrate-only'],
+ implies: ['migrate-only'],
conflicts: ['name'],
})
.option('to', {
@@ -201,12 +201,12 @@ export class UpdateCommandModule extends CommandModule {
return 1;
}
- if (options.migrateOnly && packageIdentifier.rawSpec) {
+ if (options.migrateOnly && packageIdentifier.rawSpec !== '*') {
logger.warn('Package specifier has no effect when using "migrate-only" option.');
}
// If next option is used and no specifier supplied, use next tag
- if (options.next && !packageIdentifier.rawSpec) {
+ if (options.next && packageIdentifier.rawSpec === '*') {
packageIdentifier.fetchSpec = 'next';
}
@@ -387,16 +387,29 @@ export class UpdateCommandModule extends CommandModule {
logger.info(' ' + description.join('.\n '));
}
- const result = await this.executeSchematic(
+ const { success, files } = await this.executeSchematic(
workflow,
migration.collection.name,
migration.name,
);
- if (!result.success) {
+ if (!success) {
return 1;
}
- logger.info(' Migration completed.');
+ let modifiedFilesText: string;
+ switch (files.size) {
+ case 0:
+ modifiedFilesText = 'No changes made';
+ break;
+ case 1:
+ modifiedFilesText = '1 file modified';
+ break;
+ default:
+ modifiedFilesText = `${files.size} files modified`;
+ break;
+ }
+
+ logger.info(` Migration completed (${modifiedFilesText}).`);
// Commit migration
if (commit) {
diff --git a/packages/angular/cli/src/commands/update/schematic/index_spec.ts b/packages/angular/cli/src/commands/update/schematic/index_spec.ts
index c133647bb2a3..19197195cb4b 100644
--- a/packages/angular/cli/src/commands/update/schematic/index_spec.ts
+++ b/packages/angular/cli/src/commands/update/schematic/index_spec.ts
@@ -9,7 +9,6 @@
import { normalize, virtualFs } from '@angular-devkit/core';
import { HostTree } from '@angular-devkit/schematics';
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { map } from 'rxjs/operators';
import * as semver from 'semver';
import { angularMajorCompatGuarantee } from './index';
@@ -51,8 +50,8 @@ describe('@schematics/update', () => {
appTree = new UnitTestTree(new HostTree(host));
});
- it('ignores dependencies not hosted on the NPM registry', (done) => {
- const tree = new UnitTestTree(
+ it('ignores dependencies not hosted on the NPM registry', async () => {
+ let newTree = new UnitTestTree(
new HostTree(
new virtualFs.test.TestHost({
'/package.json': `{
@@ -65,22 +64,15 @@ describe('@schematics/update', () => {
),
);
- schematicRunner
- .runSchematicAsync('update', undefined, tree)
- .pipe(
- map((t) => {
- const packageJson = JSON.parse(t.readContent('/package.json'));
- expect(packageJson['dependencies']['@angular-devkit-tests/update-base']).toBe(
- 'file:update-base-1.0.0.tgz',
- );
- }),
- )
- .toPromise()
- .then(done, done.fail);
+ newTree = await schematicRunner.runSchematic('update', undefined, newTree);
+ const packageJson = JSON.parse(newTree.readContent('/package.json'));
+ expect(packageJson['dependencies']['@angular-devkit-tests/update-base']).toBe(
+ 'file:update-base-1.0.0.tgz',
+ );
}, 45000);
it('should not error with yarn 2.0 protocols', async () => {
- const tree = new UnitTestTree(
+ let newTree = new UnitTestTree(
new HostTree(
new virtualFs.test.TestHost({
'/package.json': `{
@@ -94,20 +86,18 @@ describe('@schematics/update', () => {
),
);
- const newTree = await schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular-devkit-tests/update-base'],
- },
- tree,
- )
- .toPromise();
+ newTree = await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular-devkit-tests/update-base'],
+ },
+ newTree,
+ );
const { dependencies } = JSON.parse(newTree.readContent('/package.json'));
expect(dependencies['@angular-devkit-tests/update-base']).toBe('1.1.0');
});
- it('updates Angular as compatible with Angular N-1', (done) => {
+ it('updates Angular as compatible with Angular N-1', async () => {
// Add the basic migration package.
const content = virtualFs.fileBufferToString(host.sync.read(normalize('/package.json')));
const packageJson = JSON.parse(content);
@@ -121,25 +111,18 @@ describe('@schematics/update', () => {
virtualFs.stringToFileBuffer(JSON.stringify(packageJson)),
);
- schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular/core@^6.0.0'],
- },
- appTree,
- )
- .pipe(
- map((tree) => {
- const packageJson = JSON.parse(tree.readContent('/package.json'));
- expect(packageJson['dependencies']['@angular/core'][0]).toBe('6');
- }),
- )
- .toPromise()
- .then(done, done.fail);
+ const newTree = await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular/core@^6.0.0'],
+ },
+ appTree,
+ );
+ const newPpackageJson = JSON.parse(newTree.readContent('/package.json'));
+ expect(newPpackageJson['dependencies']['@angular/core'][0]).toBe('6');
}, 45000);
- it('updates Angular as compatible with Angular N-1 (2)', (done) => {
+ it('updates Angular as compatible with Angular N-1 (2)', async () => {
// Add the basic migration package.
const content = virtualFs.fileBufferToString(host.sync.read(normalize('/package.json')));
const packageJson = JSON.parse(content);
@@ -159,25 +142,19 @@ describe('@schematics/update', () => {
virtualFs.stringToFileBuffer(JSON.stringify(packageJson)),
);
- schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular/core@^6.0.0'],
- },
- appTree,
- )
- .pipe(
- map((tree) => {
- const packageJson = JSON.parse(tree.readContent('/package.json'));
- expect(packageJson['dependencies']['@angular/core'][0]).toBe('6');
- expect(packageJson['dependencies']['rxjs'][0]).toBe('6');
- expect(packageJson['dependencies']['typescript'][0]).toBe('2');
- expect(packageJson['dependencies']['typescript'][2]).not.toBe('4');
- }),
- )
- .toPromise()
- .then(done, done.fail);
+ const newTree = await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular/core@^6.0.0'],
+ },
+ appTree,
+ );
+
+ const newPackageJson = JSON.parse(newTree.readContent('/package.json'));
+ expect(newPackageJson['dependencies']['@angular/core'][0]).toBe('6');
+ expect(newPackageJson['dependencies']['rxjs'][0]).toBe('6');
+ expect(newPackageJson['dependencies']['typescript'][0]).toBe('2');
+ expect(newPackageJson['dependencies']['typescript'][2]).not.toBe('4');
}, 45000);
it('uses packageGroup for versioning', async () => {
@@ -192,26 +169,19 @@ describe('@schematics/update', () => {
virtualFs.stringToFileBuffer(JSON.stringify(packageJson)),
);
- await schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular-devkit-tests/update-package-group-1'],
- },
- appTree,
- )
- .pipe(
- map((tree) => {
- const packageJson = JSON.parse(tree.readContent('/package.json'));
- const deps = packageJson['dependencies'];
- expect(deps['@angular-devkit-tests/update-package-group-1']).toBe('1.2.0');
- expect(deps['@angular-devkit-tests/update-package-group-2']).toBe('2.0.0');
- }),
- )
- .toPromise();
+ const newTree = await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular-devkit-tests/update-package-group-1'],
+ },
+ appTree,
+ );
+ const { dependencies: deps } = JSON.parse(newTree.readContent('/package.json'));
+ expect(deps['@angular-devkit-tests/update-package-group-1']).toBe('1.2.0');
+ expect(deps['@angular-devkit-tests/update-package-group-2']).toBe('2.0.0');
}, 45000);
- it('can migrate only', (done) => {
+ it('can migrate only', async () => {
// Add the basic migration package.
const content = virtualFs.fileBufferToString(host.sync.read(normalize('/package.json')));
const packageJson = JSON.parse(content);
@@ -221,29 +191,21 @@ describe('@schematics/update', () => {
virtualFs.stringToFileBuffer(JSON.stringify(packageJson)),
);
- schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular-devkit-tests/update-migrations'],
- migrateOnly: true,
- },
- appTree,
- )
- .pipe(
- map((tree) => {
- const packageJson = JSON.parse(tree.readContent('/package.json'));
- expect(packageJson['dependencies']['@angular-devkit-tests/update-base']).toBe('1.0.0');
- expect(packageJson['dependencies']['@angular-devkit-tests/update-migrations']).toBe(
- '1.0.0',
- );
- }),
- )
- .toPromise()
- .then(done, done.fail);
+ const newTree = await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular-devkit-tests/update-migrations'],
+ migrateOnly: true,
+ },
+ appTree,
+ );
+
+ const newPackageJson = JSON.parse(newTree.readContent('/package.json'));
+ expect(newPackageJson['dependencies']['@angular-devkit-tests/update-base']).toBe('1.0.0');
+ expect(newPackageJson['dependencies']['@angular-devkit-tests/update-migrations']).toBe('1.0.0');
}, 45000);
- it('can migrate from only', (done) => {
+ it('can migrate from only', async () => {
// Add the basic migration package.
const content = virtualFs.fileBufferToString(host.sync.read(normalize('/package.json')));
const packageJson = JSON.parse(content);
@@ -253,29 +215,20 @@ describe('@schematics/update', () => {
virtualFs.stringToFileBuffer(JSON.stringify(packageJson)),
);
- schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular-devkit-tests/update-migrations'],
- migrateOnly: true,
- from: '0.1.2',
- },
- appTree,
- )
- .pipe(
- map((tree) => {
- const packageJson = JSON.parse(tree.readContent('/package.json'));
- expect(packageJson['dependencies']['@angular-devkit-tests/update-migrations']).toBe(
- '1.6.0',
- );
- }),
- )
- .toPromise()
- .then(done, done.fail);
+ const newTree = await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular-devkit-tests/update-migrations'],
+ migrateOnly: true,
+ from: '0.1.2',
+ },
+ appTree,
+ );
+ const { dependencies } = JSON.parse(newTree.readContent('/package.json'));
+ expect(dependencies['@angular-devkit-tests/update-migrations']).toBe('1.6.0');
}, 45000);
- it('can install and migrate with --from (short version number)', (done) => {
+ it('can install and migrate with --from (short version number)', async () => {
// Add the basic migration package.
const content = virtualFs.fileBufferToString(host.sync.read(normalize('/package.json')));
const packageJson = JSON.parse(content);
@@ -285,29 +238,20 @@ describe('@schematics/update', () => {
virtualFs.stringToFileBuffer(JSON.stringify(packageJson)),
);
- schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular-devkit-tests/update-migrations'],
- migrateOnly: true,
- from: '0',
- },
- appTree,
- )
- .pipe(
- map((tree) => {
- const packageJson = JSON.parse(tree.readContent('/package.json'));
- expect(packageJson['dependencies']['@angular-devkit-tests/update-migrations']).toBe(
- '1.6.0',
- );
- }),
- )
- .toPromise()
- .then(done, done.fail);
+ const newTree = await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular-devkit-tests/update-migrations'],
+ migrateOnly: true,
+ from: '0',
+ },
+ appTree,
+ );
+ const { dependencies } = JSON.parse(newTree.readContent('/package.json'));
+ expect(dependencies['@angular-devkit-tests/update-migrations']).toBe('1.6.0');
}, 45000);
- it('validates peer dependencies', (done) => {
+ it('validates peer dependencies', async () => {
const content = virtualFs.fileBufferToString(host.sync.read(normalize('/package.json')));
const packageJson = JSON.parse(content);
const dependencies = packageJson['dependencies'];
@@ -326,27 +270,16 @@ describe('@schematics/update', () => {
const hasPeerdepMsg = (dep: string) =>
messages.some((str) => str.includes(`missing peer dependency of "${dep}"`));
- schematicRunner
- .runSchematicAsync(
- 'update',
- {
- packages: ['@angular-devkit/build-angular'],
- next: true,
- },
- appTree,
- )
- .pipe(
- map(() => {
- expect(hasPeerdepMsg('@angular/compiler-cli')).toBeTruthy(
- `Should show @angular/compiler-cli message.`,
- );
- expect(hasPeerdepMsg('typescript')).toBeTruthy(`Should show typescript message.`);
- expect(hasPeerdepMsg('@angular/localize')).toBeFalsy(
- `Should not show @angular/localize message.`,
- );
- }),
- )
- .toPromise()
- .then(done, done.fail);
+ await schematicRunner.runSchematic(
+ 'update',
+ {
+ packages: ['@angular-devkit/build-angular'],
+ next: true,
+ },
+ appTree,
+ );
+ expect(hasPeerdepMsg('@angular/compiler-cli')).toBeTruthy();
+ expect(hasPeerdepMsg('typescript')).toBeTruthy();
+ expect(hasPeerdepMsg('@angular/localize')).toBeFalsy();
}, 45000);
});
diff --git a/packages/angular/cli/src/utilities/package-metadata.ts b/packages/angular/cli/src/utilities/package-metadata.ts
index e7a448aa8d61..0d683fedecc5 100644
--- a/packages/angular/cli/src/utilities/package-metadata.ts
+++ b/packages/angular/cli/src/utilities/package-metadata.ts
@@ -139,6 +139,18 @@ function readOptions(
continue;
}
+ if (
+ normalizedName === 'registry' &&
+ rcOptions['registry'] &&
+ value === 'https://registry.yarnpkg.com' &&
+ process.env['npm_config_user_agent']?.includes('yarn')
+ ) {
+ // When running `ng update` using yarn (`yarn ng update`), 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.
+ // This causes the registry specified in the RC to always be overridden with the below logic.
+ continue;
+ }
+
normalizedName = normalizedName.replace(/(?!^)_/g, '-'); // don't replace _ at the start of the key.s
envVariablesOptions[normalizedName] = value;
}
@@ -200,6 +212,10 @@ function normalizeOptions(
} catch {}
}
break;
+ case 'before':
+ options['before'] =
+ typeof substitutedValue === 'string' ? new Date(substitutedValue) : substitutedValue;
+ break;
default:
options[key] = substitutedValue;
break;
diff --git a/packages/angular/cli/src/utilities/version.ts b/packages/angular/cli/src/utilities/version.ts
index 2c9db37d69a9..777c3de165f6 100644
--- a/packages/angular/cli/src/utilities/version.ts
+++ b/packages/angular/cli/src/utilities/version.ts
@@ -23,7 +23,7 @@ class Version {
}
}
-// TODO: Convert this to use build-time version stamping after flipping the build script to use bazel
+// TODO(bazel): Convert this to use build-time version stamping after flipping the build script to use bazel
// export const VERSION = new Version('0.0.0-PLACEHOLDER');
export const VERSION = new Version(
(
diff --git a/packages/angular/create/BUILD.bazel b/packages/angular/create/BUILD.bazel
index 0b547661c54d..85973cfd9452 100644
--- a/packages/angular/create/BUILD.bazel
+++ b/packages/angular/create/BUILD.bazel
@@ -32,6 +32,7 @@ genrule(
pkg_npm(
name = "npm_package",
+ tags = ["release-package"],
visibility = ["//visibility:public"],
deps = [
":README.md",
diff --git a/packages/angular/create/README.md b/packages/angular/create/README.md
index ea76ef2a6a62..ce573fd52580 100644
--- a/packages/angular/create/README.md
+++ b/packages/angular/create/README.md
@@ -9,7 +9,7 @@ Scaffold an Angular CLI workspace without needing to install the Angular CLI glo
### npm
```
-npm init @angular [project-name] -- [...options]
+npm init @angular@latest [project-name] -- [...options]
```
### yarn
diff --git a/packages/angular/pwa/BUILD.bazel b/packages/angular/pwa/BUILD.bazel
index eeaf57c76d2a..25b94cbb3f05 100644
--- a/packages/angular/pwa/BUILD.bazel
+++ b/packages/angular/pwa/BUILD.bazel
@@ -42,7 +42,7 @@ ts_library(
"//packages/angular_devkit/schematics",
"//packages/schematics/angular",
"@npm//@types/node",
- "@npm//@types/parse5-html-rewriting-stream",
+ "@npm//parse5-html-rewriting-stream",
],
)
@@ -58,7 +58,6 @@ ts_library(
deps = [
":pwa",
"//packages/angular_devkit/schematics/testing",
- "@npm//parse5-html-rewriting-stream",
],
)
@@ -88,6 +87,7 @@ pkg_npm(
"//packages/angular_devkit/schematics:package.json",
"//packages/schematics/angular:package.json",
],
+ tags = ["release-package"],
deps = [
":README.md",
":license",
diff --git a/packages/angular/pwa/package.json b/packages/angular/pwa/package.json
index e4dcfc3d3a4d..ef5624847308 100644
--- a/packages/angular/pwa/package.json
+++ b/packages/angular/pwa/package.json
@@ -14,10 +14,10 @@
"dependencies": {
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
"@schematics/angular": "0.0.0-PLACEHOLDER",
- "parse5-html-rewriting-stream": "6.0.1"
+ "parse5-html-rewriting-stream": "7.0.0"
},
"peerDependencies": {
- "@angular/cli": "^15.0.0-next"
+ "@angular/cli": "^15.0.0"
},
"peerDependenciesMeta": {
"@angular/cli": {
diff --git a/packages/angular/pwa/pwa/index.ts b/packages/angular/pwa/pwa/index.ts
index a96e70a832a5..03627ca5a615 100644
--- a/packages/angular/pwa/pwa/index.ts
+++ b/packages/angular/pwa/pwa/index.ts
@@ -30,7 +30,11 @@ function updateIndexFile(path: string): Rule {
throw new SchematicsException(`Could not read index file: ${path}`);
}
- const rewriter = new (await import('parse5-html-rewriting-stream')).default();
+ const { RewritingStream } = await loadEsmModule(
+ 'parse5-html-rewriting-stream',
+ );
+
+ const rewriter = new RewritingStream();
let needsNoScript = true;
rewriter.on('startTag', (startTag) => {
if (startTag.tagName === 'noscript') {
@@ -173,3 +177,19 @@ export default function (options: PwaOptions): Rule {
]);
};
}
+
+/**
+ * This uses a dynamic import to load a module which may be ESM.
+ * CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
+ * will currently, unconditionally downlevel dynamic import into a require call.
+ * require calls cannot load ESM code and will result in a runtime error. To workaround
+ * this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
+ * Once TypeScript provides support for keeping the dynamic import this workaround can
+ * be dropped.
+ *
+ * @param modulePath The path of the module to load.
+ * @returns A Promise that resolves to the dynamically imported module.
+ */
+function loadEsmModule(modulePath: string | URL): Promise {
+ return new Function('modulePath', `return import(modulePath);`)(modulePath) as Promise;
+}
diff --git a/packages/angular/pwa/pwa/index_spec.ts b/packages/angular/pwa/pwa/index_spec.ts
index 35d0a47026a3..9657b0493b31 100644
--- a/packages/angular/pwa/pwa/index_spec.ts
+++ b/packages/angular/pwa/pwa/index_spec.ts
@@ -39,18 +39,23 @@ describe('PWA Schematic', () => {
};
beforeEach(async () => {
- appTree = await schematicRunner
- .runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions)
- .toPromise();
- appTree = await schematicRunner
- .runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree)
- .toPromise();
+ appTree = await schematicRunner.runExternalSchematic(
+ '@schematics/angular',
+ 'workspace',
+ workspaceOptions,
+ );
+ appTree = await schematicRunner.runExternalSchematic(
+ '@schematics/angular',
+ 'application',
+ appOptions,
+ appTree,
+ );
});
it('should run the service worker schematic', (done) => {
schematicRunner
- .runSchematicAsync('ng-add', defaultOptions, appTree)
- .toPromise()
+ .runSchematic('ng-add', defaultOptions, appTree)
+
.then((tree) => {
const configText = tree.readContent('/angular.json');
const config = JSON.parse(configText);
@@ -64,8 +69,8 @@ describe('PWA Schematic', () => {
const dimensions = [72, 96, 128, 144, 152, 192, 384, 512];
const iconPath = '/projects/bar/src/assets/icons/icon-';
schematicRunner
- .runSchematicAsync('ng-add', defaultOptions, appTree)
- .toPromise()
+ .runSchematic('ng-add', defaultOptions, appTree)
+
.then((tree) => {
dimensions.forEach((d) => {
const path = `${iconPath}${d}x${d}.png`;
@@ -77,8 +82,8 @@ describe('PWA Schematic', () => {
it('should create a manifest file', (done) => {
schematicRunner
- .runSchematicAsync('ng-add', defaultOptions, appTree)
- .toPromise()
+ .runSchematic('ng-add', defaultOptions, appTree)
+
.then((tree) => {
expect(tree.exists('/projects/bar/src/manifest.webmanifest')).toEqual(true);
done();
@@ -87,8 +92,8 @@ describe('PWA Schematic', () => {
it('should set the name & short_name in the manifest file', (done) => {
schematicRunner
- .runSchematicAsync('ng-add', defaultOptions, appTree)
- .toPromise()
+ .runSchematic('ng-add', defaultOptions, appTree)
+
.then((tree) => {
const manifestText = tree.readContent('/projects/bar/src/manifest.webmanifest');
const manifest = JSON.parse(manifestText);
@@ -102,8 +107,8 @@ describe('PWA Schematic', () => {
it('should set the name & short_name in the manifest file when no title provided', (done) => {
const options = { ...defaultOptions, title: undefined };
schematicRunner
- .runSchematicAsync('ng-add', options, appTree)
- .toPromise()
+ .runSchematic('ng-add', options, appTree)
+
.then((tree) => {
const manifestText = tree.readContent('/projects/bar/src/manifest.webmanifest');
const manifest = JSON.parse(manifestText);
@@ -116,8 +121,8 @@ describe('PWA Schematic', () => {
it('should update the index file', (done) => {
schematicRunner
- .runSchematicAsync('ng-add', defaultOptions, appTree)
- .toPromise()
+ .runSchematic('ng-add', defaultOptions, appTree)
+
.then((tree) => {
const content = tree.readContent('projects/bar/src/index.html');
@@ -135,8 +140,8 @@ describe('PWA Schematic', () => {
index = index.replace('