Skip to content

Commit 9dd3f03

Browse files
authored
Further clean-up rules_nodejs npm workspace and remove yarn.lock (#29779)
* build: disconnect `@npm` workspace from main project This will speed up significantly as we don't need to fetch all dependencies again just for the `@npm` repository that is at this point only leveraged by the `ng_package` rule for some of its dependencies. This commit allows us to drop the `yarn.lock` and Aspect lock files, and allows us to independently migrate `ng_package` to `rules_js`. It also allows us to drop the `_rjs` TS interop layer in follow-up commits. * build: drop `_rjs` suffix from `ts_project` targets We don't need the `ts_project` interop in principle at this point. We only have one remaining instance left for the SSR `ng_package` integration. This commit cleans up all usages. * build: remove yarn * build: avoid duplicated dependencies at top-level `rules_js` seems to be sensitive if there are similar versions of the same package installed, but with differently matched peer dependencies. This is fine because we can (and should long-term) move those dependencies to their package-local `package.json` files. This commit unblocks the migration and highlights how we can move deps to the individual packages in the future. * build: update checkout github action This will allow us to use pnpm. * build: update node to avoid strict-engines error caused by `npm` Avoids: ``` Lockfile is up to date, resolution step is skipped  ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version) Your Node version is incompatible with "[email protected]". Expected version: ^20.17.0 || >=22.9.0 Got: v20.11.1 ``` Note that we won't update the WORKSPACE test version as that would mean we need to update the Node engines for shipped packages; and we can't do this right now without introducing a breaking change. * build: fix missing dependency for spec bundling The beasties JS sources weren't available for bundling in the `bazel-bin`, and this surfaced in RBE. This commit fixes this.
1 parent a05d93a commit 9dd3f03

File tree

77 files changed

+11997
-26690
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+11997
-26690
lines changed

Diff for: .aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

-23
This file was deleted.

Diff for: .bazelrc

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ build --nolegacy_external_runfiles
4040
# in Bazel 0.21.0 but turned off again in 0.22.0. Follow
4141
# https://github.com/bazelbuild/bazel/issues/7026 for more details.
4242
# This flag is needed to so that the bazel cache is not invalidated
43-
# when running bazel via `yarn bazel`.
43+
# when running bazel via `pnpm bazel`.
4444
# See https://github.com/angular/angular/issues/27514.
4545
build --incompatible_strict_action_env
4646
run --incompatible_strict_action_env
@@ -83,14 +83,14 @@ test:saucelabs --define=KARMA_WEB_TEST_MODE=SL_REQUIRED
8383
# Releases should always be stamped with version control info
8484
# This command assumes node on the path and is a workaround for
8585
# https://github.com/bazelbuild/bazel/issues/4802
86-
build:release --workspace_status_command="yarn ng-dev release build-env-stamp --mode=release"
86+
build:release --workspace_status_command="pnpm -s ng-dev release build-env-stamp --mode=release"
8787
build:release --stamp
8888

89-
build:snapshot --workspace_status_command="yarn ng-dev release build-env-stamp --mode=snapshot"
89+
build:snapshot --workspace_status_command="pnpm -s ng-dev release build-env-stamp --mode=snapshot"
9090
build:snapshot --stamp
9191
build:snapshot --//:enable_snapshot_repo_deps
9292

93-
build:e2e --workspace_status_command="yarn ng-dev release build-env-stamp --mode=release"
93+
build:e2e --workspace_status_command="pnpm -s ng-dev release build-env-stamp --mode=release"
9494
build:e2e --stamp
9595
test:e2e --test_timeout=3600 --experimental_ui_max_stdouterr_bytes=2097152
9696

Diff for: .github/shared-actions/windows-bazel-test/action.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,21 @@ runs:
2727
with:
2828
wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))'
2929

30+
- name: Installing pnpm (in WSL)
31+
run: npm install -g pnpm@9
32+
shell: wsl-bash {0}
33+
3034
- name: Install node modules in WSL (re-using from previous install/cache restore)
3135
run: |
3236
cd ${{steps.init_wsl.outputs.repo_path}}
33-
yarn install --immutable
37+
pnpm install --frozen-lockfile
3438
shell: wsl-bash {0}
3539

