Skip to content

Commit d278d94

Browse files
devversionalan-agius4
authored andcommitted
build: migrate @angular/cli tests to use rules_js
Integrates `@angular/cli` into the pnpm workspace and wires up the native `rules_js` rules. One nice benefits that highlight here: - `resolve` runtime dependency is only installed in the CLI folder, and we can pull it from there. --> Locally managed deps! :yay:
1 parent 676ce57 commit d278d94

File tree

9 files changed

+272
-238
lines changed

9 files changed

+272
-238
lines changed

Diff for: .aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-2023857461
55
package.json=750671300
6-
packages/angular_devkit/architect/package.json=-107274537
6+
packages/angular/cli/package.json=349838588
7+
packages/angular_devkit/architect/package.json=-1496633956
78
packages/angular_devkit/core/package.json=339935828
8-
pnpm-lock.yaml=-1484082178
9-
pnpm-workspace.yaml=-1853274682
9+
packages/angular_devkit/schematics/package.json=673943597
10+
packages/schematics/angular/package.json=251715148
11+
pnpm-lock.yaml=1860194410
12+
pnpm-workspace.yaml=1839001260
1013
yarn.lock=1185228888

Diff for: WORKSPACE

+3
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ npm_translate_lock(
186186
data = [
187187
"//:package.json",
188188
"//:pnpm-workspace.yaml",
189+
"//packages/angular/cli:package.json",
189190
"//packages/angular_devkit/architect:package.json",
190191
"//packages/angular_devkit/core:package.json",
192+
"//packages/angular_devkit/schematics:package.json",
193+
"//packages/schematics/angular:package.json",
191194
],
192195
npmrc = "//:.npmrc",
193196
patches = {

Diff for: packages/angular/cli/BUILD.bazel

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
# Use of this source code is governed by an MIT-style license that can be
44
# found in the LICENSE file at https://angular.dev/license
55

6-
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
7-
load("//tools:defaults2.bzl", "npm_package", "ts_project")
6+
load("@npm2//:defs.bzl", "npm_link_all_packages")
7+
load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project")
88
load("//tools:ng_cli_schema_generator.bzl", "cli_json_schema")
99
load("//tools:ts_json_schema.bzl", "ts_json_schema")
1010

1111
licenses(["notice"])
1212

1313
package(default_visibility = ["//visibility:public"])
1414

15+
npm_link_all_packages()
16+
1517
RUNTIME_ASSETS = glob(
1618
include = [
1719
"bin/**/*",
@@ -43,6 +45,10 @@ ts_project(
4345
data = RUNTIME_ASSETS,
4446
module_name = "@angular/cli",
4547
deps = [
48+
":node_modules/@angular-devkit/architect",
49+
":node_modules/@angular-devkit/core",
50+
":node_modules/@angular-devkit/schematics",
51+
":node_modules/resolve",
4652
"//:node_modules/@angular/core",
4753
"//:node_modules/@inquirer/prompts",
4854
"//:node_modules/@listr2/prompt-adapter-inquirer",
@@ -62,14 +68,8 @@ ts_project(
6268
"//:node_modules/npm-pick-manifest",
6369
"//:node_modules/pacote",
6470
"//:node_modules/semver",
71+
"//:node_modules/symbol-observable",
6572
"//:node_modules/yargs",
66-
"//packages/angular_devkit/architect:architect_rjs",
67-
"//packages/angular_devkit/architect/node:node_rjs",
68-
"//packages/angular_devkit/core:core_rjs",
69-
"//packages/angular_devkit/core/node:node_rjs",
70-
"//packages/angular_devkit/schematics:schematics_rjs",
71-
"//packages/angular_devkit/schematics/tasks:tasks_rjs",
72-
"//packages/angular_devkit/schematics/tools:tools_rjs",
7373
],
7474
)
7575

@@ -148,9 +148,9 @@ ts_project(
148148
],
149149
)
150150

151-
jasmine_node_test(
151+
jasmine_test(
152152
name = "angular-cli_test",
153-
srcs = [":angular-cli_test_lib"],
153+
data = [":angular-cli_test_lib_rjs"],
154154
)
155155

156156
genrule(

Diff for: packages/angular/cli/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
},
2323
"homepage": "https://github.com/angular/angular-cli",
2424
"dependencies": {
25-
"@angular-devkit/architect": "0.0.0-EXPERIMENTAL-PLACEHOLDER",
26-
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
27-
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
25+
"@angular-devkit/architect": "workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER",
26+
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
27+
"@angular-devkit/schematics": "workspace:0.0.0-PLACEHOLDER",
2828
"@inquirer/prompts": "7.2.1",
2929
"@listr2/prompt-adapter-inquirer": "2.0.18",
30-
"@schematics/angular": "0.0.0-PLACEHOLDER",
30+
"@schematics/angular": "workspace:0.0.0-PLACEHOLDER",
3131
"@yarnpkg/lockfile": "1.1.0",
3232
"ini": "5.0.0",
3333
"jsonc-parser": "3.3.1",

Diff for: packages/angular_devkit/architect/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "src/index.js",
77
"typings": "src/index.d.ts",
88
"dependencies": {
9-
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
9+
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
1010
"rxjs": "7.8.1"
1111
},
1212
"builders": "./builders/builders.json"

Diff for: packages/angular_devkit/schematics/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"schematics"
1414
],
1515
"dependencies": {
16-
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
16+
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
1717
"jsonc-parser": "3.3.1",
1818
"magic-string": "0.30.17",
1919
"ora": "5.4.1",

Diff for: packages/schematics/angular/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
},
1818
"schematics": "./collection.json",
1919
"dependencies": {
20-
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
21-
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
20+
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
21+
"@angular-devkit/schematics": "workspace:0.0.0-PLACEHOLDER",
2222
"jsonc-parser": "3.3.1"
2323
}
2424
}

0 commit comments

Comments
 (0)