mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
Compare commits
144 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d53649c8fb | |||
| 006eaf3d90 | |||
| 155dbee71a | |||
| 6398baa215 | |||
| 2fd1f7beb5 | |||
| f38ee0d0e9 | |||
| b7c745b12d | |||
| c00359dd14 | |||
| 91bdd178f4 | |||
| db8f7ce0ba | |||
| e361deae30 | |||
| 807c4d7973 | |||
| ca10fbde5a | |||
| 91f5a3c0ec | |||
| 1151c45086 | |||
| 38b7ab26fb | |||
| 45d3eeffaf | |||
| f041042947 | |||
| 74e47782c6 | |||
| b388f1e518 | |||
| aee5260610 | |||
| 70d0c10d6c | |||
| bca8a3c73b | |||
| a1a78b2e13 | |||
| cf48b13706 | |||
| c36de9e6ca | |||
| 409287add3 | |||
| 2c522efbe5 | |||
| ba8a5d826e | |||
| 1e9bfe54b1 | |||
| c53abd96f1 | |||
| e7e2dea9c8 | |||
| 8ad10fd63b | |||
| c2625575aa | |||
| 8b62b313e1 | |||
| dcab8c928b | |||
| 1930e99e14 | |||
| 0db3613565 | |||
| bcf07e4559 | |||
| 3e8e16bce7 | |||
| 5aed352abd | |||
| 2bcdc66159 | |||
| 7bf66f0c52 | |||
| 4b9385f468 | |||
| 44784f175d | |||
| 9506cdfaad | |||
| 2ab638d514 | |||
| 53963e910e | |||
| 70c8780c54 | |||
| f531370281 | |||
| acf8b742d8 | |||
| 6f5bd5f964 | |||
| 72605a42c4 | |||
| 75d2a349b4 | |||
| e8234095ca | |||
| d381e3b05b | |||
| 26ade4a337 | |||
| a81f0faa1a | |||
| 74beeeca3f | |||
| f202160e6e | |||
| c526238751 | |||
| 5949373692 | |||
| 22b56ca66f | |||
| 5aa69ff0a2 | |||
| a5b45ca2f6 | |||
| 0ce086e967 | |||
| c9d7a70fb5 | |||
| 546d7b8329 | |||
| b935eff007 | |||
| ebfc946683 | |||
| ddd92585a9 | |||
| 4dd0586978 | |||
| 1fa10c07ce | |||
| db11cdd389 | |||
| 02dce8ee11 | |||
| 4bd178a68c | |||
| cfdd04b2ac | |||
| 4f1e88e598 | |||
| aea0a70c1d | |||
| 6549418e39 | |||
| 66a85ab190 | |||
| 6b271c88f2 | |||
| e9905f7b7f | |||
| b4ae55ae68 | |||
| 6274ea7e8b | |||
| 276836ee73 | |||
| 11d817348c | |||
| 317ae4443a | |||
| 053cd3c747 | |||
| f038803693 | |||
| ee16715c68 | |||
| 59de6400fa | |||
| 2f969c8ac4 | |||
| d5d692766c | |||
| bf1b51cefe | |||
| fed402f598 | |||
| fe50aeb3bf | |||
| dda655f8e8 | |||
| c4de0c0671 | |||
| b61c8e1d2e | |||
| 46d3bb56ea | |||
| 1a8297bf9e | |||
| efc6405816 | |||
| aee83d1629 | |||
| 46c920b1bd | |||
| 2f45910489 | |||
| bf234143db | |||
| 5a60242421 | |||
| fec1206f64 | |||
| 98ecf800fa | |||
| 35d74d2fb2 | |||
| 30218af593 | |||
| 918a8d06ca | |||
| 62e3a70519 | |||
| c4863d2f98 | |||
| ffce768115 | |||
| f8807a30be | |||
| d7743144d3 | |||
| 70deb1fe95 | |||
| da99b9ae3a | |||
| 2943591c27 | |||
| fca058a8a1 | |||
| cea42d0e6a | |||
| f5f80d8ac2 | |||
| f5a10209e0 | |||
| 18816a6066 | |||
| 7570dfd532 | |||
| 6819c8b592 | |||
| 026efb116e | |||
| 87056c3b5d | |||
| 827b9db370 | |||
| d5210f0851 | |||
| 755b23af0b | |||
| 59983efa82 | |||
| d1d131a143 | |||
| 0d5363a6d7 | |||
| 42a3dbbd53 | |||
| 56769de4d8 | |||
| cf508935f6 | |||
| 743978576e | |||
| 126204b16a | |||
| 0dcf3094a4 | |||
| 1cc1500ee0 | |||
| 41955cf92e |
+32
@@ -0,0 +1,32 @@
|
||||
# @generated
|
||||
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
|
||||
# This file should be checked into version control along with the pnpm-lock.yaml file.
|
||||
.npmrc=-1406867100
|
||||
.pnpmfile.cjs=1437575780
|
||||
adev/package.json=802893591
|
||||
adev/shared-docs/package.json=735765359
|
||||
adev/shared-docs/pipeline/api-gen/package.json=939673974
|
||||
integration/package.json=-239561259
|
||||
modules/package.json=285483536
|
||||
package.json=269293473
|
||||
packages/animations/package.json=-678724831
|
||||
packages/benchpress/package.json=-1908328724
|
||||
packages/common/package.json=1729763064
|
||||
packages/compiler-cli/linker/babel/test/package.json=939673974
|
||||
packages/compiler-cli/package.json=1178475833
|
||||
packages/compiler/package.json=1190056499
|
||||
packages/core/package.json=1154833122
|
||||
packages/core/test/bundling/package.json=-41696443
|
||||
packages/elements/package.json=-892969618
|
||||
packages/forms/package.json=-877154917
|
||||
packages/localize/package.json=-1162087867
|
||||
packages/platform-browser-dynamic/package.json=1901947880
|
||||
packages/platform-browser/package.json=-1163479450
|
||||
packages/platform-server/package.json=-737662753
|
||||
packages/router/package.json=860819913
|
||||
packages/upgrade/package.json=16347051
|
||||
packages/zone.js/package.json=-1005735564
|
||||
pnpm-lock.yaml=-1752804703
|
||||
pnpm-workspace.yaml=1738525657
|
||||
tools/bazel/rules_angular_store/package.json=-239561259
|
||||
yarn.lock=-482312644
|
||||
@@ -55,7 +55,6 @@ packages/core/node_modules
|
||||
packages/core/test/bundling/node_modules
|
||||
packages/elements/node_modules
|
||||
packages/forms/node_modules
|
||||
packages/language-service/node_modules
|
||||
packages/platform-browser/node_modules
|
||||
packages/platform-server/node_modules
|
||||
packages/platform-browser-dynamic/node_modules
|
||||
@@ -63,5 +62,4 @@ packages/router/node_modules
|
||||
packages/zone.js/node_modules
|
||||
packages/upgrade/node_modules
|
||||
packages/benchpress/node_modules
|
||||
packages/service-worker/node_modules
|
||||
tools/bazel/rules_angular_store/node_modules
|
||||
|
||||
@@ -12,9 +12,6 @@ common --@aspect_rules_ts//ts:default_to_tsc_transpiler
|
||||
# Needed as otherwise `env` of TS actions would be ignored.
|
||||
common --incompatible_merge_fixed_and_default_shell_env
|
||||
|
||||
# Frozen lockfile
|
||||
common --lockfile_mode=error
|
||||
|
||||
###############################
|
||||
# Filesystem interactions #
|
||||
###############################
|
||||
@@ -41,7 +38,7 @@ test --nolegacy_external_runfiles
|
||||
# in Bazel 0.21.0 but turned off again in 0.22.0. Follow
|
||||
# https://github.com/bazelbuild/bazel/issues/7026 for more details.
|
||||
# This flag is needed to so that the bazel cache is not invalidated
|
||||
# when running bazel via `pnpm bazel`.
|
||||
# when running bazel via `yarn bazel`.
|
||||
# See https://github.com/angular/angular/issues/27514.
|
||||
build --incompatible_strict_action_env
|
||||
run --incompatible_strict_action_env
|
||||
@@ -63,11 +60,11 @@ build --enable_runfiles
|
||||
# Releases should always be stamped with version control info
|
||||
# This command assumes node on the path and is a workaround for
|
||||
# https://github.com/bazelbuild/bazel/issues/4802
|
||||
build:release --workspace_status_command="pnpm --silent ng-dev release build-env-stamp --mode=release"
|
||||
build:release --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=release"
|
||||
build:release --stamp
|
||||
|
||||
# Snapshots should also be stamped with version control information.
|
||||
build:snapshot-build --workspace_status_command="pnpm --silent ng-dev release build-env-stamp --mode=snapshot"
|
||||
build:snapshot-build --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=snapshot"
|
||||
build:snapshot-build --stamp
|
||||
|
||||
# Angular DevTools for Firefox releases *cannot* be stamped and `--config snapshot-build-firefox` is a no-op.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
7.6.1
|
||||
6.5.0
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "Angular dev container",
|
||||
"dockerFile": "Dockerfile",
|
||||
"appPort": [4000, 4200, 4433, 5000, 8080, 9876],
|
||||
"postCreateCommand": "pnpm install",
|
||||
"postCreateCommand": "yarn install",
|
||||
"extensions": [
|
||||
"devondcarew.bazel-code",
|
||||
"ms-vscode.vscode-typescript-tslint-plugin"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
load("//tools:defaults.bzl", "esbuild_checked_in", "ts_config", "ts_project")
|
||||
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
|
||||
load("//tools:defaults2.bzl", "esbuild_checked_in", "ts_project")
|
||||
|
||||
package(default_visibility = ["//.github/actions/deploy-docs-site:__subpackages__"])
|
||||
|
||||
@@ -17,11 +18,11 @@ esbuild_checked_in(
|
||||
platform = "node",
|
||||
target = "node20",
|
||||
deps = [
|
||||
":lib",
|
||||
":lib_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
ts_config(
|
||||
rules_js_tsconfig(
|
||||
name = "tsconfig",
|
||||
src = "tsconfig.json",
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,9 +5,9 @@ runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Saucelabs Variables
|
||||
uses: angular/dev-infra/github-actions/saucelabs@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/saucelabs@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Starting Saucelabs tunnel service
|
||||
shell: bash
|
||||
run: ./tools/saucelabs/sauce-service.sh run &
|
||||
@@ -34,7 +34,7 @@ runs:
|
||||
run: ./tools/saucelabs/sauce-service.sh ready-wait
|
||||
- name: Running tests on Saucelabs.
|
||||
shell: bash
|
||||
run: KARMA_WEB_TEST_MODE=SL_REQUIRED pnpm karma start ./karma-js.conf.js --single-run
|
||||
run: KARMA_WEB_TEST_MODE=SL_REQUIRED yarn karma start ./karma-js.conf.js --single-run
|
||||
- name: Stop Saucelabs tunnel service
|
||||
shell: bash
|
||||
run: ./tools/saucelabs/sauce-service.sh stop
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
name: 'Installing Yarn dependencies'
|
||||
description: 'Installs the dependencies using Yarn'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
|
||||
with:
|
||||
path: |
|
||||
./node_modules/
|
||||
# If just `WORKSPACE` or `yarn.lock` is changed, the most recent cache can be restored.
|
||||
# See: https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action.
|
||||
key: v1-angular-main-deps-${{hashFiles('WORKSPACE')}}-${{hashFiles('yarn.lock')}}
|
||||
restore-keys: v1-angular-main-deps-
|
||||
|
||||
- run: yarn install --frozen-lockfile --non-interactive
|
||||
shell: bash
|
||||
@@ -21,16 +21,16 @@ jobs:
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'adev: preview'))
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build adev to ensure it continues to work
|
||||
run: pnpm bazel build //adev:build --full_build_adev --config=release
|
||||
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@80db036355181684ed07021a175e9f039190d3d6
|
||||
run: yarn bazel build //adev:build --full_build_adev --config=release
|
||||
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
workflow-artifact-name: 'adev-preview'
|
||||
pull-number: '${{github.event.pull_request.number}}'
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
with:
|
||||
token: '${{secrets.GITHUB_TOKEN}}'
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
npx -y firebase-tools@latest target:clear --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs
|
||||
npx -y firebase-tools@latest target:apply --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs ${{env.PREVIEW_SITE}}
|
||||
|
||||
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@80db036355181684ed07021a175e9f039190d3d6
|
||||
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
github-token: '${{secrets.GITHUB_TOKEN}}'
|
||||
workflow-artifact-name: 'adev-preview'
|
||||
|
||||
@@ -13,9 +13,9 @@ jobs:
|
||||
assistant_to_the_branch_manager:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: angular/dev-infra/github-actions/branch-manager@80db036355181684ed07021a175e9f039190d3d6
|
||||
- uses: angular/dev-infra/github-actions/branch-manager@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
- uses: alessbell/pull-request-comment-branch@aad01d65d6982b8eacabed5e9a684cd8ceb98da6 # v1.1
|
||||
id: comment-branch
|
||||
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
# Specify repository as the PR branch might be from a fork.
|
||||
repository: ${{steps.comment-branch.outputs.head_owner}}/${{steps.comment-branch.outputs.head_repo}}
|
||||
@@ -36,9 +36,9 @@ jobs:
|
||||
# that the action was triggered by a team member.
|
||||
ref: ${{steps.comment-branch.outputs.head_ref}}
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- uses: ./.github/actions/yarn-install
|
||||
|
||||
- uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
- uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
bazelrc: ./.bazelrc.user
|
||||
|
||||
@@ -47,9 +47,9 @@ jobs:
|
||||
env:
|
||||
# Untrusted input used in an executable code, must be wrapped as an env var to prevent injections
|
||||
COMMENT_BODY: ${{ github.event.comment.body }}
|
||||
run: pnpm benchmarks prepare-for-github-action "$COMMENT_BODY"
|
||||
run: yarn benchmarks prepare-for-github-action "$COMMENT_BODY"
|
||||
|
||||
- run: pnpm benchmarks run-compare ${{steps.info.outputs.compareSha}} ${{steps.info.outputs.benchmarkTarget}}
|
||||
- run: yarn benchmarks run-compare ${{steps.info.outputs.compareSha}} ${{steps.info.outputs.benchmarkTarget}}
|
||||
id: benchmark
|
||||
name: Running benchmark
|
||||
|
||||
|
||||
+54
-60
@@ -21,120 +21,113 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Check code lint
|
||||
run: pnpm tslint
|
||||
run: yarn -s tslint
|
||||
- name: Check for circular dependencies
|
||||
run: pnpm ts-circular-deps:check
|
||||
run: yarn -s ts-circular-deps:check
|
||||
- name: Validate pull approve configuration
|
||||
run: pnpm ng-dev pullapprove verify
|
||||
run: yarn -s ng-dev pullapprove verify
|
||||
- name: Validate angular robot configuration
|
||||
run: pnpm ng-dev ngbot verify
|
||||
run: yarn -s ng-dev ngbot verify
|
||||
- name: Confirm code builds with typescript as expected
|
||||
run: pnpm check-tooling-setup
|
||||
run: yarn -s check-tooling-setup
|
||||
|
||||
devtools:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Run unit tests
|
||||
run: pnpm devtools:test
|
||||
run: yarn devtools:test
|
||||
- name: Test build
|
||||
run: pnpm devtools:build:chrome
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
|
||||
with:
|
||||
command: pnpm devtools:test:e2e
|
||||
start: pnpm bazel run //devtools/src:devserver
|
||||
wait-on: 'http://localhost:4200'
|
||||
wait-on-timeout: 300
|
||||
run: yarn devtools:build:chrome
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel Remote Caching
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile --network-timeout 100000
|
||||
- name: Run CI tests for framework
|
||||
run: pnpm test:ci
|
||||
run: yarn test:ci
|
||||
|
||||
integration-tests:
|
||||
runs-on: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel Remote Caching
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile --network-timeout 100000
|
||||
- name: Run integration CI tests for framework
|
||||
run: pnpm integration-tests:ci
|
||||
run: yarn integration-tests:ci
|
||||
|
||||
adev:
|
||||
runs-on:
|
||||
labels: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Run tests
|
||||
run: pnpm bazel test //adev/...
|
||||
run: yarn bazel test //adev/...
|
||||
- name: Build adev in fast mode to ensure it continues to work
|
||||
run: pnpm bazel build //adev:build --config=release
|
||||
run: yarn bazel build //adev:build --config=release
|
||||
|
||||
publish-snapshots:
|
||||
runs-on:
|
||||
labels: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- run: echo "https://${{secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN}}:@github.com" > ${HOME}/.git_credentials
|
||||
- run: pnpm build
|
||||
- run: yarn build
|
||||
- run: ./scripts/ci/publish-build-artifacts.sh
|
||||
|
||||
zone-js:
|
||||
@@ -142,7 +135,7 @@ jobs:
|
||||
labels: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
@@ -150,18 +143,18 @@ jobs:
|
||||
./packages/zone.js/node_modules
|
||||
./packages/zone.js/test/typings/node_modules
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- run: |
|
||||
pnpm bazel build \
|
||||
yarn bazel build \
|
||||
//packages/zone.js/bundles:zone.umd.js \
|
||||
//packages/zone.js:npm_package \
|
||||
//packages/zone.js/test/closure:closure
|
||||
//packages/zone.js/test/closure:closure_rjs
|
||||
|
||||
- run: |
|
||||
rm -Rf packages/zone.js/build
|
||||
@@ -176,14 +169,15 @@ jobs:
|
||||
cp dist/bin/packages/zone.js/test/closure/zone.closure.js ./packages/zone.js/build/test/zone.closure.mjs
|
||||
|
||||
# Install
|
||||
- run: pnpm -C packages/zone.js install --frozen-lockfile
|
||||
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
|
||||
# Run zone.js tools tests
|
||||
- run: pnpm -C packages/zone.js promisefinallytest
|
||||
- run: pnpm -C packages/zone.js jest:test
|
||||
- run: pnpm -C packages/zone.js jest:nodetest
|
||||
- run: pnpm -C packages/zone.js vitest:test
|
||||
- run: pnpm -C packages/zone.js electrontest
|
||||
- run: pnpm -C packages/zone.js/test/typings test
|
||||
- run: yarn --cwd packages/zone.js promisefinallytest
|
||||
- run: yarn --cwd packages/zone.js jest:test
|
||||
- run: yarn --cwd packages/zone.js jest:nodetest
|
||||
- run: yarn --cwd packages/zone.js vitest:test
|
||||
- run: yarn --cwd packages/zone.js electrontest
|
||||
- run: yarn --cwd packages/zone.js/test/typings install --frozen-lockfile --non-interactive
|
||||
- run: yarn --cwd packages/zone.js/test/typings test
|
||||
|
||||
# saucelabs:
|
||||
# runs-on: ubuntu-latest-4core
|
||||
@@ -195,7 +189,7 @@ jobs:
|
||||
# with:
|
||||
# cache-node-modules: true
|
||||
# - name: Install node modules
|
||||
# run: pnpm install --frozen-lockfile
|
||||
# run: yarn install --frozen-lockfile
|
||||
# - uses: ./.github/actions/saucelabs-legacy
|
||||
|
||||
adev-deploy:
|
||||
@@ -204,15 +198,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build adev to ensure it continues to work
|
||||
run: pnpm bazel build //adev:build --full_build_adev --config=release
|
||||
run: yarn bazel build //adev:build --full_build_adev --config=release
|
||||
- name: Deploy to firebase
|
||||
uses: ./.github/actions/deploy-docs-site
|
||||
with:
|
||||
|
||||
@@ -12,14 +12,14 @@ jobs:
|
||||
labels:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: angular/dev-infra/github-actions/pull-request-labeling@80db036355181684ed07021a175e9f039190d3d6
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: angular/dev-infra/github-actions/pull-request-labeling@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
post_approval_changes:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: angular/dev-infra/github-actions/post-approval-changes@80db036355181684ed07021a175e9f039190d3d6
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: angular/dev-infra/github-actions/post-approval-changes@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
|
||||
@@ -13,8 +13,8 @@ jobs:
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- uses: angular/dev-infra/github-actions/google-internal-tests@80db036355181684ed07021a175e9f039190d3d6
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: angular/dev-infra/github-actions/google-internal-tests@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
run-tests-guide-url: http://go/angular-g3sync-start
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -13,22 +13,22 @@ jobs:
|
||||
JOBS: 2
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel Remote Caching
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Saucelabs Variables
|
||||
uses: angular/dev-infra/github-actions/saucelabs@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/saucelabs@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Set up Sauce Tunnel Daemon
|
||||
run: pnpm bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
|
||||
run: yarn bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
|
||||
env:
|
||||
SAUCE_TUNNEL_IDENTIFIER: angular-framework-${{ github.run_number }}
|
||||
- name: Run all saucelabs bazel tests
|
||||
run: |
|
||||
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "fixme-saucelabs", ...)')
|
||||
pnpm bazel test --config=saucelabs --jobs=$JOBS ${TESTS}
|
||||
yarn bazel test --config=saucelabs --jobs=$JOBS ${TESTS}
|
||||
|
||||
@@ -9,6 +9,6 @@ jobs:
|
||||
status:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: angular/dev-infra/github-actions/unified-status-check@80db036355181684ed07021a175e9f039190d3d6
|
||||
- uses: angular/dev-infra/github-actions/unified-status-check@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
|
||||
@@ -21,11 +21,11 @@ jobs:
|
||||
workflows: ${{ steps.workflows.outputs.workflows }}
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn -s install --frozen-lockfile
|
||||
- id: workflows
|
||||
run: echo "workflows=$(pnpm --silent ng-dev perf workflows --list)" >> "$GITHUB_OUTPUT"
|
||||
run: echo "workflows=$(yarn -s ng-dev perf workflows --list)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
workflow:
|
||||
timeout-minutes: 30
|
||||
@@ -36,11 +36,11 @@ jobs:
|
||||
workflow: ${{ fromJSON(needs.list.outputs.workflows) }}
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn -s install --frozen-lockfile
|
||||
# We utilize the google-github-actions/auth action to allow us to get an active credential using workflow
|
||||
# identity federation. This allows us to request short lived credentials on demand, rather than storing
|
||||
# credentials in secrets long term. More information can be found at:
|
||||
@@ -50,4 +50,4 @@ jobs:
|
||||
project_id: 'internal-200822'
|
||||
workload_identity_provider: 'projects/823469418460/locations/global/workloadIdentityPools/measurables-tracking/providers/angular'
|
||||
service_account: 'measures-uploader@internal-200822.iam.gserviceaccount.com'
|
||||
- run: pnpm ng-dev perf workflows --name ${{ matrix.workflow }} --commit-sha ${{github.sha}}
|
||||
- run: yarn ng-dev perf workflows --name ${{ matrix.workflow }} --commit-sha ${{github.sha}}
|
||||
|
||||
+48
-54
@@ -19,27 +19,27 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Check code lint
|
||||
run: pnpm tslint
|
||||
run: yarn -s tslint
|
||||
- name: Check for circular dependencies
|
||||
run: pnpm ts-circular-deps:check
|
||||
run: yarn -s ts-circular-deps:check
|
||||
- name: Validate pull approve configuration
|
||||
run: pnpm ng-dev pullapprove verify
|
||||
run: yarn -s ng-dev pullapprove verify
|
||||
- name: Validate angular robot configuration
|
||||
run: pnpm ng-dev ngbot verify
|
||||
run: yarn -s ng-dev ngbot verify
|
||||
- name: Confirm code builds with typescript as expected
|
||||
run: pnpm check-tooling-setup
|
||||
run: yarn -s check-tooling-setup
|
||||
- name: Check commit message
|
||||
run: pnpm ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
|
||||
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
|
||||
- name: Check code format
|
||||
run: pnpm ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
|
||||
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
|
||||
- name: Check Package Licenses
|
||||
uses: angular/dev-infra/github-actions/linting/licenses@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/linting/licenses@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
allow-dependencies-licenses: 'pkg:npm/google-protobuf@'
|
||||
|
||||
@@ -47,45 +47,38 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Run unit tests
|
||||
run: pnpm devtools:test
|
||||
run: yarn devtools:test
|
||||
- name: Test build
|
||||
run: pnpm devtools:build:chrome
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
|
||||
with:
|
||||
command: pnpm devtools:test:e2e
|
||||
start: pnpm bazel run //devtools/src:devserver
|
||||
wait-on: 'http://localhost:4200'
|
||||
wait-on-timeout: 300
|
||||
run: yarn devtools:build:chrome
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest-8core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel Remote Caching
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile --network-timeout 100000
|
||||
- name: Run CI tests for framework
|
||||
run: pnpm test:ci
|
||||
run: yarn test:ci
|
||||
env:
|
||||
# Ensures Aspect lock files are up-to-date.
|
||||
# TODO(devversion): Remove when removing pnpm.
|
||||
# TODO(devversion): Remove when removing yarn.
|
||||
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'
|
||||
- name: Upload GRPC logs (for debugging of RBE issues)
|
||||
if: always()
|
||||
@@ -98,41 +91,41 @@ jobs:
|
||||
runs-on: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel Remote Caching
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile --network-timeout 100000
|
||||
- name: Run integration CI tests for framework
|
||||
run: pnpm integration-tests:ci
|
||||
run: yarn integration-tests:ci
|
||||
|
||||
adev:
|
||||
runs-on:
|
||||
labels: ubuntu-latest-8core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Run tests
|
||||
run: pnpm bazel test //adev/...
|
||||
run: yarn bazel test //adev/...
|
||||
- name: Build adev in fast mode to ensure it continues to work
|
||||
run: pnpm bazel build //adev:build --config=release
|
||||
run: yarn bazel build //adev:build --config=release
|
||||
|
||||
zone-js:
|
||||
runs-on:
|
||||
labels: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
@@ -140,16 +133,16 @@ jobs:
|
||||
./packages/zone.js/node_modules
|
||||
./packages/zone.js/test/typings/node_modules
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
|
||||
- name: Install node modules
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: yarn install --frozen-lockfile
|
||||
- run: |
|
||||
pnpm bazel build \
|
||||
yarn bazel build \
|
||||
//packages/zone.js/bundles:zone.umd.js \
|
||||
//packages/zone.js:npm_package \
|
||||
//packages/zone.js/test/closure:closure
|
||||
//packages/zone.js/test/closure:closure_rjs
|
||||
|
||||
- run: |
|
||||
rm -Rf packages/zone.js/build
|
||||
@@ -164,14 +157,15 @@ jobs:
|
||||
cp dist/bin/packages/zone.js/test/closure/zone.closure.js ./packages/zone.js/build/test/zone.closure.mjs
|
||||
|
||||
# Install
|
||||
- run: pnpm -C packages/zone.js install --frozen-lockfile
|
||||
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
|
||||
# Run zone.js tools tests
|
||||
- run: pnpm -C packages/zone.js promisefinallytest
|
||||
- run: pnpm -C packages/zone.js jest:test
|
||||
- run: pnpm -C packages/zone.js jest:nodetest
|
||||
- run: pnpm -C packages/zone.js vitest:test
|
||||
- run: pnpm -C packages/zone.js electrontest
|
||||
- run: pnpm -C packages/zone.js/test/typings test
|
||||
- run: yarn --cwd packages/zone.js promisefinallytest
|
||||
- run: yarn --cwd packages/zone.js jest:test
|
||||
- run: yarn --cwd packages/zone.js jest:nodetest
|
||||
- run: yarn --cwd packages/zone.js vitest:test
|
||||
- run: yarn --cwd packages/zone.js electrontest
|
||||
- run: yarn --cwd packages/zone.js/test/typings install --frozen-lockfile --non-interactive
|
||||
- run: yarn --cwd packages/zone.js/test/typings test
|
||||
|
||||
# saucelabs:
|
||||
# runs-on: ubuntu-latest-4core
|
||||
@@ -183,5 +177,5 @@ jobs:
|
||||
# with:
|
||||
# cache-node-modules: true
|
||||
# - name: Install node modules
|
||||
# run: pnpm install --frozen-lockfile
|
||||
# run: yarn install --frozen-lockfile
|
||||
# - uses: ./.github/actions/saucelabs-legacy
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -47,6 +47,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: 'Upload to code-scanning'
|
||||
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
|
||||
uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
# Setting `persist-credentials: false` prevents the github-action account from being the
|
||||
# account that is attempted to be used for authentication, instead the remote is set to
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
set +e
|
||||
|
||||
pnpm --silent ng-dev commit-message pre-commit-validate --file $1 2>/dev/null
|
||||
yarn -s ng-dev commit-message pre-commit-validate --file $1 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: failed to run commit message validation (ng-dev commit-mesage pre-commit-validate)"
|
||||
fi
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
set +e
|
||||
|
||||
pnpm --silent ng-dev format staged 2>/dev/null
|
||||
yarn -s ng-dev format staged 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: failed to run file formatting (ng-dev format staged)"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
set +e
|
||||
|
||||
pnpm --silent ng-dev commit-message restore-commit-message-draft $1 $2 2>/dev/null
|
||||
yarn -s ng-dev commit-message restore-commit-message-draft $1 $2 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: failed to attempt to restore commit message draft (ng-dev commit-message restore-commit-message-draft)"
|
||||
fi
|
||||
|
||||
+27
-28
@@ -1,23 +1,25 @@
|
||||
// TODO: Define these packages in a single common location.
|
||||
const localAngularPackages = [
|
||||
'@angular/animations',
|
||||
'@angular/common',
|
||||
'@angular/compiler',
|
||||
'@angular/compiler-cli',
|
||||
'@angular/core',
|
||||
'@angular/elements',
|
||||
'@angular/forms',
|
||||
'@angular/language-service',
|
||||
'@angular/localize',
|
||||
'@angular/platform-browser',
|
||||
'@angular/platform-browser-dynamic',
|
||||
'@angular/platform-server',
|
||||
'@angular/router',
|
||||
'@angular/service-worker',
|
||||
'@angular/upgrade',
|
||||
];
|
||||
|
||||
function readPackage(pkg, context) {
|
||||
// TODO(devversion): This exists temporarily during migration as we can't have `workspace:*` deps
|
||||
// in the `package.json` also processed by Yarn
|
||||
if (pkg.name === 'angular-srcs') {
|
||||
pkg.dependencies = {
|
||||
...pkg.dependencies,
|
||||
// These dependencies are added to the workspace root so that peer dependencies
|
||||
// are resolved via these locally-built versions. e.g. compiler-cli's peer deps.
|
||||
'@angular/compiler': 'workspace:*',
|
||||
'@angular/compiler-cli': 'workspace:*',
|
||||
'@angular/core': 'workspace:*',
|
||||
'@angular/common': 'workspace:*',
|
||||
'@angular/router': 'workspace:*',
|
||||
'@angular/platform-browser': 'workspace:*',
|
||||
'@angular/platform-browser-dynamic': 'workspace:*',
|
||||
'@angular/platform-server': 'workspace:*',
|
||||
'@angular/forms': 'workspace:*',
|
||||
'@angular/elements': 'workspace:*',
|
||||
'@angular/animations': 'workspace:*',
|
||||
};
|
||||
}
|
||||
|
||||
// TODO(devversion): This allows us to make compiler/TS a production dependency of compiler-cli
|
||||
// because `rules_js` doesn't otherwise include the dependency in the `npm_package_store`.
|
||||
// See: https://github.com/aspect-build/rules_js/issues/2226
|
||||
@@ -25,29 +27,26 @@ function readPackage(pkg, context) {
|
||||
pkg.dependencies = {
|
||||
...pkg.dependencies,
|
||||
'@angular/compiler': 'workspace:*',
|
||||
'typescript': '5.9.0-beta',
|
||||
'typescript': '5.8.3',
|
||||
};
|
||||
}
|
||||
|
||||
Object.entries(pkg.peerDependencies).forEach(([key, version]) => {
|
||||
// Any package that has a peerDependency on rxjs or zone.js, should instead treat the peerDependency as a
|
||||
// Any package that has a peerDependency on rxjs, should instead treat the peerDependency as a
|
||||
// regular dependency.
|
||||
if (['rxjs', 'zone.js'].includes(key)) {
|
||||
if (key === 'rxjs') {
|
||||
pkg.dependencies = {
|
||||
...pkg.dependencies,
|
||||
[key]: version,
|
||||
'rxjs': version,
|
||||
};
|
||||
}
|
||||
|
||||
// Change all locally generated packages to directly depend on the other local packages, instead
|
||||
// of expecting them as peerDependencies automatically as we do not auto install peer deps. The
|
||||
// package is also removed from peerDependencies as it was moved over and will just cause errors.
|
||||
if (localAngularPackages.includes(key)) {
|
||||
// of expecting them as peerDependencies automatically as we do not auto install peer deps.
|
||||
if (version === '0.0.0-PLACEHOLDER') {
|
||||
pkg.dependencies = {
|
||||
...pkg.dependencies,
|
||||
[key]: 'workspace: *',
|
||||
};
|
||||
delete pkg.peerDependencies[key];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+6
-5
@@ -56,8 +56,8 @@
|
||||
|
||||
version: 3
|
||||
|
||||
availability:
|
||||
users_unavailable: ['devversion']
|
||||
# availability:
|
||||
# users_unavailable: ['atscott']
|
||||
|
||||
# Meta field that goes unused by PullApprove to allow for defining aliases to be
|
||||
# used throughout the config.
|
||||
@@ -177,7 +177,6 @@ groups:
|
||||
- thePunderWoman
|
||||
- ~pkozlowski-opensource
|
||||
- mmalerba
|
||||
- JeanMeche
|
||||
|
||||
# =========================================================
|
||||
# Framework: Security-sensitive files which require extra review
|
||||
@@ -274,7 +273,7 @@ groups:
|
||||
- bencodezen
|
||||
- crisbeto
|
||||
- kirjs
|
||||
- JeanMeche
|
||||
- ~JeanMeche
|
||||
- jelbourn
|
||||
- thePunderWoman
|
||||
- devversion
|
||||
@@ -333,11 +332,13 @@ groups:
|
||||
'packages/examples/{*,.*}',
|
||||
'scripts/**/{*,.*}',
|
||||
'third_party/**/{*,.*}',
|
||||
'tools/bazel-repo-patches/**/{*,.*}',
|
||||
'tools/contributing-stats/**/{*,.*}',
|
||||
'tools/esm-interop/**/{*,.*}',
|
||||
'tools/gulp-tasks/**/{*,.*}',
|
||||
'tools/legacy-saucelabs/**/{*,.*}',
|
||||
'tools/manual_api_docs/**/{*,.*}',
|
||||
'tools/pnpm-patches/**/{*,.*}',
|
||||
'tools/npm-patches/**/{*,.*}',
|
||||
'tools/rxjs/**/{*,.*}',
|
||||
'tools/saucelabs-daemon/**/{*,.*}',
|
||||
'tools/saucelabs/**/{*,.*}',
|
||||
|
||||
+4
-3
@@ -1,7 +1,8 @@
|
||||
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
|
||||
load("@aspect_rules_js//js:defs.bzl", "js_library")
|
||||
load("@npm//:defs.bzl", "npm_link_all_packages")
|
||||
load("@npm2//:defs.bzl", "npm_link_all_packages")
|
||||
load("//:yarn.bzl", "YARN_PATH")
|
||||
load("//tools:defaults.bzl", "copy_to_bin", "js_binary")
|
||||
load("//tools:defaults.bzl", "nodejs_binary")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
@@ -60,7 +61,7 @@ config_setting(
|
||||
values = {"stamp": "true"},
|
||||
)
|
||||
|
||||
js_binary(
|
||||
nodejs_binary(
|
||||
name = "yarn_vendored",
|
||||
data = [".yarn/releases/yarn-1.22.22.cjs"],
|
||||
entry_point = ".yarn/releases/yarn-1.22.22.cjs",
|
||||
|
||||
-196
@@ -1,199 +1,3 @@
|
||||
<a name="20.2.1"></a>
|
||||
# 20.2.1 (2025-08-21)
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [a28672fb70](https://github.com/angular/angular/commit/a28672fb7017cc62e42829c5910c3b39373d7913) | fix | Keep paraenthesis in Nullish + Boolean expression. ([#63292](https://github.com/angular/angular/pull/63292)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="21.0.0-next.0"></a>
|
||||
# 21.0.0-next.0 (2025-08-20)
|
||||
## Breaking Changes
|
||||
### compiler-cli
|
||||
- The Angular compiler now produces an error when the
|
||||
the `emitDeclarationOnly` TS compiler option is enabled as this mode is
|
||||
not supported.
|
||||
### router
|
||||
- `lastSuccessfulNavigation` is now a signal and needs to be invoked
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [be7110342b](https://github.com/angular/angular/commit/be7110342b61d837822524d4f60f56a7f859f594) | fix | disallow compiling with the `emitDeclarationOnly` TS compiler option enabled ([#61609](https://github.com/angular/angular/pull/61609)) |
|
||||
### http
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [4bed062bc9](https://github.com/angular/angular/commit/4bed062bc9f2a0a66c9af3cb8aeb42ee023c6393) | feat | Provide http services in root ([#56212](https://github.com/angular/angular/pull/56212)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [4e0fc81491](https://github.com/angular/angular/commit/4e0fc81491bfe6e4eac5c59ef0bde908a3d58413) | feat | convert `lastSuccessfulNavigation` to signal ([#63057](https://github.com/angular/angular/pull/63057)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="20.2.0"></a>
|
||||
# 20.2.0 (2025-08-20)
|
||||
## Deprecations
|
||||
### animations
|
||||
- @angular/animations
|
||||
### core
|
||||
- @angular/animations
|
||||
### router
|
||||
- The Router.getCurrentNavigation method is deprecated. Use the Router.currentNavigation signal instead.
|
||||
- The Router.getCurrentNavigation method is deprecated. Use the Router.currentNavigation signal instead.
|
||||
### animations
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [9766116cea](https://github.com/angular/angular/commit/9766116cea69607d80144251a599f1cc1b12e02c) | refactor | deprecate the animations package ([#62795](https://github.com/angular/angular/pull/62795)) |
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [7767aa640c](https://github.com/angular/angular/commit/7767aa640c542f5058df9322f2bbe974fa8d3c81) | fix | allow more characters in square-bracketed attribute names ([#62742](https://github.com/angular/angular/pull/62742)) |
|
||||
| [7b51728813](https://github.com/angular/angular/commit/7b517288139aec166e5e5b60e84b1e22e3d6b70f) | fix | fixes animation event host bindings not firing ([#63217](https://github.com/angular/angular/pull/63217)) |
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [5abfe4a899](https://github.com/angular/angular/commit/5abfe4a8999e42ad44e6f1d4414f241094bb8fdb) | feat | add diagnostic for uninvoked functions in text interpolation ([#59191](https://github.com/angular/angular/pull/59191)) |
|
||||
| [c4917074f1](https://github.com/angular/angular/commit/c4917074f1e278ea24948a8810b3d4f306765174) | fix | display proper function in NG8117 message ([#62842](https://github.com/angular/angular/pull/62842)) |
|
||||
| [812463c563](https://github.com/angular/angular/commit/812463c5636effe5bd5ba5c7c7fc65c3cc08d047) | fix | Ignore diagnostics on ngTemplateContextGuard lines in TCB ([#63054](https://github.com/angular/angular/pull/63054)) |
|
||||
| [45b030b5ce](https://github.com/angular/angular/commit/45b030b5ce1e116a88fe1c2fe133f654fb1f66c5) | fix | prevent dom event assertion in TCB generation on older angular versions ([#63053](https://github.com/angular/angular/pull/63053)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [6b1f4b9e8b](https://github.com/angular/angular/commit/6b1f4b9e8bb981377e271e6af0d9768ff7f765e9) | feat | add enter and leave animation instructions ([#62682](https://github.com/angular/angular/pull/62682)) |
|
||||
| [cec91c0035](https://github.com/angular/angular/commit/cec91c00356ee3974c39c9471b243a2a16149f5b) | feat | add option to infer the tag names of components in tests ([#62283](https://github.com/angular/angular/pull/62283)) |
|
||||
| [141bb75ff2](https://github.com/angular/angular/commit/141bb75ff241425a93ce5b60b56a4247e67d7648) | feat | Promote zoneless to stable ([#62699](https://github.com/angular/angular/pull/62699)) |
|
||||
| [4138aca91f](https://github.com/angular/angular/commit/4138aca91fe828f0cfbd779d0c456cdea7703bdc) | feat | render ARIA property bindings as attributes ([#62630](https://github.com/angular/angular/pull/62630)) |
|
||||
| [a409534d6c](https://github.com/angular/angular/commit/a409534d6c3d7cb4472afffd6b17df8c25e34106) | feat | support `as` aliases on `else if` blocks ([#63047](https://github.com/angular/angular/pull/63047)) |
|
||||
| [745ea44394](https://github.com/angular/angular/commit/745ea4439465494ab5b7002dd1fa320cd32220fb) | feat | support TypeScript 5.9 ([#62541](https://github.com/angular/angular/pull/62541)) |
|
||||
| [593cc8a368](https://github.com/angular/angular/commit/593cc8a3684dfb163bfffa265c5efb3bc7efacd1) | fix | checks if body exists before continuing ([#62768](https://github.com/angular/angular/pull/62768)) |
|
||||
| [bdc31675b7](https://github.com/angular/angular/commit/bdc31675b7e5f37d2b312c766fe4963305620bdf) | fix | ensure animate events do not have duplicate elements ([#63216](https://github.com/angular/angular/pull/63216)) |
|
||||
| [de3a0c5cf3](https://github.com/angular/angular/commit/de3a0c5cf3f87782fa63d30edf6ac05eb6be9fac) | fix | Fix `animate.enter` class removal when composing classes ([#62981](https://github.com/angular/angular/pull/62981)) |
|
||||
| [6597ac0af7](https://github.com/angular/angular/commit/6597ac0af78ac2224ec2f9a37283b53aee11abe1) | fix | fix support for space separated strings in leave animations ([#62979](https://github.com/angular/angular/pull/62979)) |
|
||||
| [ebd622b344](https://github.com/angular/angular/commit/ebd622b3449789b72efc8295244ca924a299e7c1) | fix | fixes empty animations when recalculating styles ([#63007](https://github.com/angular/angular/pull/63007)) |
|
||||
| [455b147488](https://github.com/angular/angular/commit/455b147488dc0a064c0ca13a96a4df3c3ed01152) | fix | fixes timing issues with enter animations ([#62925](https://github.com/angular/angular/pull/62925)) |
|
||||
| [f9d73cc687](https://github.com/angular/angular/commit/f9d73cc6877d516da4ab4704c21bb19164123fa1) | fix | handle cases where classes added have no animations ([#63242](https://github.com/angular/angular/pull/63242)) |
|
||||
| [6a1184600c](https://github.com/angular/angular/commit/6a1184600ce0fc7a3f338d6766612e9510ef5518) | fix | prevents duplicate nodes when `@if` toggles with leave animations ([#63048](https://github.com/angular/angular/pull/63048)) |
|
||||
| [063b5e166f](https://github.com/angular/angular/commit/063b5e166f66bce1abd06c258242212009e76cca) | fix | switch check to documentElement with chaining ([#62773](https://github.com/angular/angular/pull/62773)) |
|
||||
| [320de4e96d](https://github.com/angular/angular/commit/320de4e96d250cad1ce2c9f8c0fa2022da53b734) | refactor | deprecate animations field on component interface ([#62895](https://github.com/angular/angular/pull/62895)) |
|
||||
### forms
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [c353497a01](https://github.com/angular/angular/commit/c353497a01776cd702af6c5136fdae5fc6ce94d5) | feat | add support for pushing an array of controls to formarray ([#57102](https://github.com/angular/angular/pull/57102)) |
|
||||
### http
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [0984b30388](https://github.com/angular/angular/commit/0984b30388ef51dfad66f1228f665b89b73ef3fb) | feat | Add redirected property to HttpResponse and HttpErrorResponse ([#62675](https://github.com/angular/angular/pull/62675)) |
|
||||
| [be811fee79](https://github.com/angular/angular/commit/be811fee7925fb482567fa7cd9d485ac28acdade) | feat | add referrer & integrity support for fetch requests in httpResource ([#62461](https://github.com/angular/angular/pull/62461)) |
|
||||
| [1cf9d9064c](https://github.com/angular/angular/commit/1cf9d9064c15c00071ece3b78c8019035a6db6ce) | feat | Add support for fetch referrer & integrity options in HttpClient ([#62417](https://github.com/angular/angular/pull/62417)) |
|
||||
| [1408baff45](https://github.com/angular/angular/commit/1408baff453e636da05838fa17c6e4abd86c4b72) | fix | Add missing timeout and transferCache options to `HttpClient` ([#62586](https://github.com/angular/angular/pull/62586)) |
|
||||
### language-service
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [c81e345e72](https://github.com/angular/angular/commit/c81e345e726b5b281621159c789e6d80a9f328e2) | feat | support auto-import for attribute completions ([#62797](https://github.com/angular/angular/pull/62797)) |
|
||||
| [d64dd27a02](https://github.com/angular/angular/commit/d64dd27a02630b631bc9890d7292d4683493cb65) | feat | support to report the deprecated API in the template ([#62054](https://github.com/angular/angular/pull/62054)) |
|
||||
| [591c7e2ec8](https://github.com/angular/angular/commit/591c7e2ec82c6669ffa6e0011b8a0a4fc12e9c3a) | fix | Support to resolve the re-export component. ([#62585](https://github.com/angular/angular/pull/62585)) |
|
||||
### platform-browser
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [52b8e07d6e](https://github.com/angular/angular/commit/52b8e07d6e568a527fae18a8a867dacdf8053e20) | feat | Warns on conflicting hydration and blocking navigation ([#62963](https://github.com/angular/angular/pull/62963)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [d00b3fed58](https://github.com/angular/angular/commit/d00b3fed58496369d9f3a1ac0d74416a586be78b) | feat | add a `currentNavigation` signal to the `Router` service. ([#62971](https://github.com/angular/angular/pull/62971)) |
|
||||
| [687c374826](https://github.com/angular/angular/commit/687c374826c5e9ea91839c20f0df815ce085c583) | feat | add a currentNavigation signal to the Router service. ([#63011](https://github.com/angular/angular/pull/63011)) |
|
||||
| [9c45c322d1](https://github.com/angular/angular/commit/9c45c322d1ac3b05c916b7c956263066fb9be47f) | fix | ensure preloaded components are properly activated ([#62502](https://github.com/angular/angular/pull/62502)) |
|
||||
### service-worker
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [8255e0cf15](https://github.com/angular/angular/commit/8255e0cf15353e9eee339ae01851e32c0e5e174d) | feat | add messageerror event handling and logging ([#62834](https://github.com/angular/angular/pull/62834)) |
|
||||
| [5220b51e75](https://github.com/angular/angular/commit/5220b51e75e672ff41c90f4798289961973df8e0) | feat | Adds for type in provideServiceWorker ([#62831](https://github.com/angular/angular/pull/62831)) |
|
||||
| [4ac6171b09](https://github.com/angular/angular/commit/4ac6171b09e449c619e0588c366861f8f3bb59be) | feat | Adds support for updateViaCache in provideServiceWorker ([#62721](https://github.com/angular/angular/pull/62721)) |
|
||||
| [b65c3d5e19](https://github.com/angular/angular/commit/b65c3d5e195267dd90b2826d4615ced1328b1709) | feat | Improves storage full detection in data caching ([#62737](https://github.com/angular/angular/pull/62737)) |
|
||||
| [3b214d2040](https://github.com/angular/angular/commit/3b214d20403160ab73e65dca0352545efd577c31) | feat | Logs unhandled promise rejections in service worker ([#63059](https://github.com/angular/angular/pull/63059)) |
|
||||
| [6d011687ec](https://github.com/angular/angular/commit/6d011687ec1fa2b8f0211379bb98adc8e02f4e9a) | feat | notify clients about version failures ([#62718](https://github.com/angular/angular/pull/62718)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="20.1.8"></a>
|
||||
# 20.1.8 (2025-08-20)
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [691f5ed033](https://github.com/angular/angular/commit/691f5ed0332d813801f599448577a2c1d450a5ad) | fix | error when ng-content fallback has translated children ([#63156](https://github.com/angular/angular/pull/63156)) |
|
||||
| [b1dec9bc50](https://github.com/angular/angular/commit/b1dec9bc50f5694cfa1e3629fd48543126debd10) | fix | incorrect source span for expression AST inside template attribute ([#63175](https://github.com/angular/angular/pull/63175)) |
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [cda402f1d8](https://github.com/angular/angular/commit/cda402f1d8bddeedc9aca1979a9bf01be32f81b2) | fix | account for expression with type arguments during HMR extraction ([#63261](https://github.com/angular/angular/pull/63261)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="20.1.7"></a>
|
||||
# 20.1.7 (2025-08-13)
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [d9e37908a5](https://github.com/angular/angular/commit/d9e37908a5f42a4226fd6e2d3493abf35ee5a99a) | fix | incorrect spans for AST inside input value with leading space ([#63082](https://github.com/angular/angular/pull/63082)) |
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [4aa120ac00](https://github.com/angular/angular/commit/4aa120ac000a569a29e45e9c6db9e4f32c61d183) | fix | error when type checking host bindings of generic directive ([#63061](https://github.com/angular/angular/pull/63061)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [322042c5b3](https://github.com/angular/angular/commit/322042c5b30e181019bfdaa6a57fc5abaea7adc1) | fix | destroying the effect on `afterRenderEffect` ([#63001](https://github.com/angular/angular/pull/63001)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [5fd79424e3](https://github.com/angular/angular/commit/5fd79424e34ea4bbbfca68bf80ca5541aece829f) | fix | attempt to resolve component resources in JIT mode ([#63062](https://github.com/angular/angular/pull/63062)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="20.1.6"></a>
|
||||
# 20.1.6 (2025-08-06)
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="20.1.5"></a>
|
||||
# 20.1.5 (2025-08-06)
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [3b2e8efcac](https://github.com/angular/angular/commit/3b2e8efcacc5b413b03e4281fc8af297e5c81a9f) | fix | correctly type check host listeners to own outputs ([#62965](https://github.com/angular/angular/pull/62965)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [c9f3976eba](https://github.com/angular/angular/commit/c9f3976eba66d113f4a1919ee91b8833d679733a) | fix | properly recognize failed `fetch` responses when loading external resources in JIT ([#62992](https://github.com/angular/angular/pull/62992)) |
|
||||
### http
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [ae443f8eb0](https://github.com/angular/angular/commit/ae443f8eb00c047bb88527f2311e86df3bc6be35) | fix | Reset headers, progress, and statusCode when using `set()` in `HttpResource` ([#62873](https://github.com/angular/angular/pull/62873)) |
|
||||
### migrations
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [7a5851e4b0](https://github.com/angular/angular/commit/7a5851e4b0a17da35db7fb276a3dca4909f9137b) | fix | incorrect filtering in inject migration ([#62913](https://github.com/angular/angular/pull/62913)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="20.1.4"></a>
|
||||
# 20.1.4 (2025-07-31)
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [db3c5826ee](https://github.com/angular/angular/commit/db3c5826ee0b52e5b7886087b82990340a34c1ab) | fix | exclude more safe reads expression from 2way-binding ([#62852](https://github.com/angular/angular/pull/62852)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [c633b63e56](https://github.com/angular/angular/commit/c633b63e561d7142dd9a1f8631813cc47a169058) | fix | update symbols for new signals api ([#62284](https://github.com/angular/angular/pull/62284)) |
|
||||
### http
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [ab6033979a](https://github.com/angular/angular/commit/ab6033979a3b409738d55d0c01effb378473c05a) | fix | add missing http options allowed in fetch API ([#62881](https://github.com/angular/angular/pull/62881)) |
|
||||
| [15670d8417](https://github.com/angular/angular/commit/15670d8417449c5b5f2990209552a1fc61420acb) | fix | propagate plain errors when parsing fails ([#62765](https://github.com/angular/angular/pull/62765)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="20.1.3"></a>
|
||||
# 20.1.3 (2025-07-23)
|
||||
### core
|
||||
|
||||
-163
@@ -1,163 +0,0 @@
|
||||
"""Rules/toolchains for angular with Bazel."""
|
||||
|
||||
module(
|
||||
name = "angular",
|
||||
)
|
||||
|
||||
bazel_dep(name = "rules_pkg", version = "1.1.0")
|
||||
bazel_dep(name = "rules_nodejs", version = "6.5.0")
|
||||
bazel_dep(name = "aspect_rules_ts", version = "3.7.0")
|
||||
bazel_dep(name = "aspect_rules_js", version = "2.5.0")
|
||||
bazel_dep(name = "aspect_rules_esbuild", version = "0.22.1")
|
||||
bazel_dep(name = "aspect_rules_jasmine", version = "2.0.0")
|
||||
bazel_dep(name = "aspect_rules_rollup", version = "2.0.1")
|
||||
bazel_dep(name = "bazel_skylib", version = "1.8.1")
|
||||
bazel_dep(name = "aspect_bazel_lib", version = "2.21.1")
|
||||
bazel_dep(name = "tar.bzl", version = "0.5.5")
|
||||
bazel_dep(name = "yq.bzl", version = "0.2.0")
|
||||
bazel_dep(name = "rules_angular")
|
||||
git_override(
|
||||
module_name = "rules_angular",
|
||||
commit = "17eac47ea99057f7473a7d93292e76327c894ed9",
|
||||
remote = "https://github.com/devversion/rules_angular.git",
|
||||
)
|
||||
|
||||
bazel_dep(name = "devinfra")
|
||||
git_override(
|
||||
module_name = "devinfra",
|
||||
commit = "00a4cf14cdc374867673a52ecb556f356da8bec0",
|
||||
remote = "https://github.com/angular/dev-infra.git",
|
||||
)
|
||||
|
||||
bazel_dep(name = "rules_sass")
|
||||
git_override(
|
||||
module_name = "rules_sass",
|
||||
commit = "76078d5e9776a0080dcee496e90b88d8a6179c19",
|
||||
remote = "https://github.com/devversion/rules_sass.git",
|
||||
)
|
||||
|
||||
bazel_dep(name = "rules_browsers")
|
||||
git_override(
|
||||
module_name = "rules_browsers",
|
||||
commit = "8ee9ae3216ef26516c8ef20537c89857343cdc3a",
|
||||
remote = "https://github.com/devversion/rules_browsers.git",
|
||||
)
|
||||
|
||||
yq = use_extension("@yq.bzl//yq:extensions.bzl", "yq")
|
||||
use_repo(yq, "yq_toolchains")
|
||||
|
||||
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
|
||||
node.toolchain(node_version = "20.19.0")
|
||||
use_repo(node, "nodejs_toolchains")
|
||||
use_repo(node, "nodejs_darwin_amd64")
|
||||
use_repo(node, "nodejs_darwin_arm64")
|
||||
use_repo(node, "nodejs_linux_amd64")
|
||||
use_repo(node, "nodejs_linux_arm64")
|
||||
use_repo(node, "nodejs_linux_ppc64le")
|
||||
use_repo(node, "nodejs_linux_s390x")
|
||||
use_repo(node, "nodejs_windows_amd64")
|
||||
|
||||
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
|
||||
use_repo(pnpm, "pnpm")
|
||||
|
||||
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
|
||||
npm.npm_translate_lock(
|
||||
name = "npm",
|
||||
data = [
|
||||
"//:.pnpmfile.cjs",
|
||||
"//:package.json",
|
||||
"//:pnpm-workspace.yaml",
|
||||
"//:tools/pnpm-patches/dagre-d3-es+7.0.11.patch",
|
||||
"//adev:package.json",
|
||||
"//adev/shared-docs:package.json",
|
||||
"//adev/shared-docs/pipeline/api-gen:package.json",
|
||||
"//integration:package.json",
|
||||
"//modules:package.json",
|
||||
"//packages/animations:package.json",
|
||||
"//packages/benchpress:package.json",
|
||||
"//packages/common:package.json",
|
||||
"//packages/compiler:package.json",
|
||||
"//packages/compiler-cli:package.json",
|
||||
"//packages/compiler-cli/linker/babel/test:package.json",
|
||||
"//packages/core:package.json",
|
||||
"//packages/core/test/bundling:package.json",
|
||||
"//packages/elements:package.json",
|
||||
"//packages/forms:package.json",
|
||||
"//packages/language-service:package.json",
|
||||
"//packages/localize:package.json",
|
||||
"//packages/platform-browser:package.json",
|
||||
"//packages/platform-browser-dynamic:package.json",
|
||||
"//packages/platform-server:package.json",
|
||||
"//packages/router:package.json",
|
||||
"//packages/service-worker:package.json",
|
||||
"//packages/upgrade:package.json",
|
||||
"//tools/bazel/rules_angular_store:package.json",
|
||||
],
|
||||
npmrc = "//:.npmrc",
|
||||
pnpm_lock = "//:pnpm-lock.yaml",
|
||||
verify_node_modules_ignored = "//:.bazelignore",
|
||||
)
|
||||
use_repo(npm, "npm")
|
||||
|
||||
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
|
||||
rules_ts_ext.deps(
|
||||
name = "angular_npm_typescript",
|
||||
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
|
||||
ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
|
||||
ts_version_from = "//:package.json",
|
||||
)
|
||||
use_repo(rules_ts_ext, **{"npm_typescript": "angular_npm_typescript"})
|
||||
|
||||
rules_angular = use_extension("@rules_angular//setup:extensions.bzl", "rules_angular")
|
||||
rules_angular.setup(
|
||||
name = "components_rules_angular_configurable_deps",
|
||||
angular_compiler_cli = "//:node_modules/@angular/compiler-cli",
|
||||
typescript = "//:node_modules/typescript",
|
||||
)
|
||||
use_repo(rules_angular, **{"rules_angular_configurable_deps": "components_rules_angular_configurable_deps"})
|
||||
|
||||
register_toolchains(
|
||||
"@devinfra//bazel/git-toolchain:git_linux_toolchain",
|
||||
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
|
||||
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
|
||||
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
|
||||
)
|
||||
|
||||
CLDR_VERSION = "41"
|
||||
|
||||
cldr_json_data = use_repo_rule("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_json_data_repository")
|
||||
|
||||
cldr_json_data(
|
||||
name = "cldr_json_data",
|
||||
urls = {
|
||||
"https://github.com/unicode-org/cldr-json/releases/download/%s.0.0/cldr-%s.0.0-json-full.zip" % (CLDR_VERSION, CLDR_VERSION): "649b76647269e32b1b0a5f7b6eed52e9e63a1581f1afdcf4f6771e49c9713614",
|
||||
},
|
||||
)
|
||||
|
||||
cldr_xml_data = use_repo_rule("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_xml_data_repository")
|
||||
|
||||
cldr_xml_data(
|
||||
name = "cldr_xml_data",
|
||||
urls = {
|
||||
"https://github.com/unicode-org/cldr/releases/download/release-%s/cldr-common-%s.0.zip" % (CLDR_VERSION, CLDR_VERSION): "823c6170c41e2de2c229574e8a436332d25f1c9723409867fe721e00bc92d853",
|
||||
},
|
||||
)
|
||||
|
||||
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
|
||||
# Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests)
|
||||
http_archive(
|
||||
name = "sauce_connect_linux_amd64",
|
||||
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
|
||||
sha256 = "26b9c3630f441b47854b6032f7eca6f1d88d3f62e50ee44c27015d71a5155c36",
|
||||
strip_prefix = "sc-4.8.2-linux",
|
||||
url = "https://saucelabs.com/downloads/sc-4.8.2-linux.tar.gz",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "sauce_connect_mac",
|
||||
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
|
||||
sha256 = "28277ce81ef9ab84f5b87b526258920a8ead44789a5034346e872629bbf38089",
|
||||
strip_prefix = "sc-4.8.2-osx",
|
||||
url = "https://saucelabs.com/downloads/sc-4.8.2-osx.zip",
|
||||
)
|
||||
Generated
-4333
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,362 @@
|
||||
workspace(
|
||||
name = "angular",
|
||||
)
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
load("//:yarn.bzl", "YARN_LABEL")
|
||||
|
||||
http_archive(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
patches = [
|
||||
"//tools/esm-interop:patches/bazel/nodejs_binary_esm_support.patch",
|
||||
],
|
||||
sha256 = "5dd1e5dea1322174c57d3ca7b899da381d516220793d0adef3ba03b9d23baa8e",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.3/rules_nodejs-5.8.3.tar.gz"],
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
|
||||
|
||||
build_bazel_rules_nodejs_dependencies()
|
||||
|
||||
# The PKG rules are needed to build tar packages for integration tests. The builtin
|
||||
# rule in `@bazel_tools` is not Windows compatible and outdated.
|
||||
# NOTE: We cannot move past version 0.6.0 as pkg_tar no longer works on directories, which rules_nodejs
|
||||
# relies on for node_modules setup.
|
||||
http_archive(
|
||||
name = "rules_pkg",
|
||||
sha256 = "62eeb544ff1ef41d786e329e1536c1d541bb9bcad27ae984d57f18f314018e66",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz",
|
||||
"https://github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "aspect_rules_js",
|
||||
sha256 = "304c51726b727d53277dd28fcda1b8e43b7e46818530b8d6265e7be98d5e2b25",
|
||||
strip_prefix = "rules_js-2.3.8",
|
||||
url = "https://github.com/aspect-build/rules_js/releases/download/v2.3.8/rules_js-v2.3.8.tar.gz",
|
||||
)
|
||||
|
||||
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
|
||||
|
||||
rules_js_dependencies()
|
||||
|
||||
# Setup the Node.js toolchain.
|
||||
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
|
||||
|
||||
NODE_VERSION = "20.19.0"
|
||||
|
||||
NODE_20_REPO = {
|
||||
"20.19.0-darwin_arm64": ("node-v20.19.0-darwin-arm64.tar.gz", "node-v20.19.0-darwin-arm64", "c016cd1975a264a29dc1b07c6fbe60d5df0a0c2beb4113c0450e3d998d1a0d9c"),
|
||||
"20.19.0-darwin_amd64": ("node-v20.19.0-darwin-x64.tar.gz", "node-v20.19.0-darwin-x64", "a8554af97d6491fdbdabe63d3a1cfb9571228d25a3ad9aed2df856facb131b20"),
|
||||
"20.19.0-linux_arm64": ("node-v20.19.0-linux-arm64.tar.xz", "node-v20.19.0-linux-arm64", "dbe339e55eb393955a213e6b872066880bb9feceaa494f4d44c7aac205ec2ab9"),
|
||||
"20.19.0-linux_ppc64le": ("node-v20.19.0-linux-ppc64le.tar.xz", "node-v20.19.0-linux-ppc64le", "84937108f005679e60b486ed8e801cebfe923f02b76d8e710463d32f82181f65"),
|
||||
"20.19.0-linux_s390x": ("node-v20.19.0-linux-s390x.tar.xz", "node-v20.19.0-linux-s390x", "11f8ee99d792a83bba7b29911e0229dd6cd5e88987d7416346067db1cc76d89a"),
|
||||
"20.19.0-linux_amd64": ("node-v20.19.0-linux-x64.tar.xz", "node-v20.19.0-linux-x64", "b4e336584d62abefad31baecff7af167268be9bb7dd11f1297112e6eed3ca0d5"),
|
||||
"20.19.0-windows_amd64": ("node-v20.19.0-win-x64.zip", "node-v20.19.0-win-x64", "be72284c7bc62de07d5a9fd0ae196879842c085f11f7f2b60bf8864c0c9d6a4f"),
|
||||
}
|
||||
|
||||
nodejs_register_toolchains(
|
||||
name = "nodejs",
|
||||
node_repositories = NODE_20_REPO,
|
||||
node_version = NODE_VERSION,
|
||||
)
|
||||
|
||||
load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")
|
||||
|
||||
rules_js_register_toolchains(
|
||||
node_repositories = NODE_20_REPO,
|
||||
node_version = NODE_VERSION,
|
||||
)
|
||||
|
||||
# Download npm dependencies.
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
|
||||
load("//integration:npm_package_archives.bzl", "npm_package_archives")
|
||||
|
||||
yarn_install(
|
||||
name = "npm",
|
||||
# Note that we add the postinstall scripts here so that the dependencies are re-installed
|
||||
# when the postinstall patches are modified.
|
||||
data = [
|
||||
YARN_LABEL,
|
||||
"//:.yarnrc",
|
||||
"//:tools/npm-patches/@angular+ng-dev+0.0.0-a6dcd24107d12114198251ee5d20cda814a1986a.patch",
|
||||
"//:tools/npm-patches/dagre-d3-es+7.0.11.patch",
|
||||
"//tools:postinstall-patches.js",
|
||||
"//tools/esm-interop:patches/npm/@bazel+concatjs+5.8.1.patch",
|
||||
"//tools/esm-interop:patches/npm/@bazel+esbuild+5.7.1.patch",
|
||||
"//tools/esm-interop:patches/npm/rxjs+6.6.7.patch",
|
||||
],
|
||||
# Currently disabled due to:
|
||||
# 1. Missing Windows support currently.
|
||||
# 2. Incompatibilites with the `ts_library` rule.
|
||||
exports_directories_only = False,
|
||||
manual_build_file_contents = npm_package_archives(),
|
||||
package_json = "//:package.json",
|
||||
yarn = YARN_LABEL,
|
||||
yarn_lock = "//:yarn.lock",
|
||||
)
|
||||
|
||||
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
|
||||
|
||||
npm_translate_lock(
|
||||
name = "npm2",
|
||||
data = [
|
||||
"//:.pnpmfile.cjs",
|
||||
"//:package.json",
|
||||
"//:pnpm-workspace.yaml",
|
||||
"//adev:package.json",
|
||||
"//adev/shared-docs:package.json",
|
||||
"//adev/shared-docs/pipeline/api-gen:package.json",
|
||||
"//integration:package.json",
|
||||
"//modules:package.json",
|
||||
"//packages/animations:package.json",
|
||||
"//packages/benchpress:package.json",
|
||||
"//packages/common:package.json",
|
||||
"//packages/compiler:package.json",
|
||||
"//packages/compiler-cli:package.json",
|
||||
"//packages/compiler-cli/linker/babel/test:package.json",
|
||||
"//packages/core:package.json",
|
||||
"//packages/core/test/bundling:package.json",
|
||||
"//packages/elements:package.json",
|
||||
"//packages/forms:package.json",
|
||||
"//packages/localize:package.json",
|
||||
"//packages/platform-browser:package.json",
|
||||
"//packages/platform-browser-dynamic:package.json",
|
||||
"//packages/platform-server:package.json",
|
||||
"//packages/router:package.json",
|
||||
"//packages/upgrade:package.json",
|
||||
"//packages/zone.js:package.json",
|
||||
"//tools/bazel/rules_angular_store:package.json",
|
||||
],
|
||||
npmrc = "//:.npmrc",
|
||||
pnpm_lock = "//:pnpm-lock.yaml",
|
||||
update_pnpm_lock = True,
|
||||
verify_node_modules_ignored = "//:.bazelignore",
|
||||
yarn_lock = "//:yarn.lock",
|
||||
)
|
||||
|
||||
load("@npm2//:repositories.bzl", "npm_repositories")
|
||||
|
||||
npm_repositories()
|
||||
|
||||
http_archive(
|
||||
name = "aspect_rules_ts",
|
||||
sha256 = "09af62a0d46918d815b5f48b5ed0f5349b62c15fc42fcc3fef5c246504ff8d99",
|
||||
strip_prefix = "rules_ts-3.6.3",
|
||||
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.6.3/rules_ts-v3.6.3.tar.gz",
|
||||
)
|
||||
|
||||
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
|
||||
|
||||
rules_ts_dependencies(
|
||||
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.8.2 | jq -r '.dist.integrity'
|
||||
ts_integrity = "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||
ts_version_from = "//:package.json",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "aspect_rules_rollup",
|
||||
sha256 = "0b8ac7d97cd660eb9a275600227e9c4268f5904cba962939d1a6ce9a0a059d2e",
|
||||
strip_prefix = "rules_rollup-2.0.1",
|
||||
url = "https://github.com/aspect-build/rules_rollup/releases/download/v2.0.1/rules_rollup-v2.0.1.tar.gz",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "aspect_rules_jasmine",
|
||||
sha256 = "0d2f9c977842685895020cac721d8cc4f1b37aae15af46128cf619741dc61529",
|
||||
strip_prefix = "rules_jasmine-2.0.0",
|
||||
url = "https://github.com/aspect-build/rules_jasmine/releases/download/v2.0.0/rules_jasmine-v2.0.0.tar.gz",
|
||||
)
|
||||
|
||||
load("@aspect_rules_jasmine//jasmine:dependencies.bzl", "rules_jasmine_dependencies")
|
||||
|
||||
rules_jasmine_dependencies()
|
||||
|
||||
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
|
||||
|
||||
aspect_bazel_lib_dependencies()
|
||||
|
||||
# TODO: Remove when karma webtest is no longer used
|
||||
http_archive(
|
||||
name = "io_bazel_rules_webtesting",
|
||||
sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a",
|
||||
urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz"],
|
||||
)
|
||||
|
||||
# Setup the rules_webtesting toolchain
|
||||
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
|
||||
|
||||
web_test_repositories()
|
||||
|
||||
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
|
||||
|
||||
esbuild_repositories(
|
||||
npm_repository = "npm",
|
||||
)
|
||||
|
||||
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
|
||||
|
||||
rules_pkg_dependencies()
|
||||
|
||||
load("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_json_data_repository", "cldr_xml_data_repository")
|
||||
|
||||
cldr_major_version = "41"
|
||||
|
||||
cldr_json_data_repository(
|
||||
name = "cldr_json_data",
|
||||
urls = {
|
||||
"https://github.com/unicode-org/cldr-json/releases/download/%s.0.0/cldr-%s.0.0-json-full.zip" % (cldr_major_version, cldr_major_version): "649b76647269e32b1b0a5f7b6eed52e9e63a1581f1afdcf4f6771e49c9713614",
|
||||
},
|
||||
)
|
||||
|
||||
cldr_xml_data_repository(
|
||||
name = "cldr_xml_data",
|
||||
urls = {
|
||||
"https://github.com/unicode-org/cldr/releases/download/release-%s/cldr-common-%s.0.zip" % (cldr_major_version, cldr_major_version): "823c6170c41e2de2c229574e8a436332d25f1c9723409867fe721e00bc92d853",
|
||||
},
|
||||
)
|
||||
|
||||
# sass rules
|
||||
http_archive(
|
||||
name = "io_bazel_rules_sass",
|
||||
sha256 = "bff856619317a388292970a7d4bfea8c9e627a1886fe7132075d378d4067c09e",
|
||||
strip_prefix = "rules_sass-cbe5261f925751a465a1a54bf2147e5f696ec567",
|
||||
urls = [
|
||||
"https://github.com/bazelbuild/rules_sass/archive/cbe5261f925751a465a1a54bf2147e5f696ec567.zip",
|
||||
],
|
||||
)
|
||||
|
||||
# Setup the rules_sass toolchain
|
||||
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
|
||||
|
||||
sass_repositories(
|
||||
yarn_script = YARN_LABEL,
|
||||
)
|
||||
|
||||
# Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests)
|
||||
http_archive(
|
||||
name = "sauce_connect_linux_amd64",
|
||||
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
|
||||
sha256 = "26b9c3630f441b47854b6032f7eca6f1d88d3f62e50ee44c27015d71a5155c36",
|
||||
strip_prefix = "sc-4.8.2-linux",
|
||||
url = "https://saucelabs.com/downloads/sc-4.8.2-linux.tar.gz",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "sauce_connect_mac",
|
||||
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
|
||||
sha256 = "28277ce81ef9ab84f5b87b526258920a8ead44789a5034346e872629bbf38089",
|
||||
strip_prefix = "sc-4.8.2-osx",
|
||||
url = "https://saucelabs.com/downloads/sc-4.8.2-osx.zip",
|
||||
)
|
||||
|
||||
yarn_install(
|
||||
name = "npm_ts_versions",
|
||||
data = [
|
||||
YARN_LABEL,
|
||||
"//:.yarnrc",
|
||||
],
|
||||
exports_directories_only = False,
|
||||
package_json = "//packages/core/schematics/migrations/signal-migration/test/ts-versions:package.json",
|
||||
yarn = YARN_LABEL,
|
||||
yarn_lock = "//packages/core/schematics/migrations/signal-migration/test/ts-versions:yarn.lock",
|
||||
)
|
||||
|
||||
git_repository(
|
||||
name = "devinfra",
|
||||
commit = "5293c189424a61f7255d8171e3d653f983404851",
|
||||
remote = "https://github.com/angular/dev-infra.git",
|
||||
)
|
||||
|
||||
load("@devinfra//bazel:setup_dependencies_1.bzl", "setup_dependencies_1")
|
||||
|
||||
setup_dependencies_1()
|
||||
|
||||
load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2")
|
||||
|
||||
setup_dependencies_2()
|
||||
|
||||
load("@devinfra//bazel/browsers:browser_repositories.bzl", "browser_repositories")
|
||||
|
||||
browser_repositories()
|
||||
|
||||
git_repository(
|
||||
name = "rules_angular",
|
||||
commit = "88ddcf8cccbfef57f8cc3dda4881f18ec739428e",
|
||||
remote = "https://github.com/devversion/rules_angular.git",
|
||||
)
|
||||
|
||||
load("@rules_angular//setup:step_1.bzl", "rules_angular_step1")
|
||||
|
||||
rules_angular_step1()
|
||||
|
||||
load("@rules_angular//setup:step_2.bzl", "rules_angular_step2")
|
||||
|
||||
rules_angular_step2()
|
||||
|
||||
load("@rules_angular//setup:step_3.bzl", "rules_angular_step3")
|
||||
|
||||
rules_angular_step3(
|
||||
angular_compiler_cli = "@angular//tools/bazel/rules_angular_store:node_modules/@angular/compiler-cli",
|
||||
typescript = "@angular//:node_modules/typescript",
|
||||
)
|
||||
|
||||
git_repository(
|
||||
name = "rules_browsers",
|
||||
commit = "56ef8007ea07cd1916429bca8bb523433b0e9cdc",
|
||||
remote = "https://github.com/devversion/rules_browsers.git",
|
||||
)
|
||||
|
||||
load("@rules_browsers//setup:step_1.bzl", "rules_browsers_setup_1")
|
||||
|
||||
rules_browsers_setup_1()
|
||||
|
||||
load("@rules_browsers//setup:step_2.bzl", "rules_browsers_setup_2")
|
||||
|
||||
rules_browsers_setup_2()
|
||||
|
||||
http_archive(
|
||||
name = "aspect_rules_esbuild",
|
||||
sha256 = "530adfeae30bbbd097e8af845a44a04b641b680c5703b3bf885cbd384ffec779",
|
||||
strip_prefix = "rules_esbuild-0.22.1",
|
||||
url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.22.1/rules_esbuild-v0.22.1.tar.gz",
|
||||
)
|
||||
|
||||
load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependencies")
|
||||
|
||||
rules_esbuild_dependencies()
|
||||
|
||||
load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains")
|
||||
|
||||
esbuild_register_toolchains(
|
||||
name = "esbuild",
|
||||
esbuild_version = LATEST_ESBUILD_VERSION,
|
||||
)
|
||||
|
||||
# Register git toolchains
|
||||
register_toolchains(
|
||||
"@devinfra//bazel/git-toolchain:git_linux_toolchain",
|
||||
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
|
||||
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
|
||||
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
|
||||
)
|
||||
|
||||
git_repository(
|
||||
name = "rules_sass",
|
||||
commit = "cc1e845339fc45d3c8390445014d5824b85a0948",
|
||||
remote = "https://github.com/devversion/rules_sass.git",
|
||||
)
|
||||
|
||||
load("@rules_sass//src/toolchain:repositories.bzl", "setup_rules_sass")
|
||||
|
||||
setup_rules_sass()
|
||||
|
||||
http_archive(
|
||||
name = "jq.bzl",
|
||||
sha256 = "7b63435aa19cc6a0cfd1a82fbdf2c7a2f0a94db1a79ff7a4469ffa94286261ab",
|
||||
strip_prefix = "jq.bzl-0.1.0",
|
||||
url = "https://github.com/bazel-contrib/jq.bzl/releases/download/v0.1.0/jq.bzl-v0.1.0.tar.gz",
|
||||
)
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
||||
load("@npm//:defs.bzl", "npm_link_all_packages")
|
||||
load("@npm2//:defs.bzl", "npm_link_all_packages")
|
||||
load("@rules_angular//src/architect:ng_application.bzl", "ng_application")
|
||||
load("@rules_angular//src/architect:ng_config.bzl", "ng_config")
|
||||
load("@rules_angular//src/architect:ng_test.bzl", "ng_test")
|
||||
@@ -87,8 +87,8 @@ TEST_DEPS = [
|
||||
for dep in APPLICATION_DEPS
|
||||
if dep != "//adev:node_modules/@types/node"
|
||||
] + [
|
||||
"@rules_browsers//browsers/chromium",
|
||||
"@rules_browsers//browsers/firefox",
|
||||
"@rules_browsers//src/browsers/chromium",
|
||||
"@rules_browsers//src/browsers/firefox",
|
||||
"//adev/tools:windows-chromium-path",
|
||||
]
|
||||
|
||||
@@ -155,7 +155,7 @@ ng_test(
|
||||
node_modules = "//adev:node_modules",
|
||||
project_name = "angular-dev",
|
||||
toolchains = [
|
||||
"@rules_browsers//browsers/chromium:toolchain_alias",
|
||||
"@rules_browsers//browsers/firefox:toolchain_alias",
|
||||
"@rules_browsers//src/browsers/chromium:toolchain_alias",
|
||||
"@rules_browsers//src/browsers/firefox:toolchain_alias",
|
||||
],
|
||||
)
|
||||
|
||||
+5
-5
@@ -6,7 +6,7 @@ The content is written primarily in Markdown format located in `src/content`. Fo
|
||||
|
||||
## Local Development
|
||||
|
||||
For local development, [pnpm](https://pnpm.io/) is the preferred package manager. You can set up a local environment with the following commands
|
||||
For local development, [yarn](https://yarnpkg.com/) is the preferred package manager. You can set up a local environment with the following commands
|
||||
:
|
||||
|
||||
```bash
|
||||
@@ -17,11 +17,11 @@ git clone https://github.com/angular/angular.git
|
||||
cd angular
|
||||
|
||||
# Install dependencies
|
||||
pnpm
|
||||
yarn
|
||||
|
||||
# Build and run local dev server
|
||||
# NOTE: Initial build will take some time
|
||||
pnpm adev
|
||||
yarn docs
|
||||
```
|
||||
|
||||
If you are having issues with the docs building, see the [FAQs](#faqs) section.
|
||||
@@ -46,8 +46,8 @@ This is most likely due to a bazel dependency / caching issue. To resolve this,
|
||||
|
||||
```
|
||||
# Try this first
|
||||
pnpm bazel clean
|
||||
yarn bazel clean
|
||||
|
||||
# If that doesn't work, try it with the expunge flag
|
||||
pnpm bazel clean --expunge
|
||||
yarn bazel clean --expunge
|
||||
```
|
||||
|
||||
+26
-23
@@ -1,21 +1,22 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@angular-devkit/build-angular": "21.0.0-next.0",
|
||||
"@angular-devkit/build-angular": "20.1.1",
|
||||
"@angular/animations": "workspace:*",
|
||||
"@angular/build": "21.0.0-next.0",
|
||||
"@angular/cdk": "21.0.0-next.0",
|
||||
"@angular/cli": "21.0.0-next.0",
|
||||
"@angular/build": "20.1.1",
|
||||
"@angular/cdk": "20.1.2",
|
||||
"@angular/cli": "20.1.1",
|
||||
"@angular/common": "workspace:*",
|
||||
"@angular/compiler-cli": "workspace:*",
|
||||
"@angular/compiler": "workspace:*",
|
||||
"@angular/core": "workspace:*",
|
||||
"@angular/docs": "workspace:*",
|
||||
"@angular/forms": "workspace:*",
|
||||
"@angular/material": "21.0.0-next.0",
|
||||
"@angular/material": "20.1.2",
|
||||
"@angular/platform-browser": "workspace:*",
|
||||
"@angular/platform-server": "workspace:*",
|
||||
"@angular/router": "workspace:*",
|
||||
"@angular/ssr": "21.0.0-next.0",
|
||||
"@angular/ssr": "20.1.1",
|
||||
"@bazel/runfiles": "6.3.1",
|
||||
"@codemirror/autocomplete": "6.18.6",
|
||||
"@codemirror/commands": "6.8.1",
|
||||
"@codemirror/lang-angular": "0.1.4",
|
||||
@@ -23,7 +24,7 @@
|
||||
"@codemirror/lang-html": "6.4.9",
|
||||
"@codemirror/lang-javascript": "6.2.4",
|
||||
"@codemirror/lang-sass": "6.0.2",
|
||||
"@codemirror/language": "6.11.3",
|
||||
"@codemirror/language": "6.11.2",
|
||||
"@codemirror/lint": "6.8.5",
|
||||
"@codemirror/search": "6.5.11",
|
||||
"@codemirror/state": "6.5.2",
|
||||
@@ -32,16 +33,16 @@
|
||||
"@lezer/highlight": "1.2.1",
|
||||
"@lezer/javascript": "1.5.1",
|
||||
"@stackblitz/sdk": "1.11.0",
|
||||
"@types/dom-navigation": "1.0.6",
|
||||
"@types/jasmine": "5.1.9",
|
||||
"@types/dom-navigation": "1.0.5",
|
||||
"@types/jasmine": "5.1.8",
|
||||
"@types/jsdom": "21.1.7",
|
||||
"@types/node": "24.3.0",
|
||||
"@types/node": "24.1.0",
|
||||
"@typescript/vfs": "1.6.1",
|
||||
"@webcontainer/api": "1.6.1",
|
||||
"@xterm/addon-fit": "0.10.0",
|
||||
"@xterm/xterm": "5.5.0",
|
||||
"algoliasearch": "5.35.0",
|
||||
"angular-split": "20.0.0",
|
||||
"algoliasearch": "5.34.1",
|
||||
"angular-split": "19.0.0",
|
||||
"diff": "8.0.2",
|
||||
"emoji-regex": "10.4.0",
|
||||
"fflate": "0.8.2",
|
||||
@@ -52,24 +53,26 @@
|
||||
"karma-coverage": "2.2.1",
|
||||
"karma-jasmine-html-reporter": "2.1.0",
|
||||
"karma-jasmine": "5.1.0",
|
||||
"marked": "16.2.0",
|
||||
"mermaid": "11.10.1",
|
||||
"marked": "16.1.1",
|
||||
"mermaid": "11.9.0",
|
||||
"ngx-progressbar": "14.0.0",
|
||||
"open-in-idx": "0.1.1",
|
||||
"playwright-core": "1.55.0",
|
||||
"preact-render-to-string": "6.6.1",
|
||||
"preact": "10.27.1",
|
||||
"playwright-core": "1.54.1",
|
||||
"preact-render-to-string": "6.5.13",
|
||||
"preact": "10.26.9",
|
||||
"prettier": "3.6.2",
|
||||
"rxjs": "7.8.2",
|
||||
"shiki": "3.11.0",
|
||||
"shiki": "3.8.1",
|
||||
"tinyglobby": "0.2.14",
|
||||
"tslib": "2.8.1",
|
||||
"typescript": "5.9.2",
|
||||
"typescript": "5.8.3",
|
||||
"xhr2": "0.2.1",
|
||||
"zone.js": "0.15.1",
|
||||
"@algolia/client-common": "5.35.0",
|
||||
"@algolia/requester-browser-xhr": "5.35.0",
|
||||
"@algolia/requester-node-http": "5.35.0",
|
||||
|
||||
|
||||
"@algolia/client-common": "5.34.1",
|
||||
"@algolia/requester-browser-xhr": "5.34.1",
|
||||
"@algolia/requester-node-http": "5.34.1",
|
||||
"@lezer/css": "1.3.0",
|
||||
"@lezer/html": "1.3.10",
|
||||
"@lezer/lr": "1.4.2",
|
||||
@@ -79,4 +82,4 @@
|
||||
"style-mod": "4.1.2",
|
||||
"w3c-keyname": "2.2.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,18 +28,19 @@ ng_project(
|
||||
"index.ts",
|
||||
],
|
||||
deps = [
|
||||
"//adev/shared-docs/components",
|
||||
"//adev/shared-docs/directives",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/pipes",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/testing",
|
||||
"//adev/shared-docs/utils",
|
||||
"//adev/shared-docs/components:components_rjs",
|
||||
"//adev/shared-docs/directives:directives_rjs",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/pipes:pipes_rjs",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
"//adev/shared-docs/testing:testing_rjs",
|
||||
"//adev/shared-docs/utils:utils_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
ng_package(
|
||||
name = "pkg",
|
||||
srcs = [
|
||||
"package.json",
|
||||
"//adev/shared-docs/icons",
|
||||
@@ -62,6 +63,6 @@ ng_package(
|
||||
"//adev/shared-docs:__pkg__",
|
||||
],
|
||||
deps = [
|
||||
":docs",
|
||||
":docs_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -11,18 +11,18 @@ ts_project(
|
||||
"//adev/shared-docs:__pkg__",
|
||||
],
|
||||
deps = [
|
||||
"//adev/shared-docs/components/algolia-icon",
|
||||
"//adev/shared-docs/components/breadcrumb",
|
||||
"//adev/shared-docs/components/cookie-popup",
|
||||
"//adev/shared-docs/components/copy-source-code-button",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/components/navigation-list",
|
||||
"//adev/shared-docs/components/search-dialog",
|
||||
"//adev/shared-docs/components/select",
|
||||
"//adev/shared-docs/components/slide-toggle",
|
||||
"//adev/shared-docs/components/table-of-contents",
|
||||
"//adev/shared-docs/components/text-field",
|
||||
"//adev/shared-docs/components/top-level-banner",
|
||||
"//adev/shared-docs/components/viewers",
|
||||
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
|
||||
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
|
||||
"//adev/shared-docs/components/cookie-popup:cookie-popup_rjs",
|
||||
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
|
||||
"//adev/shared-docs/components/icon:icon_rjs",
|
||||
"//adev/shared-docs/components/navigation-list:navigation-list_rjs",
|
||||
"//adev/shared-docs/components/search-dialog:search-dialog_rjs",
|
||||
"//adev/shared-docs/components/select:select_rjs",
|
||||
"//adev/shared-docs/components/slide-toggle:slide-toggle_rjs",
|
||||
"//adev/shared-docs/components/table-of-contents:table-of-contents_rjs",
|
||||
"//adev/shared-docs/components/text-field:text-field_rjs",
|
||||
"//adev/shared-docs/components/top-level-banner:top-level-banner_rjs",
|
||||
"//adev/shared-docs/components/viewers:viewers_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -19,8 +19,8 @@ ng_project(
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -36,16 +36,16 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":breadcrumb",
|
||||
":breadcrumb_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -17,8 +17,8 @@ ng_project(
|
||||
deps = [
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/utils",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
"//adev/shared-docs/utils:utils_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -34,14 +34,14 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":cookie-popup",
|
||||
":cookie-popup_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/testing",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
"//adev/shared-docs/testing:testing_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ ng_project(
|
||||
"//adev:node_modules/@angular/cdk",
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/components/icon:icon_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":copy-source-code-button",
|
||||
":copy-source-code-button_rjs",
|
||||
"//adev:node_modules/@angular/cdk",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
@@ -36,5 +36,5 @@ ts_project(
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -19,10 +19,10 @@ ng_project(
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/material",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/pipes",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/components/icon:icon_rjs",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/pipes:pipes_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -41,16 +41,16 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":navigation-list",
|
||||
":navigation-list_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ import {NavigationItem} from '../../interfaces/index';
|
||||
import {NavigationState} from '../../services/index';
|
||||
import {RouterLink, RouterLinkActive} from '@angular/router';
|
||||
import {IconComponent} from '../icon/icon.component';
|
||||
import {IsActiveNavigationItem} from '../../pipes';
|
||||
import {IsActiveNavigationItem} from '../../pipes/is-active-navigation-item.pipe';
|
||||
import {NgTemplateOutlet} from '@angular/common';
|
||||
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||
|
||||
|
||||
@@ -21,14 +21,13 @@ ng_project(
|
||||
"//adev:node_modules/@angular/forms",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev:node_modules/rxjs",
|
||||
"//adev/shared-docs/components/algolia-icon",
|
||||
"//adev/shared-docs/components/search-history",
|
||||
"//adev/shared-docs/components/text-field",
|
||||
"//adev/shared-docs/directives",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/pipes",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
|
||||
"//adev/shared-docs/components/search-history:search-history_rjs",
|
||||
"//adev/shared-docs/components/text-field:text-field_rjs",
|
||||
"//adev/shared-docs/directives:directives_rjs",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/pipes:pipes_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -44,19 +43,19 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":search-dialog",
|
||||
":search-dialog_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/components/algolia-icon",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/testing",
|
||||
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
"//adev/shared-docs/testing:testing_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -20,18 +20,19 @@ import {
|
||||
viewChildren,
|
||||
} from '@angular/core';
|
||||
|
||||
import {WINDOW} from '../../providers';
|
||||
import {ClickOutside, SearchItem} from '../../directives';
|
||||
import {Search, SearchHistory} from '../../services';
|
||||
import {WINDOW} from '../../providers/index';
|
||||
import {ClickOutside} from '../../directives/index';
|
||||
import {Search, SearchHistory} from '../../services/index';
|
||||
|
||||
import {TextField} from '../text-field/text-field.component';
|
||||
import {FormControl, ReactiveFormsModule} from '@angular/forms';
|
||||
import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
|
||||
import {SearchItem} from '../../directives/search-item/search-item.directive';
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {Router, RouterLink} from '@angular/router';
|
||||
import {fromEvent} from 'rxjs';
|
||||
import {AlgoliaIcon} from '../algolia-icon/algolia-icon.component';
|
||||
import {RelativeLink} from '../../pipes';
|
||||
import {RelativeLink} from '../../pipes/relative-link.pipe';
|
||||
import {SearchHistoryComponent} from '../search-history/search-history.component';
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -24,9 +24,9 @@ ng_project(
|
||||
"//adev:node_modules/@angular/cdk",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/directives",
|
||||
"//adev/shared-docs/pipes",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/directives:directives_rjs",
|
||||
"//adev/shared-docs/pipes:pipes_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -35,17 +35,15 @@ ts_project(
|
||||
testonly = True,
|
||||
srcs = ["search-history.component.spec.ts"],
|
||||
deps = [
|
||||
":search-history",
|
||||
":search-history_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/testing",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
"//adev/shared-docs/testing:testing_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
|
||||
|
||||
import {SearchHistory} from '../../services';
|
||||
import {RelativeLink} from '../../pipes';
|
||||
import {SearchItem} from '../../directives';
|
||||
import {SearchItem} from '../../directives/search-item/search-item.directive';
|
||||
|
||||
@Component({
|
||||
selector: 'docs-search-history',
|
||||
|
||||
@@ -33,12 +33,12 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":select",
|
||||
":select_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -33,12 +33,12 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":slide-toggle",
|
||||
":slide-toggle_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -19,9 +19,9 @@ ng_project(
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/components/icon:icon_rjs",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -40,16 +40,16 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":table-of-contents",
|
||||
":table-of-contents_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import {Location, ViewportScroller} from '@angular/common';
|
||||
import {TableOfContentsLevel} from '../../interfaces/index';
|
||||
import {TableOfContentsLoader} from '../../services';
|
||||
import {TableOfContentsLoader} from '../../services/table-of-contents-loader.service';
|
||||
import {IconComponent} from '../icon/icon.component';
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -19,7 +19,7 @@ ng_project(
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/forms",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/components/icon:icon_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -35,12 +35,12 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":text-field",
|
||||
":text-field_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -17,9 +17,9 @@ ng_project(
|
||||
deps = [
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/directives",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/components/icon:icon_rjs",
|
||||
"//adev/shared-docs/directives:directives_rjs",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -35,13 +35,13 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":top-level-banner",
|
||||
":top-level-banner_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -21,17 +21,13 @@ ng_project(
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/material",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev:node_modules/rxjs",
|
||||
"//adev/shared-docs/components/breadcrumb",
|
||||
"//adev/shared-docs/components/copy-source-code-button",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/components/table-of-contents",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/utils",
|
||||
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
|
||||
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
|
||||
"//adev/shared-docs/components/table-of-contents:table-of-contents_rjs",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -55,23 +51,23 @@ ts_project(
|
||||
["**/*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":viewers",
|
||||
":viewers_rjs",
|
||||
"//adev:node_modules/@angular/cdk",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/material",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/components/breadcrumb",
|
||||
"//adev/shared-docs/components/copy-source-code-button",
|
||||
"//adev/shared-docs/components/icon",
|
||||
"//adev/shared-docs/components/table-of-contents",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/services",
|
||||
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
|
||||
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
|
||||
"//adev/shared-docs/components/icon:icon_rjs",
|
||||
"//adev/shared-docs/components/table-of-contents:table-of-contents_rjs",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
"//adev/shared-docs/services:services_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -28,22 +28,21 @@ import {
|
||||
effect,
|
||||
} from '@angular/core';
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {TOC_SKIP_CONTENT_MARKER, NavigationState} from '../../../services';
|
||||
import {TOC_SKIP_CONTENT_MARKER, NavigationState} from '../../../services/index';
|
||||
import {TableOfContents} from '../../table-of-contents/table-of-contents.component';
|
||||
import {IconComponent} from '../../icon/icon.component';
|
||||
import {handleHrefClickEventWithRouter} from '../../../utils';
|
||||
import {Snippet} from '../../../interfaces';
|
||||
import {handleHrefClickEventWithRouter} from '../../../utils/index';
|
||||
import {Snippet} from '../../../interfaces/index';
|
||||
import {Router} from '@angular/router';
|
||||
import {fromEvent} from 'rxjs';
|
||||
|
||||
import {Breadcrumb} from '../../breadcrumb/breadcrumb.component';
|
||||
import {CopySourceCodeButton} from '../../copy-source-code-button/copy-source-code-button.component';
|
||||
import {ExampleViewer} from '../example-viewer/example-viewer.component';
|
||||
import {DomSanitizer} from '@angular/platform-browser';
|
||||
|
||||
const TOC_HOST_ELEMENT_NAME = 'docs-table-of-contents';
|
||||
export const ASSETS_EXAMPLES_PATH = 'assets/content/examples';
|
||||
export const DOCS_VIEWER_SELECTOR = 'docs-viewer, main[docsViewer]';
|
||||
export const DOCS_VIEWER_SELECTOR = 'docs-viewer';
|
||||
export const DOCS_CODE_SELECTOR = '.docs-code';
|
||||
export const DOCS_CODE_MUTLIFILE_SELECTOR = '.docs-code-multifile';
|
||||
// TODO: Update the branch/sha
|
||||
@@ -75,7 +74,6 @@ export class DocViewer {
|
||||
private readonly environmentInjector = inject(EnvironmentInjector);
|
||||
private readonly injector = inject(Injector);
|
||||
private readonly appRef = inject(ApplicationRef);
|
||||
private readonly sanitizer = inject(DomSanitizer);
|
||||
|
||||
protected animateContent = false;
|
||||
private readonly pendingTasks = inject(PendingTasks);
|
||||
@@ -202,10 +200,8 @@ export class DocViewer {
|
||||
id: this.countOfExamples,
|
||||
});
|
||||
|
||||
exampleRef.setInput('githubUrl', `${GITHUB_CONTENT_URL}/${snippets[0].name}`);
|
||||
|
||||
// TODO: Re-add support for opening examples on StackBlitz
|
||||
exampleRef.setInput('stackblitzUrl', null); // `${ASSETS_EXAMPLES_PATH}/${snippets[0].name}.html`;
|
||||
exampleRef.instance.githubUrl = `${GITHUB_CONTENT_URL}/${snippets[0].name}`;
|
||||
exampleRef.instance.stackblitzUrl = `${ASSETS_EXAMPLES_PATH}/${snippets[0].name}.html`;
|
||||
|
||||
placeholder.parentElement!.replaceChild(exampleRef.location.nativeElement, placeholder);
|
||||
|
||||
@@ -217,7 +213,7 @@ export class DocViewer {
|
||||
|
||||
return tabs.map((tab) => ({
|
||||
name: tab.getAttribute('path') ?? tab.getAttribute('header') ?? '',
|
||||
sanitizedContent: this.sanitizer.bypassSecurityTrustHtml(tab.innerHTML),
|
||||
content: tab.innerHTML,
|
||||
visibleLinesRange: tab.getAttribute('visibleLines') ?? undefined,
|
||||
}));
|
||||
}
|
||||
@@ -237,9 +233,7 @@ export class DocViewer {
|
||||
return {
|
||||
title,
|
||||
name: path,
|
||||
sanitizedContent: content?.outerHTML
|
||||
? this.sanitizer.bypassSecurityTrustHtml(content.outerHTML)
|
||||
: '',
|
||||
content: content?.outerHTML,
|
||||
visibleLinesRange: visibleLines,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
}
|
||||
|
||||
@if (view() === CodeExampleViewMode.MULTI_FILE) {
|
||||
<mat-tab-group #codeTabs animationDuration="0ms" mat-stretch-tabs="false">
|
||||
<mat-tab-group
|
||||
#codeTabs
|
||||
animationDuration="0ms"
|
||||
mat-stretch-tabs="false"
|
||||
>
|
||||
@for (tab of tabs(); track tab) {
|
||||
<mat-tab [label]="tab.name"></mat-tab>
|
||||
}
|
||||
@@ -83,9 +87,7 @@
|
||||
[class.docs-example-viewer-multi-file]="view() === CodeExampleViewMode.MULTI_FILE"
|
||||
>
|
||||
<button docs-copy-source-code></button>
|
||||
@if (snippetCode()?.sanitizedContent; as content) {
|
||||
<div [innerHTML]="content"></div>
|
||||
}
|
||||
<docs-viewer [docContent]="snippetCode()?.content" />
|
||||
</div>
|
||||
|
||||
@if (exampleComponent) {
|
||||
@@ -96,9 +98,9 @@
|
||||
|
||||
<ng-template #openCodeInExternalProvider>
|
||||
@if (exampleComponent) {
|
||||
@if (githubUrl()) {
|
||||
@if (githubUrl) {
|
||||
<a
|
||||
[href]="githubUrl()"
|
||||
[href]="githubUrl"
|
||||
target="_blank"
|
||||
title="Open example on GitHub"
|
||||
class="docs-example-github-link"
|
||||
@@ -123,9 +125,9 @@
|
||||
</i>
|
||||
</a>
|
||||
}
|
||||
@if (stackblitzUrl()) {
|
||||
@if (stackblitzUrl) {
|
||||
<a
|
||||
[href]="stackblitzUrl()"
|
||||
[href]="stackblitzUrl"
|
||||
target="_blank"
|
||||
class="docs-example-stackblitz-link"
|
||||
title="Edit this example in StackBlitz"
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
:host {
|
||||
.docs-example-viewer-preview {
|
||||
.docs-dark-mode & {
|
||||
color: var(--primary-contrast);
|
||||
background: var(--gray-900);
|
||||
background: var(--gray-100);
|
||||
}
|
||||
@media screen and (prefers-color-scheme: dark) {
|
||||
color: var(--primary-contrast);
|
||||
background: var(--gray-900);
|
||||
background: var(--gray-100);
|
||||
}
|
||||
.docs-light-mode & {
|
||||
background: var(--page-background);
|
||||
|
||||
+18
-19
@@ -53,9 +53,9 @@ describe('ExampleViewer', () => {
|
||||
'metadata',
|
||||
getMetadata({
|
||||
files: [
|
||||
{name: 'file.ts', sanitizedContent: ''},
|
||||
{name: 'file.html', sanitizedContent: ''},
|
||||
{name: 'file.css', sanitizedContent: ''},
|
||||
{name: 'file.ts', content: ''},
|
||||
{name: 'file.html', content: ''},
|
||||
{name: 'file.css', content: ''},
|
||||
],
|
||||
}),
|
||||
);
|
||||
@@ -73,9 +73,9 @@ describe('ExampleViewer', () => {
|
||||
'metadata',
|
||||
getMetadata({
|
||||
files: [
|
||||
{name: 'file.ts', sanitizedContent: 'typescript file'},
|
||||
{name: 'file.html', sanitizedContent: 'html file'},
|
||||
{name: 'file.css', sanitizedContent: 'css file'},
|
||||
{name: 'file.ts', content: 'typescript file'},
|
||||
{name: 'file.html', content: 'html file'},
|
||||
{name: 'file.css', content: 'css file'},
|
||||
],
|
||||
}),
|
||||
);
|
||||
@@ -93,9 +93,9 @@ describe('ExampleViewer', () => {
|
||||
'metadata',
|
||||
getMetadata({
|
||||
files: [
|
||||
{name: 'example.ts', sanitizedContent: 'typescript file'},
|
||||
{name: 'example.html', sanitizedContent: 'html file'},
|
||||
{name: 'another-example.ts', sanitizedContent: 'css file'},
|
||||
{name: 'example.ts', content: 'typescript file'},
|
||||
{name: 'example.html', content: 'html file'},
|
||||
{name: 'another-example.ts', content: 'css file'},
|
||||
],
|
||||
}),
|
||||
);
|
||||
@@ -124,7 +124,7 @@ describe('ExampleViewer', () => {
|
||||
files: [
|
||||
{
|
||||
name: 'example.ts',
|
||||
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
|
||||
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
|
||||
visibleLinesRange: '[1]',
|
||||
},
|
||||
],
|
||||
@@ -148,7 +148,7 @@ describe('ExampleViewer', () => {
|
||||
files: [
|
||||
{
|
||||
name: 'example.ts',
|
||||
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
|
||||
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
|
||||
visibleLinesRange: '[1]',
|
||||
},
|
||||
],
|
||||
@@ -198,7 +198,7 @@ describe('ExampleViewer', () => {
|
||||
By.css('a[aria-label="Open example on GitHub"]'),
|
||||
);
|
||||
expect(githubButton).toBeTruthy();
|
||||
expect(githubButton.nativeElement.href).toBe(component.githubUrl());
|
||||
expect(githubButton.nativeElement.href).toBe(component.githubUrl);
|
||||
});
|
||||
|
||||
it('should display StackBlitz button when stackblitzUrl is provided and there is preview', async () => {
|
||||
@@ -210,8 +210,7 @@ describe('ExampleViewer', () => {
|
||||
preview: true,
|
||||
}),
|
||||
);
|
||||
componentRef.setInput('stackblitzUrl', 'https://stackblitz.com/');
|
||||
|
||||
component.stackblitzUrl = 'https://stackblitz.com/';
|
||||
await component.renderExample();
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -219,7 +218,7 @@ describe('ExampleViewer', () => {
|
||||
By.css('a[aria-label="Edit this example in StackBlitz"]'),
|
||||
);
|
||||
expect(stackblitzButton).toBeTruthy();
|
||||
expect(stackblitzButton.nativeElement.href).toBe(component.stackblitzUrl());
|
||||
expect(stackblitzButton.nativeElement.href).toBe(component.stackblitzUrl);
|
||||
});
|
||||
|
||||
it('should set expanded flag in metadata after toggleExampleVisibility', async () => {
|
||||
@@ -243,9 +242,9 @@ describe('ExampleViewer', () => {
|
||||
files: [
|
||||
{
|
||||
name: 'example.ts',
|
||||
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
|
||||
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
|
||||
},
|
||||
{name: 'example.css', sanitizedContent: ''},
|
||||
{name: 'example.css', content: ''},
|
||||
],
|
||||
}),
|
||||
);
|
||||
@@ -279,8 +278,8 @@ const getMetadata = (value: Partial<ExampleMetadata> = {}): ExampleMetadata => {
|
||||
return {
|
||||
id: 1,
|
||||
files: [
|
||||
{name: 'example.ts', sanitizedContent: ''},
|
||||
{name: 'example.css', sanitizedContent: ''},
|
||||
{name: 'example.ts', content: ''},
|
||||
{name: 'example.css', content: ''},
|
||||
],
|
||||
preview: false,
|
||||
...value,
|
||||
|
||||
@@ -14,9 +14,11 @@ import {
|
||||
computed,
|
||||
DestroyRef,
|
||||
ElementRef,
|
||||
forwardRef,
|
||||
inject,
|
||||
Injector,
|
||||
input,
|
||||
Input,
|
||||
signal,
|
||||
Type,
|
||||
viewChild,
|
||||
@@ -28,6 +30,7 @@ import {CopySourceCodeButton} from '../../copy-source-code-button/copy-source-co
|
||||
import {ExampleMetadata, Snippet} from '../../../interfaces/index';
|
||||
import {EXAMPLE_VIEWER_CONTENT_LOADER} from '../../../providers/index';
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {DocViewer} from '../docs-viewer/docs-viewer.component';
|
||||
|
||||
export enum CodeExampleViewMode {
|
||||
SNIPPET = 'snippet',
|
||||
@@ -41,15 +44,16 @@ export const HIDDEN_CLASS_NAME = 'hidden';
|
||||
|
||||
@Component({
|
||||
selector: 'docs-example-viewer',
|
||||
imports: [CommonModule, CopySourceCodeButton, MatTabsModule],
|
||||
imports: [CommonModule, forwardRef(() => DocViewer), CopySourceCodeButton, MatTabsModule],
|
||||
templateUrl: './example-viewer.component.html',
|
||||
styleUrls: ['./example-viewer.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ExampleViewer {
|
||||
readonly exampleMetadata = input<ExampleMetadata | null>(null, {alias: 'metadata'});
|
||||
readonly githubUrl = input<string | null>(null);
|
||||
readonly stackblitzUrl = input<string | null>(null);
|
||||
exampleMetadata = input<ExampleMetadata | null>(null, {alias: 'metadata'});
|
||||
|
||||
@Input() githubUrl: string | null = null;
|
||||
@Input() stackblitzUrl: string | null = null;
|
||||
readonly matTabGroup = viewChild<MatTabGroup>('codeTabs');
|
||||
|
||||
private readonly changeDetector = inject(ChangeDetectorRef);
|
||||
@@ -78,7 +82,7 @@ export class ExampleViewer {
|
||||
this.exampleMetadata()?.files.map((file) => ({
|
||||
name:
|
||||
file.title ?? (this.shouldDisplayFullName() ? file.name : this.getFileExtension(file.name)),
|
||||
code: file.sanitizedContent,
|
||||
code: file.content,
|
||||
})),
|
||||
);
|
||||
view = computed(() =>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
|
||||
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", _copy_to_directory = "copy_to_directory")
|
||||
load("@aspect_rules_esbuild//esbuild:defs.bzl", _esbuild = "esbuild")
|
||||
load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary", _js_library = "js_library", _js_run_binary = "js_run_binary")
|
||||
load("@devinfra//bazel/private:path_relative_to_label.bzl", _path_relative_to_label = "path_relative_to_label")
|
||||
load(
|
||||
"//tools:defaults.bzl",
|
||||
"//tools:defaults2.bzl",
|
||||
_jasmine_test = "jasmine_test",
|
||||
_js_binary = "js_binary",
|
||||
_js_library = "js_library",
|
||||
_js_run_binary = "js_run_binary",
|
||||
_ng_package = "ng_package",
|
||||
_ng_project = "ng_project",
|
||||
_sass_binary = "sass_binary",
|
||||
@@ -32,25 +30,27 @@ js_run_binary = _js_run_binary
|
||||
path_relative_to_label = _path_relative_to_label
|
||||
zoneless_jasmine_test = _zoneless_jasmine_test
|
||||
|
||||
def ts_project(name, tsconfig = None, testonly = False, **kwargs):
|
||||
def ts_project(name, tsconfig = None, testonly = False, enable_runtime_rnjs_interop = False, **kwargs):
|
||||
if tsconfig == None:
|
||||
if native.package_name().startswith("adev/shared-docs"):
|
||||
tsconfig = "//adev/shared-docs:tsconfig_test" if testonly else "//adev/shared-docs:tsconfig_build"
|
||||
|
||||
_ts_project(
|
||||
name = name,
|
||||
enable_runtime_rnjs_interop = enable_runtime_rnjs_interop,
|
||||
tsconfig = tsconfig,
|
||||
testonly = testonly,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
def ng_project(name, tsconfig = None, testonly = False, **kwargs):
|
||||
def ng_project(name, tsconfig = None, testonly = False, enable_runtime_rnjs_interop = False, **kwargs):
|
||||
if tsconfig == None:
|
||||
if native.package_name().startswith("adev/shared-docs"):
|
||||
tsconfig = "//adev/shared-docs:tsconfig_test" if testonly else "//adev/shared-docs:tsconfig_build"
|
||||
|
||||
_ng_project(
|
||||
name = name,
|
||||
enable_runtime_rnjs_interop = enable_runtime_rnjs_interop,
|
||||
tsconfig = tsconfig,
|
||||
testonly = testonly,
|
||||
**kwargs
|
||||
|
||||
@@ -11,8 +11,8 @@ ts_project(
|
||||
"//adev/shared-docs:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
"//adev/shared-docs/directives/click-outside",
|
||||
"//adev/shared-docs/directives/external-link",
|
||||
"//adev/shared-docs/directives/search-item",
|
||||
"//adev/shared-docs/directives/click-outside:click-outside_rjs",
|
||||
"//adev/shared-docs/directives/external-link:external-link_rjs",
|
||||
"//adev/shared-docs/directives/search-item:search-item_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":click-outside",
|
||||
":click-outside_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
@@ -32,5 +32,5 @@ ts_project(
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -14,8 +14,8 @@ ng_project(
|
||||
"//adev:node_modules/@angular/common",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/utils",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
"//adev/shared-docs/utils:utils_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -26,15 +26,15 @@ ts_project(
|
||||
["*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
":external-link",
|
||||
":external-link_rjs",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev/shared-docs/providers",
|
||||
"//adev/shared-docs/providers:providers_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_web_test_suite(
|
||||
name = "test",
|
||||
deps = [":test_lib"],
|
||||
deps = [":test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -8,4 +8,3 @@
|
||||
|
||||
export * from './click-outside/click-outside.directive';
|
||||
export * from './external-link/external-link.directive';
|
||||
export * from './search-item/search-item.directive';
|
||||
|
||||
@@ -13,6 +13,6 @@ ng_project(
|
||||
deps = [
|
||||
"//adev:node_modules/@angular/cdk",
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev/shared-docs/interfaces",
|
||||
"//adev/shared-docs/interfaces:interfaces_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ ts_project(
|
||||
],
|
||||
visibility = ["//adev/shared-docs:__subpackages__"],
|
||||
deps = [
|
||||
":lib",
|
||||
":lib_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -26,7 +26,6 @@ ts_project(
|
||||
),
|
||||
deps = [
|
||||
"//adev:node_modules/@angular/core",
|
||||
"//adev:node_modules/@angular/platform-browser",
|
||||
"//adev:node_modules/@angular/router",
|
||||
"//adev:node_modules/@types/node",
|
||||
"//adev:node_modules/@webcontainer/api",
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import {Type} from '@angular/core';
|
||||
import {SafeHtml} from '@angular/platform-browser';
|
||||
|
||||
/**
|
||||
* Map of the examples, values are functions which returns the promise of the component type, which will be displayed as preview in the ExampleViewer component
|
||||
@@ -22,7 +21,7 @@ export interface Snippet {
|
||||
/** Name of the file. */
|
||||
name: string;
|
||||
/** Content of code snippet */
|
||||
sanitizedContent: SafeHtml;
|
||||
content: string;
|
||||
/** Text in following format `start-end`. Start and end are numbers, based on them provided range of lines will be displayed in collapsed mode */
|
||||
visibleLinesRange?: string;
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
"name": "@angular/docs",
|
||||
"version": "0.0.0-PLACEHOLDER",
|
||||
"peerDependencies": {
|
||||
"@angular/cdk": "^21.0.0-next",
|
||||
"@angular/common": "^21.0.0-next",
|
||||
"@angular/core": "^21.0.0-next",
|
||||
"@angular/forms": "^21.0.0-next",
|
||||
"@angular/material": "^21.0.0-next",
|
||||
"@angular/platform-browser": "^21.0.0-next",
|
||||
"@angular/router": "^21.0.0-next",
|
||||
"@angular/ssr": "^21.0.0-next",
|
||||
"@angular/cdk": "^20.1.0-next",
|
||||
"@angular/common": "^20.1.0-next",
|
||||
"@angular/core": "^20.1.0-next",
|
||||
"@angular/forms": "^20.1.0-next",
|
||||
"@angular/material": "^20.1.0-next",
|
||||
"@angular/platform-browser": "^20.1.0-next",
|
||||
"@angular/router": "^20.1.0-next",
|
||||
"@angular/ssr": "^20.1.0-next",
|
||||
"algoliasearch": "^5.0.0",
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
@@ -20,7 +20,7 @@
|
||||
"fflate": "^0.8.2",
|
||||
"html-entities": "~2.6.0",
|
||||
"jsdom": "~26.1.0",
|
||||
"marked": "~16.2.0",
|
||||
"marked": "~16.1.0",
|
||||
"mermaid": "^11.0.0",
|
||||
"shiki": "^3.0.0",
|
||||
"tinyglobby": "^0.2.12"
|
||||
|
||||
@@ -47,13 +47,13 @@ js_binary(
|
||||
"//adev:node_modules/jsdom",
|
||||
"//adev:node_modules/mermaid",
|
||||
"//adev:node_modules/playwright-core",
|
||||
"@rules_browsers//browsers/chromium",
|
||||
"@rules_browsers//src/browsers/chromium",
|
||||
],
|
||||
entry_point = "//adev/shared-docs/pipeline/guides:guides.mjs",
|
||||
env = {
|
||||
"CHROME_HEADLESS_BIN": "$(CHROME-HEADLESS-SHELL)",
|
||||
},
|
||||
toolchains = ["@rules_browsers//browsers/chromium:toolchain_alias"],
|
||||
toolchains = ["@rules_browsers//src/browsers/chromium:toolchain_alias"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
||||
@@ -16,12 +16,6 @@ def _generate_guides(ctx):
|
||||
# Pass the the output directory path (which is the bazel-bin directory).
|
||||
args.add(ctx.bin_dir.path)
|
||||
|
||||
# Add the api_manifest file if provided
|
||||
if ctx.attr.api_manifest:
|
||||
args.add(ctx.file.api_manifest.path)
|
||||
else:
|
||||
args.add("")
|
||||
|
||||
# Determine the set of html output files. For each input markdown file, produce an html
|
||||
# file with the same name (replacing the markdown extension with `.html`).
|
||||
html_outputs = []
|
||||
@@ -35,14 +29,11 @@ def _generate_guides(ctx):
|
||||
# For each input file "xxx.md", we want to write an output file "xxx.html"
|
||||
html_outputs += [ctx.actions.declare_file("%s.html" % relative_basepath)]
|
||||
|
||||
# Define an action that runs the executable.
|
||||
inputs = ctx.files.srcs + ctx.files.data
|
||||
if ctx.attr.api_manifest:
|
||||
inputs.append(ctx.file.api_manifest)
|
||||
|
||||
# Define an action that runs the nodejs_binary executable. This is the main thing that this
|
||||
# rule does. If mermaid blocks are enabled then a different executable is used.
|
||||
if (ctx.attr.mermaid_blocks):
|
||||
ctx.actions.run(
|
||||
inputs = depset(inputs),
|
||||
inputs = depset(ctx.files.srcs + ctx.files.data),
|
||||
executable = ctx.executable._generate_guides,
|
||||
outputs = html_outputs,
|
||||
arguments = [args],
|
||||
@@ -52,7 +43,7 @@ def _generate_guides(ctx):
|
||||
)
|
||||
else:
|
||||
ctx.actions.run(
|
||||
inputs = depset(inputs),
|
||||
inputs = depset(ctx.files.srcs + ctx.files.data),
|
||||
executable = ctx.executable._generate_guides_no_mermaid,
|
||||
outputs = html_outputs,
|
||||
arguments = [args],
|
||||
@@ -81,10 +72,6 @@ generate_guides = rule(
|
||||
doc = """Source referenced from within the markdown.""",
|
||||
allow_files = True,
|
||||
),
|
||||
"api_manifest": attr.label(
|
||||
doc = """A file containing API entries to be used in the markdown.""",
|
||||
allow_single_file = True,
|
||||
),
|
||||
"mermaid_blocks": attr.bool(
|
||||
doc = """Whether to transform mermaid blocks.""",
|
||||
default = False,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
load("@npm//:defs.bzl", "npm_link_all_packages")
|
||||
load("@npm2//:defs.bzl", "npm_link_all_packages")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ ts_project(
|
||||
# TODO(rules_js): Explore how this could work alternatively at runtime with the module names.
|
||||
"//adev/shared-docs/pipeline/api-gen:node_modules/@angular/compiler-cli",
|
||||
"//adev/shared-docs/pipeline/api-gen:node_modules/@angular/compiler",
|
||||
"//adev:node_modules/@bazel/runfiles",
|
||||
"//adev:node_modules/@types/node",
|
||||
"//adev:node_modules/typescript",
|
||||
],
|
||||
@@ -23,7 +24,7 @@ ts_project(
|
||||
js_binary(
|
||||
name = "extract_api_to_json",
|
||||
data = [
|
||||
":extract_api_to_json_lib",
|
||||
":extract_api_to_json_lib_rjs",
|
||||
],
|
||||
entry_point = ":index.mjs",
|
||||
visibility = ["//visibility:public"],
|
||||
|
||||
@@ -31,6 +31,9 @@ def _extract_api_to_json(ctx):
|
||||
args.add(json_output.path)
|
||||
|
||||
# Pass the import path map
|
||||
# TODO: consider module_mappings_aspect to deal with path mappings instead of manually
|
||||
# specifying them
|
||||
# https://github.com/bazelbuild/rules_nodejs/blob/5.x/internal/linker/link_node_modules.bzl#L236
|
||||
path_map = {}
|
||||
for target, path in ctx.attr.import_map.items():
|
||||
files = target.files.to_list()
|
||||
@@ -42,7 +45,8 @@ def _extract_api_to_json(ctx):
|
||||
# Pass the set of (optional) extra entries
|
||||
args.add_joined(ctx.files.extra_entries, join_with = ",")
|
||||
|
||||
# Define an action that runs the executable.
|
||||
# Define an action that runs the nodejs_binary executable. This is
|
||||
# the main thing that this rule does.
|
||||
ctx.actions.run(
|
||||
inputs = depset(ctx.files.srcs + ctx.files.extra_entries),
|
||||
executable = ctx.executable._extract_api_to_json,
|
||||
|
||||
@@ -111,7 +111,7 @@ function main() {
|
||||
...getEntriesFromMembers(entry).map((member) => [member, moduleName]),
|
||||
]),
|
||||
],
|
||||
} satisfies EntryCollection);
|
||||
} as EntryCollection);
|
||||
|
||||
writeFileSync(outputFilenameExecRootRelativePath, output, {encoding: 'utf8'});
|
||||
}
|
||||
|
||||
@@ -53,11 +53,11 @@ ts_project(
|
||||
deps = [
|
||||
"//adev:node_modules/@angular/compiler-cli",
|
||||
"//adev:node_modules/@types/node",
|
||||
"//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json_lib",
|
||||
"//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json_lib_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_jasmine_test(
|
||||
name = "unit_tests",
|
||||
data = [":unit_test_lib"],
|
||||
data = [":unit_test_lib_rjs"],
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ esbuild(
|
||||
platform = "node",
|
||||
target = "es2022",
|
||||
deps = [
|
||||
":generate_api_manifest_lib",
|
||||
":generate_api_manifest_lib_rjs",
|
||||
"//adev:node_modules/@angular/compiler-cli",
|
||||
],
|
||||
)
|
||||
@@ -23,6 +23,7 @@ ts_project(
|
||||
srcs = glob(["**/*.mts"]),
|
||||
deps = [
|
||||
"//adev:node_modules/@angular/compiler-cli",
|
||||
"//adev:node_modules/@bazel/runfiles",
|
||||
"//adev:node_modules/@types/node",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -15,7 +15,8 @@ def _generate_api_manifest(ctx):
|
||||
manifest = ctx.actions.declare_file("manifest.json")
|
||||
args.add(manifest.path)
|
||||
|
||||
# Define an action that runs the executable.
|
||||
# Define an action that runs the nodejs_binary executable. This is
|
||||
# the main thing that this rule does.
|
||||
ctx.actions.run(
|
||||
inputs = depset(ctx.files.srcs),
|
||||
executable = ctx.executable._generate_api_manifest,
|
||||
|
||||
@@ -28,14 +28,14 @@ ts_project(
|
||||
],
|
||||
deps = [
|
||||
"//adev:node_modules/@angular/compiler-cli",
|
||||
"//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest_lib",
|
||||
"//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest_lib_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_jasmine_test(
|
||||
name = "unit_tests",
|
||||
data = [
|
||||
":unit_test_lib",
|
||||
"//packages/compiler-cli",
|
||||
":unit_test_lib_rjs",
|
||||
"//packages/compiler-cli:compiler-cli_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -14,21 +14,18 @@ describe('api manifest generation', () => {
|
||||
it('should generate a manifest from multiple collections', () => {
|
||||
const manifest: Manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/router',
|
||||
moduleName: '@angular/router',
|
||||
entries: [entry({name: 'Router', entryType: EntryType.UndecoratedClass})],
|
||||
normalizedModuleName: 'angular_router',
|
||||
moduleLabel: 'router',
|
||||
},
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
|
||||
normalizedModuleName: 'angular_core',
|
||||
moduleLabel: 'core',
|
||||
},
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [entry({name: 'foo', entryType: EntryType.Constant})],
|
||||
normalizedModuleName: 'angular_core',
|
||||
@@ -82,14 +79,12 @@ describe('api manifest generation', () => {
|
||||
it('should generate a manifest when collections share a symbol with the same name', () => {
|
||||
const manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
|
||||
normalizedModuleName: 'angular_core',
|
||||
moduleLabel: 'core',
|
||||
},
|
||||
{
|
||||
repo: 'angular/router',
|
||||
moduleName: '@angular/router',
|
||||
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
|
||||
normalizedModuleName: 'angular_router',
|
||||
@@ -134,14 +129,12 @@ describe('api manifest generation', () => {
|
||||
it('should union collections for the same module into one manifest', () => {
|
||||
const manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
|
||||
normalizedModuleName: 'angular_core',
|
||||
moduleLabel: 'core',
|
||||
},
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [entry({name: 'TAO', entryType: EntryType.Constant})],
|
||||
normalizedModuleName: 'angular_core',
|
||||
@@ -179,7 +172,6 @@ describe('api manifest generation', () => {
|
||||
it('should mark a manifest entry as deprecated', () => {
|
||||
const manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [
|
||||
entry({name: 'PI', entryType: EntryType.Constant, jsdocTags: jsdocTags('deprecated')}),
|
||||
@@ -220,7 +212,6 @@ describe('api manifest generation', () => {
|
||||
it('should not mark a function as deprecated if only one overload is deprecated', () => {
|
||||
const manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [
|
||||
functionEntry({
|
||||
@@ -280,7 +271,6 @@ describe('api manifest generation', () => {
|
||||
it('should mark a function as deprecated if all overloads are deprecated', () => {
|
||||
const manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [
|
||||
functionEntry({
|
||||
@@ -340,7 +330,6 @@ describe('api manifest generation', () => {
|
||||
it("should mark a fn as deprecated if there's one w/ the same name in another collection", () => {
|
||||
const manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [
|
||||
entry({name: 'save', entryType: EntryType.Function, jsdocTags: jsdocTags('deprecated')}),
|
||||
@@ -349,7 +338,6 @@ describe('api manifest generation', () => {
|
||||
moduleLabel: 'core',
|
||||
},
|
||||
{
|
||||
repo: 'angular/more',
|
||||
moduleName: '@angular/more',
|
||||
entries: [entry({name: 'save', entryType: EntryType.Function})],
|
||||
normalizedModuleName: 'angular_more',
|
||||
@@ -394,7 +382,6 @@ describe('api manifest generation', () => {
|
||||
it('should mark a manifest entry as developerPreview', () => {
|
||||
const manifest = generateManifest([
|
||||
{
|
||||
repo: 'angular/core',
|
||||
moduleName: '@angular/core',
|
||||
entries: [
|
||||
entry({
|
||||
|
||||
@@ -10,7 +10,7 @@ esbuild(
|
||||
platform = "node",
|
||||
target = "es2022",
|
||||
deps = [
|
||||
":render_api_to_html_lib",
|
||||
":render_api_to_html_lib_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -20,22 +20,23 @@ ts_project(
|
||||
[
|
||||
"**/*.mts",
|
||||
"**/*.tsx",
|
||||
"shiki.d.ts",
|
||||
],
|
||||
exclude = [
|
||||
"entities.mts",
|
||||
],
|
||||
),
|
||||
enable_runtime_rnjs_interop = True,
|
||||
deps = [
|
||||
":entities",
|
||||
":entities_rjs",
|
||||
"//adev:node_modules/@bazel/runfiles",
|
||||
"//adev:node_modules/@types/node",
|
||||
"//adev:node_modules/html-entities",
|
||||
"//adev:node_modules/marked",
|
||||
"//adev:node_modules/preact",
|
||||
"//adev:node_modules/preact-render-to-string",
|
||||
"//adev:node_modules/prettier",
|
||||
"//adev:node_modules/shiki",
|
||||
"//adev/shared-docs/pipeline/shared:linking",
|
||||
"//adev/shared-docs/pipeline/shared:shiki",
|
||||
"//adev/shared-docs/pipeline/shared/marked",
|
||||
"//adev/shared-docs/pipeline/shared/regions",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ import path from 'path';
|
||||
import {CliCommand} from './cli-entities.mjs';
|
||||
import {DocEntry} from './entities.mjs';
|
||||
import {isCliEntry, isHiddenEntry} from './entities/categorization.mjs';
|
||||
import {configureMarkedGlobally} from './marked/configuration.mjs';
|
||||
import {getRenderable} from './processing.mjs';
|
||||
import {renderEntry} from './rendering.mjs';
|
||||
import {initHighlighter} from './shiki/shiki.mjs';
|
||||
import {setCurrentSymbol, setSymbols} from './symbol-context.mjs';
|
||||
import {CliCommandRenderable, DocEntryRenderable} from './entities/renderables.mjs';
|
||||
import {initHighlighter} from '../../shared/shiki.mjs';
|
||||
import {setHighlighterInstance} from './shiki/shiki.mjs';
|
||||
|
||||
/** The JSON data file format for extracted API reference info. */
|
||||
interface EntryCollection {
|
||||
@@ -25,7 +25,7 @@ interface EntryCollection {
|
||||
moduleLabel?: string;
|
||||
normalizedModuleName: string;
|
||||
entries: DocEntry[] | CliCommand[];
|
||||
symbols: Record<string, string>;
|
||||
symbols: Map<string, string>;
|
||||
}
|
||||
|
||||
/** Parse all JSON data source files into an array of collections. */
|
||||
@@ -34,15 +34,10 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
|
||||
const fileContent = readFileSync(jsonDataFilePath, {encoding: 'utf8'});
|
||||
const fileContentJson = JSON.parse(fileContent) as unknown;
|
||||
if ((fileContentJson as EntryCollection).entries) {
|
||||
const symbols = Object.fromEntries(
|
||||
// TODO: refactor that, it's dirty and we can probably do better than this.
|
||||
// We're removing the leading `@angular/` from module names.
|
||||
(((fileContentJson as any).symbols ?? []) as [string, string][]).map(
|
||||
([symbol, moduleName]) => [symbol, moduleName.slice(9)],
|
||||
),
|
||||
);
|
||||
|
||||
return {...(fileContentJson as EntryCollection), symbols};
|
||||
return {
|
||||
...(fileContentJson as EntryCollection),
|
||||
symbols: new Map((fileContentJson as any).symbols ?? []),
|
||||
};
|
||||
}
|
||||
|
||||
// CLI subcommands should generate a separate file for each subcommand.
|
||||
@@ -55,7 +50,7 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
|
||||
moduleName: 'unknown',
|
||||
normalizedModuleName: 'unknown',
|
||||
entries: [fileContentJson as DocEntry],
|
||||
symbols: {},
|
||||
symbols: new Map(),
|
||||
},
|
||||
...command.subcommands!.map((subCommand) => {
|
||||
return {
|
||||
@@ -63,7 +58,7 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
|
||||
moduleName: 'unknown',
|
||||
normalizedModuleName: 'unknown',
|
||||
entries: [{...subCommand, parentCommand: command} as any],
|
||||
symbols: {},
|
||||
symbols: new Map(),
|
||||
};
|
||||
}),
|
||||
];
|
||||
@@ -74,7 +69,7 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
|
||||
moduleName: 'unknown',
|
||||
normalizedModuleName: 'unknown',
|
||||
entries: [fileContentJson as DocEntry], // TODO: fix the typing cli entries aren't DocEntry
|
||||
symbols: {},
|
||||
symbols: new Map(),
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -95,8 +90,10 @@ function getNormalizedFilename(normalizedModuleName: string, entry: DocEntry | C
|
||||
}
|
||||
|
||||
async function main() {
|
||||
configureMarkedGlobally();
|
||||
|
||||
// Shiki highlighter needs to be setup in an async context
|
||||
setHighlighterInstance(await initHighlighter());
|
||||
await initHighlighter();
|
||||
|
||||
const [paramFilePath] = process.argv.slice(2);
|
||||
const rawParamLines = readFileSync(paramFilePath, {encoding: 'utf8'}).split('\n');
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {marked} from 'marked';
|
||||
import {renderer} from './renderer.mjs';
|
||||
|
||||
/** Globally configures marked for rendering JsDoc content to HTML. */
|
||||
export function configureMarkedGlobally() {
|
||||
marked.use({
|
||||
renderer,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {Renderer, Tokens} from 'marked';
|
||||
import {codeToHtml} from '../shiki/shiki.mjs';
|
||||
import {SECTION_HEADING, SECTION_SUB_HEADING} from '../styling/css-classes.mjs';
|
||||
|
||||
/**
|
||||
* Custom renderer for marked that will be used to transform markdown files to HTML
|
||||
* files that can be used in the Angular docs.
|
||||
*/
|
||||
export const renderer: Partial<Renderer> = {
|
||||
code({lang, text}): string {
|
||||
const highlightResult = codeToHtml(text, lang)
|
||||
// remove spaces/line-breaks between elements to not mess-up `pre` style
|
||||
.replace(/>\s+</g, '><');
|
||||
|
||||
return `
|
||||
<div class="docs-code" role="group">
|
||||
${highlightResult}
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
image({href, title, text}): string {
|
||||
return `
|
||||
<img src="${href}" alt="${text}" title="${title}" class="docs-image">
|
||||
`;
|
||||
},
|
||||
link(this: Renderer, {href, tokens}): string {
|
||||
return `<a href="${href}">${this.parser.parseInline(tokens)}</a>`;
|
||||
},
|
||||
list(this: Renderer, {items, ordered, start}) {
|
||||
if (ordered) {
|
||||
return `
|
||||
<ol class="docs-ordered-list">
|
||||
${items.map((item) => this.listitem(item)).join('')}
|
||||
</ol>
|
||||
`;
|
||||
}
|
||||
return `
|
||||
<ul class="docs-list">
|
||||
${items.map((item) => this.listitem(item)).join('')}
|
||||
</ul>
|
||||
`;
|
||||
},
|
||||
|
||||
table(this: Renderer, {header, rows}: Tokens.Table) {
|
||||
return `
|
||||
<div class="docs-table docs-scroll-track-transparent">
|
||||
<table>
|
||||
<thead>
|
||||
${this.tablerow({text: header.map((cell) => this.tablecell(cell)).join('')})}
|
||||
</thead>
|
||||
<tbody>
|
||||
${rows
|
||||
.map((row) => this.tablerow({text: row.map((cell) => this.tablecell(cell)).join('')}))
|
||||
.join('')}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
|
||||
heading(this: Renderer, {text, depth, tokens}: Tokens.Heading) {
|
||||
const id = text
|
||||
.toLowerCase()
|
||||
.replaceAll(' ', '-')
|
||||
.replace(/[^a-z0-9-]/g, '');
|
||||
|
||||
// Since we have a code transformer `addApiLinksToHtml` which adds anchors
|
||||
// to code blocks of known symbols, we add an additional `data-skip-anchor`
|
||||
// attribute that prevents the transformation. This is needed since nested
|
||||
// anchor tags are illegal and break the HTML.
|
||||
const textRenderer = new Renderer();
|
||||
textRenderer.codespan = ({text}) => `<code data-skip-anchor>${text}</code>`;
|
||||
const parsedText = this.parser.parseInline(tokens, textRenderer);
|
||||
|
||||
// The template matches templates/section-heading.tsx
|
||||
return `
|
||||
<h${depth} id="${id}" class="${SECTION_HEADING} ${SECTION_SUB_HEADING}">
|
||||
<a href="#${id}" aria-label="Link to ${text} section" tabIndex="-1">
|
||||
${parsedText}
|
||||
</a>
|
||||
</h${depth}>
|
||||
`;
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,196 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import * as blockC from './region-matchers/block-c.mjs';
|
||||
import * as html from './region-matchers/html.mjs';
|
||||
import * as inlineC from './region-matchers/inline-c.mjs';
|
||||
import * as inlineCOnly from './region-matchers/inline-c-only.mjs';
|
||||
import * as inlineHash from './region-matchers/inline-hash.mjs';
|
||||
import {FileType, removeEslintComments} from './remove-eslint-comments.mjs';
|
||||
|
||||
const WHOLE_FILE_REGION_NAME = '';
|
||||
const DEFAULT_PLASTER = '. . .';
|
||||
const REGION_MATCHERS = {
|
||||
ts: inlineC,
|
||||
js: inlineC,
|
||||
mjs: inlineCOnly,
|
||||
es6: inlineC,
|
||||
html: html,
|
||||
svg: html,
|
||||
css: blockC,
|
||||
conf: inlineHash,
|
||||
yaml: inlineHash,
|
||||
yml: inlineHash,
|
||||
sh: inlineHash,
|
||||
jade: inlineCOnly,
|
||||
pug: inlineCOnly,
|
||||
json: inlineCOnly,
|
||||
'json.annotated': inlineCOnly,
|
||||
};
|
||||
|
||||
interface Region {
|
||||
lines: string[];
|
||||
open?: boolean;
|
||||
ranges: {from: number; to?: number}[];
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: We assume that the tag defining the beginning and end of the region will be in different lines in each case.
|
||||
* For example, in HTML, we don't expect to have the following code on one line: <!-- docregion name -->content<!--enddocregion name-->
|
||||
*/
|
||||
export const regionParser = (contents: string, filePath: string) => {
|
||||
const fileType: FileType | undefined = filePath?.split('.').pop() as FileType;
|
||||
|
||||
if (!fileType) {
|
||||
throw new Error(`Incorrect file type for region parser: ${filePath}!`);
|
||||
}
|
||||
|
||||
const regionMatcher = REGION_MATCHERS[fileType];
|
||||
const openRegions: string[] = [];
|
||||
const regionMap: Record<string, Region> = {};
|
||||
|
||||
let countOfRegionLines = 0;
|
||||
|
||||
if (regionMatcher) {
|
||||
let plaster = regionMatcher.createPlasterComment(DEFAULT_PLASTER);
|
||||
const lines = removeEslintComments(contents, fileType)
|
||||
.split(/\r?\n/)
|
||||
.filter((line, index) => {
|
||||
const startRegion = line.match(regionMatcher.regionStartMatcher);
|
||||
const endRegion = line.match(regionMatcher.regionEndMatcher);
|
||||
const updatePlaster = line.match(regionMatcher.plasterMatcher);
|
||||
|
||||
// start region processing
|
||||
if (startRegion) {
|
||||
// open up the specified region
|
||||
handleStartRegion(
|
||||
startRegion,
|
||||
regionMap,
|
||||
index,
|
||||
countOfRegionLines,
|
||||
plaster,
|
||||
openRegions,
|
||||
);
|
||||
} else if (endRegion) {
|
||||
// end region processing
|
||||
handleEndRegion(openRegions, endRegion, regionMap, index, countOfRegionLines);
|
||||
} else if (updatePlaster) {
|
||||
// doc plaster processing
|
||||
const plasterString = updatePlaster[1].trim();
|
||||
plaster = plasterString ? regionMatcher.createPlasterComment(plasterString) : '';
|
||||
} else {
|
||||
// simple line of content processing
|
||||
openRegions.forEach((regionName) => regionMap[regionName].lines.push(line));
|
||||
// do not filter out this line from the content
|
||||
return true;
|
||||
}
|
||||
|
||||
// this line contained an annotation so let's filter it out
|
||||
countOfRegionLines++;
|
||||
return false;
|
||||
});
|
||||
|
||||
if (!regionMap[WHOLE_FILE_REGION_NAME]) {
|
||||
regionMap[WHOLE_FILE_REGION_NAME] = {lines, ranges: [{from: 1, to: lines.length + 1}]};
|
||||
}
|
||||
|
||||
return {
|
||||
contents: lines.join('\n'),
|
||||
regionMap,
|
||||
totalLinesCount: lines.length,
|
||||
};
|
||||
} else {
|
||||
return {contents, regionMap, totalLinesCount: 0};
|
||||
}
|
||||
};
|
||||
|
||||
function handleStartRegion(
|
||||
startRegion: RegExpMatchArray,
|
||||
regionMap: Record<string, Region>,
|
||||
index: number,
|
||||
countOfRegionLines: number,
|
||||
plaster: string,
|
||||
openRegions: string[],
|
||||
) {
|
||||
const regionNames = getRegionNames(startRegion[1]);
|
||||
if (regionNames.length === 0) {
|
||||
regionNames.push(WHOLE_FILE_REGION_NAME);
|
||||
}
|
||||
|
||||
for (const regionName of regionNames) {
|
||||
const region = regionMap[regionName];
|
||||
if (region) {
|
||||
if (region.open) {
|
||||
throw new Error(`Tried to open a region, named "${regionName}", that is already open`);
|
||||
}
|
||||
|
||||
// Region is opened, set from range value.
|
||||
region.open = true;
|
||||
region.ranges.push({from: getFromRangeValue(index, countOfRegionLines)});
|
||||
|
||||
if (plaster) {
|
||||
// Use the same indent as the docregion marker
|
||||
const indent = startRegion[0].split(/[^ ]/, 1);
|
||||
region.lines.push(indent + plaster);
|
||||
}
|
||||
} else {
|
||||
regionMap[regionName] = {
|
||||
lines: [],
|
||||
open: true,
|
||||
ranges: [
|
||||
{
|
||||
from: getFromRangeValue(index, countOfRegionLines),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
openRegions.push(regionName);
|
||||
}
|
||||
}
|
||||
|
||||
function handleEndRegion(
|
||||
openRegions: string[],
|
||||
endRegion: RegExpMatchArray,
|
||||
regionMap: Record<string, Region>,
|
||||
index: number,
|
||||
countOfRegionLines: number,
|
||||
) {
|
||||
if (openRegions.length === 0) {
|
||||
throw new Error('Tried to close a region when none are open');
|
||||
}
|
||||
// close down the specified region (or most recent if no name is given)
|
||||
const regionNames = getRegionNames(endRegion[1]);
|
||||
if (regionNames.length === 0) {
|
||||
regionNames.push(openRegions[openRegions.length - 1]);
|
||||
}
|
||||
|
||||
for (const regionName of regionNames) {
|
||||
const region = regionMap[regionName];
|
||||
if (!region || !region.open) {
|
||||
throw new Error(`Tried to close a region, named "${regionName}", that is not open`);
|
||||
}
|
||||
|
||||
// Region is closed, we can define the last line number of the region
|
||||
region.open = false;
|
||||
region.ranges[region.ranges.length - 1].to = index - countOfRegionLines;
|
||||
removeLast(openRegions, regionName);
|
||||
}
|
||||
}
|
||||
|
||||
function getFromRangeValue(index: number, countOfRegionLines: number): number {
|
||||
return index - countOfRegionLines + 1;
|
||||
}
|
||||
|
||||
function getRegionNames(input: string): string[] {
|
||||
return input.trim() === '' ? [] : input.split(',').map((name) => name.trim());
|
||||
}
|
||||
|
||||
function removeLast(array: string[], item: string): void {
|
||||
const index = array.lastIndexOf(item);
|
||||
array.splice(index, 1);
|
||||
}
|
||||
@@ -18,7 +18,8 @@ def _render_api_to_html(ctx):
|
||||
args.add(html_output_directory.path)
|
||||
outputs = [html_output_directory]
|
||||
|
||||
# Define an action that runs the executable.
|
||||
# Define an action that runs the nodejs_binary executable. This is
|
||||
# the main thing that this rule does.
|
||||
ctx.actions.run(
|
||||
inputs = depset(ctx.files.srcs),
|
||||
executable = ctx.executable._render_api_to_html,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// This definition file is a temporary workaround until the toolchain is able to read d.mts definition files
|
||||
// TODO: delete this file when the toolchains supports .d.mts files
|
||||
declare module 'shiki' {
|
||||
function createHighlighter(params: {
|
||||
themes: any[];
|
||||
langs: string[];
|
||||
cssVariablePrefix?: string;
|
||||
defaultColor?: boolean;
|
||||
}): unknown;
|
||||
|
||||
type HighlighterGeneric<BundledLangKeys, BundledThemeKeys> = any;
|
||||
}
|
||||
@@ -6,24 +6,41 @@
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {HighlighterGeneric} from 'shiki';
|
||||
let highlighter: any;
|
||||
|
||||
/**
|
||||
* Singleton instance of the Shiki highlighter used during API page generation.
|
||||
*
|
||||
* TODO: Consider removing this singleton pattern if we find a better alternative.
|
||||
*/
|
||||
let highlighter: HighlighterGeneric<any, any>;
|
||||
export function setHighlighterInstance(instance: HighlighterGeneric<any, any>) {
|
||||
highlighter = instance;
|
||||
export async function initHighlighter() {
|
||||
const {createHighlighter} = await import('shiki');
|
||||
highlighter = await createHighlighter({
|
||||
themes: ['github-light', 'github-dark'],
|
||||
langs: [
|
||||
'javascript',
|
||||
'typescript',
|
||||
'angular-html',
|
||||
'angular-ts',
|
||||
'shell',
|
||||
'html',
|
||||
'http',
|
||||
'json',
|
||||
'jsonc',
|
||||
'nginx',
|
||||
'markdown',
|
||||
'apache',
|
||||
],
|
||||
});
|
||||
}
|
||||
export function getHighlighterInstance(): HighlighterGeneric<any, any> {
|
||||
if (!highlighter) {
|
||||
throw new Error(
|
||||
'Shiki highlighter has not been initialized. Make sure to call `setHighlighterInstance`.',
|
||||
);
|
||||
}
|
||||
return highlighter;
|
||||
|
||||
export function codeToHtml(code: string, language: string | undefined): string {
|
||||
const html = highlighter.codeToHtml(code, {
|
||||
lang: language ?? 'text',
|
||||
themes: {
|
||||
light: 'github-light',
|
||||
dark: 'github-dark',
|
||||
},
|
||||
cssVariablePrefix: '--shiki-',
|
||||
defaultColor: false,
|
||||
});
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,17 +6,30 @@
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {getSymbolUrl as sharedGetSymbolUrl} from '../../shared/linking.mjs';
|
||||
|
||||
/**
|
||||
* API pages are generated each package at a time.
|
||||
* This allows us to use a global context to store the symbols and their corresponding module names.
|
||||
* This allows to use a global context to store the symbols and their corresponding module names.
|
||||
*/
|
||||
|
||||
let symbols: Record<string, string> = {};
|
||||
let symbols = new Map<string, string>();
|
||||
|
||||
// This is used to store the currently processed symbol (usually a class or an interface)
|
||||
let currentSymbol: string | undefined;
|
||||
|
||||
export function setSymbols(newSymbols: Map<string, string>): void {
|
||||
symbols = newSymbols;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the module name of a symbol.
|
||||
* eg: 'ApplicationRef' => 'core', 'FormControl' => 'forms'
|
||||
* Also supports class.member, 'NgZone.runOutsideAngular => 'core'
|
||||
*/
|
||||
export function getModuleName(symbol: string): string | undefined {
|
||||
const moduleName = symbols.get(symbol);
|
||||
return moduleName?.replace('@angular/', '');
|
||||
}
|
||||
|
||||
export function setCurrentSymbol(symbol: string): void {
|
||||
currentSymbol = symbol;
|
||||
}
|
||||
@@ -25,14 +38,6 @@ export function getCurrentSymbol(): string | undefined {
|
||||
return currentSymbol;
|
||||
}
|
||||
|
||||
export function setSymbols(newSymbols: Record<string, string>): void {
|
||||
symbols = newSymbols;
|
||||
}
|
||||
|
||||
export function getSymbolUrl(symbol: string): string | undefined {
|
||||
return sharedGetSymbolUrl(symbol, symbols);
|
||||
}
|
||||
|
||||
export function unknownSymbolMessage(link: string, symbol: string): string {
|
||||
return `WARNING: {@link ${link}} is invalid, ${symbol} or ${currentSymbol}.${symbol} is unknown in this context`;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,9 @@ import {SectionDescription} from './section-description';
|
||||
import {SectionUsageNotes} from './section-usage-notes';
|
||||
import {SectionApi} from './section-api';
|
||||
import {SectionHeading} from './section-heading';
|
||||
import {codeToHtml} from '../shiki/shiki.mjs';
|
||||
import {RawHtml} from './raw-html';
|
||||
import {DeprecationWarning} from './deprecation-warning';
|
||||
import {codeToHtml} from '../../../shared/shiki.mjs';
|
||||
import {getHighlighterInstance} from '../shiki/shiki.mjs';
|
||||
|
||||
/** Component to render a class API reference document. */
|
||||
export function ClassReference(entry: ClassEntryRenderable | PipeEntryRenderable) {
|
||||
@@ -34,13 +33,7 @@ export function ClassReference(entry: ClassEntryRenderable | PipeEntryRenderable
|
||||
<>
|
||||
<div className={SECTION_CONTAINER + ' docs-reference-api-section'}>
|
||||
<SectionHeading name="Pipe usage" />
|
||||
<RawHtml
|
||||
value={codeToHtml(
|
||||
getHighlighterInstance(),
|
||||
(entry as PipeEntry).usage,
|
||||
'angular-html',
|
||||
)}
|
||||
/>
|
||||
<RawHtml value={codeToHtml((entry as PipeEntry).usage, 'angular-html')} />
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -24,28 +24,31 @@ export function CliCard(props: {card: CliCardRenderable}) {
|
||||
{item.aliases?.map((alias) => (
|
||||
<div class="docs-reference-option-aliases">
|
||||
<span>Alias</span>
|
||||
<code>{alias}</code>
|
||||
<code>{alias} </code>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div dangerouslySetInnerHTML={{__html: item.description}}></div>
|
||||
</div>
|
||||
<div class="docs-reference-type-and-default">
|
||||
{/* Display the type expected for the option and the enum values if there are some. */}
|
||||
<span>Value Type</span>
|
||||
<code>{item.type}</code>
|
||||
{/* Display the enum values if there are some, else the type expected for the option */}
|
||||
{item.enum ? (
|
||||
<>
|
||||
<span>Allowed Values</span>
|
||||
{item.enum.map((val, i, items) => (
|
||||
<>
|
||||
<code>{val}</code>
|
||||
{i < items.length - 1 && ', '}
|
||||
</>
|
||||
))}
|
||||
<span>
|
||||
{item.enum.map((val, i, items) => (
|
||||
<>
|
||||
<code>{val}</code>
|
||||
{i < items.length - 1 && ', '}
|
||||
</>
|
||||
))}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<></>
|
||||
<>
|
||||
<span>Value Type</span>
|
||||
<code>{item.type}</code>
|
||||
</>
|
||||
)}
|
||||
{/* Default Value */}
|
||||
{item.default !== undefined ? <span>Default</span> : <></>}
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
*/
|
||||
|
||||
import {h} from 'preact';
|
||||
import {getSymbolUrl} from '../symbol-context.mjs';
|
||||
import {getModuleName} from '../symbol-context.mjs';
|
||||
import {getLinkToModule} from '../transforms/url-transforms.mjs';
|
||||
|
||||
const symbolRegex = /([a-zA-Z_$][a-zA-Z_$0-9\.]*)/;
|
||||
|
||||
@@ -22,8 +23,11 @@ export function CodeSymbol(props: {code: string}) {
|
||||
// Every even index is a non-match when the regex has 1 capturing group
|
||||
if (index % 2 === 0) return rawSymbol;
|
||||
|
||||
const url = getSymbolUrl(rawSymbol);
|
||||
if (url) {
|
||||
let [symbol, subSymbol] = rawSymbol.split('.'); // Also takes care of methods, enum value etc.
|
||||
const moduleName = getModuleName(symbol);
|
||||
|
||||
if (moduleName) {
|
||||
const url = getLinkToModule(moduleName, symbol, subSymbol);
|
||||
return <a href={url}>{rawSymbol}</a>;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,11 @@
|
||||
|
||||
import {h} from 'preact';
|
||||
import {RawHtml} from './raw-html';
|
||||
import {codeToHtml} from '../../../shared/shiki.mjs';
|
||||
import {get} from 'http';
|
||||
import {getHighlighterInstance} from '../shiki/shiki.mjs';
|
||||
import {codeToHtml} from '../shiki/shiki.mjs';
|
||||
|
||||
/** Component to render a header of the CLI page. */
|
||||
export function HighlightTypeScript(props: {code: string}) {
|
||||
const result = codeToHtml(getHighlighterInstance(), props.code, 'typescript');
|
||||
const result = codeToHtml(props.code, 'typescript');
|
||||
const withScrollTrack = result.replace(/^(<pre class="shiki)/, '$1 docs-mini-scroll-track');
|
||||
|
||||
return <RawHtml value={withScrollTrack} className="docs-code" />;
|
||||
|
||||
@@ -18,17 +18,17 @@ ts_project(
|
||||
],
|
||||
),
|
||||
deps = [
|
||||
"//adev:node_modules/@bazel/runfiles",
|
||||
"//adev:node_modules/@types/jsdom",
|
||||
"//adev:node_modules/jsdom",
|
||||
"//adev/shared-docs/pipeline/api-gen/rendering:render_api_to_html_lib",
|
||||
"//adev/shared-docs/pipeline/shared:shiki",
|
||||
"//adev/shared-docs/pipeline/api-gen/rendering:render_api_to_html_lib_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
zoneless_jasmine_test(
|
||||
name = "unit_tests",
|
||||
data = [
|
||||
":unit_test_lib",
|
||||
":unit_test_lib_rjs",
|
||||
"//adev:node_modules/jsdom",
|
||||
] + glob([
|
||||
"**/*.json",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user