3640
- name: Build test binary for Windows (inside WSL)
3741
shell: wsl-bash {0}
3842
run: |
3943
cd ${{steps.init_wsl.outputs.repo_path}}
40-
yarn bazel \
44+
pnpm bazel \
4145
build --config=e2e //tests/legacy-cli:${{inputs.test_target_name}} --platforms=tools:windows_x64
4246
env:
4347
# See: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows

Diff for: .github/workflows/ci.yml

+30-30
Original file line numberDiff line numberDiff line change
@@ -21,51 +21,51 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Initialize environment
24-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
24+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
2525
- name: Install node modules
26-
run: yarn install --immutable
26+
run: pnpm install --frozen-lockfile
2727
- name: Generate JSON schema types
2828
# Schema types are required to correctly lint the TypeScript code
29-
run: yarn admin build-schema
29+
run: pnpm admin build-schema
3030
- name: Run ESLint
31-
run: yarn lint --cache-strategy content
31+
run: pnpm lint --cache-strategy content
3232
- name: Validate NgBot Configuration
33-
run: yarn ng-dev ngbot verify
33+
run: pnpm ng-dev ngbot verify
3434
- name: Validate Circular Dependencies
35-
run: yarn ts-circular-deps check
35+
run: pnpm ts-circular-deps check
3636
- name: Run Validation
37-
run: yarn admin validate
37+
run: pnpm admin validate
3838
- name: Check tooling setup
39-
run: yarn check-tooling-setup
39+
run: pnpm check-tooling-setup
4040

4141
build:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Initialize environment
45-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
45+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
4646
- name: Setup Bazel
4747
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
4848
- name: Setup Bazel RBE
4949
uses: angular/dev-infra/github-actions/bazel/configure-remote@f2a610b26cd7a451eddd50eb071dc495e3346a80
5050
- name: Install node modules
51-
run: yarn install --immutable
51+
run: pnpm install --frozen-lockfile
5252
- name: Build release targets
53-
run: yarn ng-dev release build
53+
run: pnpm ng-dev release build
5454

5555
test:
5656
needs: build
5757
runs-on: ubuntu-latest
5858
steps:
5959
- name: Initialize environment
60-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
60+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
6161
- name: Setup Bazel
6262
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
6363
- name: Setup Bazel RBE
6464
uses: angular/dev-infra/github-actions/bazel/configure-remote@f2a610b26cd7a451eddd50eb071dc495e3346a80
6565
- name: Install node modules
66-
run: yarn install --immutable
66+
run: pnpm install --frozen-lockfile
6767
- name: Run module and package tests
68-
run: yarn bazel test //modules/... //packages/...
68+
run: pnpm bazel test //modules/... //packages/...
6969
env:
7070
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'
7171

@@ -81,15 +81,15 @@ jobs:
8181
runs-on: ${{ matrix.os }}
8282
steps:
8383
- name: Initialize environment
84-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
84+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
8585
- name: Install node modules
86-
run: yarn install --immutable
86+
run: pnpm install --frozen-lockfile
8787
- name: Setup Bazel
8888
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
8989
- name: Setup Bazel RBE
9090
uses: angular/dev-infra/github-actions/bazel/configure-remote@f2a610b26cd7a451eddd50eb071dc495e3346a80
9191
- name: Run CLI E2E tests
92-
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
92+
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
9393

9494
e2e_windows:
9595
strategy:
@@ -102,7 +102,7 @@ jobs:
102102
runs-on: ${{ matrix.os }}
103103
steps:
104104
- name: Initialize environment
105-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
105+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
106106
- name: Run CLI E2E tests
107107
uses: ./.github/shared-actions/windows-bazel-test
108108
with:
@@ -123,15 +123,15 @@ jobs:
123123
runs-on: ${{ matrix.os }}
124124
steps:
125125
- name: Initialize environment
126-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
126+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
127127
- name: Install node modules
128-
run: yarn install --immutable
128+
run: pnpm install --frozen-lockfile
129129
- name: Setup Bazel
130130
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
131131
- name: Setup Bazel RBE
132132
uses: angular/dev-infra/github-actions/bazel/configure-remote@f2a610b26cd7a451eddd50eb071dc495e3346a80
133133
- name: Run CLI E2E tests
134-
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
134+
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
135135

