Skip to content

Commit da08259

Browse files
devversionalan-agius4
authored andcommitted
build: migrate @angular-devkit/build-webpack tests to rules_js
Migrates the `@angular-devkit/build-webpack` jasmine tests to `rules_js`. This requires wiring up in the pnpm workspace. Additionally `typescript` is added as it was missing as a "peer dependency" at runtime for `@ngtools/webpack`. This is expected, and we're already adding other peer deps before this change.
1 parent cd775a7 commit da08259

File tree

7 files changed

+64
-285
lines changed

7 files changed

+64
-285
lines changed

Diff for: .aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ packages/angular/cli/package.json=349838588
77
packages/angular/pwa/package.json=-1352285148
88
packages/angular_devkit/architect/package.json=-1496633956
99
packages/angular_devkit/architect_cli/package.json=1551210941
10+
packages/angular_devkit/build_webpack/package.json=373950017
1011
packages/angular_devkit/core/package.json=339935828
1112
packages/angular_devkit/schematics/package.json=673943597
13+
packages/ngtools/webpack/package.json=-942726894
1214
packages/schematics/angular/package.json=251715148
13-
pnpm-lock.yaml=1949888233
14-
pnpm-workspace.yaml=-818108966
15+
pnpm-lock.yaml=-1982621849
16+
pnpm-workspace.yaml=634423855
1517
yarn.lock=1185228888

Diff for: WORKSPACE

+2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ npm_translate_lock(
190190
"//packages/angular/pwa:package.json",
191191
"//packages/angular_devkit/architect:package.json",
192192
"//packages/angular_devkit/architect_cli:package.json",
193+
"//packages/angular_devkit/build_webpack:package.json",
193194
"//packages/angular_devkit/core:package.json",
194195
"//packages/angular_devkit/schematics:package.json",
196+
"//packages/ngtools/webpack:package.json",
195197
"//packages/schematics/angular:package.json",
196198
],
197199
npmrc = "//:.npmrc",

Diff for: packages/angular_devkit/build_webpack/BUILD.bazel

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
# found in the LICENSE file at https://angular.dev/license
55

66
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
7-
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
8-
load("//tools:defaults2.bzl", "npm_package", "ts_project")
7+
load("@npm2//:defs.bzl", "npm_link_all_packages")
8+
load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project")
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
ts_json_schema(
1618
name = "webpack_schema",
1719
src = "src/builders/webpack/schema.json",
@@ -45,12 +47,12 @@ ts_project(
4547
data = RUNTIME_ASSETS,
4648
module_name = "@angular-devkit/build-webpack",
4749
deps = [
50+
":node_modules/@angular-devkit/architect",
51+
":node_modules/@angular-devkit/core",
4852
"//:node_modules/@types/node",
4953
"//:node_modules/rxjs",
5054
"//:node_modules/webpack",
5155
"//:node_modules/webpack-dev-server",
52-
"//packages/angular_devkit/architect:architect_rjs",
53-
"//packages/angular_devkit/core:core_rjs",
5456
],
5557
)
5658

@@ -69,27 +71,25 @@ ts_project(
6971
),
7072
deps = [
7173
":build_webpack_rjs",
74+
":node_modules/@angular-devkit/architect",
75+
":node_modules/@angular-devkit/core",
76+
":node_modules/@ngtools/webpack",
7277
"//:node_modules/@types/jasmine",
73-
"//packages/angular_devkit/architect:architect_rjs",
74-
"//packages/angular_devkit/architect/node:node_rjs",
75-
"//packages/angular_devkit/architect/testing:testing_rjs",
76-
"//packages/angular_devkit/core:core_rjs",
77-
"//packages/angular_devkit/core/node:node_rjs",
78-
"//packages/ngtools/webpack:webpack_rjs",
7978
],
8079
)
8180

82-
jasmine_node_test(
81+
jasmine_test(
8382
name = "build_webpack_test",
84-
srcs = [":build_webpack_test_lib"],
8583
data = [
84+
"build_webpack_test_lib_rjs",
8685
"//:node_modules/@angular/common",
8786
"//:node_modules/@angular/compiler",
8887
"//:node_modules/@angular/compiler-cli",
8988
"//:node_modules/@angular/core",
9089
"//:node_modules/@angular/platform-browser",
9190
"//:node_modules/@angular/platform-browser-dynamic",
9291
"//:node_modules/tslib",
92+
"//:node_modules/typescript",
9393
"//:node_modules/zone.js",
9494
],
9595
)

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
"./*.js": "./*.js"
1717
},
1818
"dependencies": {
19-
"@angular-devkit/architect": "0.0.0-EXPERIMENTAL-PLACEHOLDER",
19+
"@angular-devkit/architect": "workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER",
2020
"rxjs": "7.8.1"
2121
},
2222
"devDependencies": {
23-
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
23+
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
24+
"@ngtools/webpack": "workspace:0.0.0-PLACEHOLDER",
2425
"webpack": "5.97.1"
2526
},
2627
"peerDependencies": {

Diff for: packages/ngtools/webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"webpack": "^5.54.0"
2727
},
2828
"devDependencies": {
29-
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
29+
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
3030
"@angular/compiler": "19.1.0-rc.0",
3131
"@angular/compiler-cli": "19.1.0-rc.0",
3232
"typescript": "5.7.3",

0 commit comments

Comments
 (0)