136136
e2e-snapshots:
137137
needs: test
@@ -145,15 +145,15 @@ jobs:
145145
runs-on: ${{ matrix.os }}
146146
steps:
147147
- name: Initialize environment
148-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
148+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
149149
- name: Install node modules
150-
run: yarn install --immutable
150+
run: pnpm install --frozen-lockfile
151151
- name: Setup Bazel
152152
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
153153
- name: Setup Bazel RBE
154154
uses: angular/dev-infra/github-actions/bazel/configure-remote@f2a610b26cd7a451eddd50eb071dc495e3346a80
155155
- name: Run CLI E2E tests
156-
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
156+
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
157157

158158
browsers:
159159
needs: build
@@ -163,9 +163,9 @@ jobs:
163163
SAUCE_TUNNEL_IDENTIFIER: angular-cli-${{ github.workflow }}-${{ github.run_number }}
164164
steps:
165165
- name: Initialize environment
166-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
166+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
167167
- name: Install node modules
168-
run: yarn install --immutable
168+
run: pnpm install --frozen-lockfile
169169
- name: Setup Bazel
170170
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
171171
- name: Setup Bazel RBE
@@ -182,7 +182,7 @@ jobs:
182182
run: |
183183
./scripts/saucelabs/start-tunnel.sh &
184184
./scripts/saucelabs/wait-for-tunnel.sh
185-
yarn bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
185+
pnpm bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
186186
./scripts/saucelabs/stop-tunnel.sh
187187
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
188188
if: ${{ failure() }}
@@ -197,11 +197,11 @@ jobs:
197197
CIRCLE_BRANCH: ${{ github.ref_name }}
198198
steps:
199199
- name: Initialize environment
200-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
200+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
201201
- name: Install node modules
202-
run: yarn install --immutable
202+
run: pnpm install --frozen-lockfile
203203
- name: Setup Bazel
204204
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
205-
- run: yarn admin snapshots --verbose
205+
- run: pnpm admin snapshots --verbose
206206
env:
207207
SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }}

Diff for: .github/workflows/perf.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
workflows: ${{ steps.workflows.outputs.workflows }}
2424
steps:
2525
- name: Initialize environment
26-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
26+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
2727
- name: Install node modules
28-
run: yarn install --immutable
28+
run: pnpm install --frozen-lockfile
2929
- id: workflows
30-
run: echo "workflows=$(yarn ng-dev perf workflows --list)" >> "$GITHUB_OUTPUT"
30+
run: echo "workflows=$(pnpm -s ng-dev perf workflows --list)" >> "$GITHUB_OUTPUT"
3131

3232
workflow:
3333
timeout-minutes: 30
@@ -38,11 +38,11 @@ jobs:
3838
workflow: ${{ fromJSON(needs.list.outputs.workflows) }}
3939
steps:
4040
- name: Initialize environment
41-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f2a610b26cd7a451eddd50eb071dc495e3346a80
41+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b79ac7f5d6689becb7f2d559affbab5afb361389
4242
- name: Setup Bazel
4343
uses: angular/dev-infra/github-actions/bazel/setup@f2a610b26cd7a451eddd50eb071dc495e3346a80
4444
- name: Install node modules
45-
run: yarn install --immutable
45+
run: pnpm install --frozen-lockfile
4646
# We utilize the google-github-actions/auth action to allow us to get an active credential using workflow
4747
# identity federation. This allows us to request short lived credentials on demand, rather than storing
4848
# credentials in secrets long term. More information can be found at:
@@ -52,4 +52,4 @@ jobs:
5252
project_id: 'internal-200822'
5353
workload_identity_provider: 'projects/823469418460/locations/global/workloadIdentityPools/measurables-tracking/providers/angular'
5454
service_account: '[email protected]'
55-
- run: yarn ng-dev perf workflows --name ${{ matrix.workflow }} --commit-sha ${{github.sha}}
55+
- run: pnpm ng-dev perf workflows --name ${{ matrix.workflow }} --commit-sha ${{github.sha}}

0 commit comments

Comments
 (0)