Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 50611cd

Browse files
devversionjkrems
authored andcommitted
build: migrate @angular/ssr to ts_project
Migrates `@angular/ssr` to `ts_project`. Possible after various upstream fixes for `ng_package` and interop changes.
1 parent 4b33c6e commit 50611cd

File tree

16 files changed

+129
-100
lines changed

16 files changed

+129
-100
lines changed

‎.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-2023857461
5-
package.json=-1251203040
6-
pnpm-lock.yaml=2007346593
5+
package.json=-707512896
6+
pnpm-lock.yaml=-2119082430
77
pnpm-workspace.yaml=1711114604
8-
yarn.lock=-279910630
8+
yarn.lock=1132326811

‎BUILD.bazel‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ rules_js_tsconfig(
3535
],
3636
)
3737

38+
rules_js_tsconfig(
39+
name = "build-tsconfig-angular",
40+
src = "tsconfig-build-ng.json",
41+
deps = [
42+
"tsconfig.json",
43+
],
44+
)
45+
3846
rules_js_tsconfig(
3947
name = "test-tsconfig",
4048
src = "tsconfig-test.json",
4149
deps = [
4250
"tsconfig.json",
51+
"//:root_modules/@types/jasmine",
4352
"//:root_modules/@types/node",
4453
],
4554
)

‎WORKSPACE‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ yarn_install(
136136
data = [
137137
"//:.yarn/releases/yarn-4.5.0.cjs",
138138
"//:.yarnrc.yml",
139-
"//:patches/@angular+bazel+19.0.0-next.7.patch",
139+
"//:patches/@angular+bazel+19.1.0-next.4.patch",
140140
"//:patches/@bazel+concatjs+5.8.1.patch",
141141
"//:patches/@bazel+jasmine+5.8.1.patch",
142142
],
@@ -221,6 +221,6 @@ rules_ts_dependencies(
221221

222222
http_file(
223223
name = "tsc_worker",
224-
sha256 = "",
225-
urls = ["https://raw.githubusercontent.com/devversion/rules_angular/a270a74d1e64577bddba96a5484c7c5d2c5d2770/dist/worker.mjs"],
224+
sha256 = "5a5c46846ecda83e05b9da26f1672ad51c59bce08fed88419850d0e29c993b30",
225+
urls = ["https://raw.githubusercontent.com/devversion/rules_angular/4b7532ba2b29078d005899cd15b415593d03cceb/dist/worker.mjs"],
226226
)

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"devDependencies": {
4545
"@ampproject/remapping": "2.3.0",
4646
"@angular/animations": "19.0.0",
47-
"@angular/bazel": "https://github.com/angular/bazel-builds.git#07617f0f8540d27f8895b1820a6f994e1e5b7277",
47+
"@angular/bazel": "https://github.com/angular/bazel-builds.git#cfd7a06c2f972fcef59262995d232e2846b536a2",
4848
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a35ad7f4e30ae1fc531517867efcae89cce5afa2",
4949
"@angular/cdk": "19.0.0-rc.3",
5050
"@angular/common": "19.0.0",

‎packages/angular/ssr/BUILD.bazel‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
22
load("@rules_pkg//:pkg.bzl", "pkg_tar")
3-
load("//tools:defaults.bzl", "ng_package", "ts_library")
3+
load("//tools:defaults.bzl", "ng_package")
4+
load("//tools:interop.bzl", "ts_project")
45

56
package(default_visibility = ["//visibility:public"])
67

7-
ts_library(
8+
ts_project(
89
name = "ssr",
9-
package_name = "@angular/ssr",
1010
srcs = glob(
1111
include = [
1212
"*.ts",
@@ -16,15 +16,23 @@ ts_library(
1616
"**/*_spec.ts",
1717
],
1818
),
19+
args = [
20+
"--lib",
21+
"dom,es2020",
22+
],
23+
data = [
24+
"//packages/angular/ssr/third_party/beasties:beasties_bundled",
25+
],
1926
module_name = "@angular/ssr",
20-
tsconfig = "//:tsconfig-build-ng",
27+
source_map = True,
28+
tsconfig = "//:build-tsconfig-angular",
2129
deps = [
22-
"//packages/angular/ssr/third_party/beasties:bundled_beasties_lib",
23-
"@npm//@angular/common",
24-
"@npm//@angular/core",
25-
"@npm//@angular/platform-server",
26-
"@npm//@angular/router",
27-
"@npm//tslib",
30+
"//:root_modules/@angular/common",
31+
"//:root_modules/@angular/core",
32+
"//:root_modules/@angular/platform-server",
33+
"//:root_modules/@angular/router",
34+
"//:root_modules/tslib",
35+
"//packages/angular/ssr/third_party/beasties:beasties_dts",
2836
],
2937
)
3038

@@ -33,7 +41,7 @@ ng_package(
3341
package_name = "@angular/ssr",
3442
srcs = [
3543
":package.json",
36-
"//packages/angular/ssr/third_party/beasties:bundled_beasties_lib",
44+
"//packages/angular/ssr/third_party/beasties:beasties_bundled",
3745
],
3846
externals = [
3947
"@angular/ssr",
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
load("//tools:defaults.bzl", "ts_library")
1+
load("//tools:interop.bzl", "ts_project")
22

33
package(default_visibility = ["//visibility:public"])
44

5-
ts_library(
5+
ts_project(
66
name = "node",
77
srcs = glob(
88
[
99
"*.ts",
1010
"src/**/*.ts",
1111
],
1212
),
13+
args = [
14+
"--types",
15+
"node",
16+
],
1317
module_name = "@angular/ssr/node",
18+
source_map = True,
19+
tsconfig = "//:build-tsconfig-angular",
1420
deps = [
15-
"//packages/angular/ssr",
16-
"@npm//@angular/core",
17-
"@npm//@angular/platform-server",
18-
"@npm//@types/node",
21+
"//:root_modules/@angular/core",
22+
"//:root_modules/@angular/platform-server",
23+
"//:root_modules/@types/node",
24+
"//packages/angular/ssr:ssr_rjs",
1925
],
2026
)
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
1+
load("@npm//@angular/build-tooling/bazel/spec-bundling:index.bzl", "spec_bundle")
12
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
2-
load("//tools:defaults.bzl", "ts_library")
3+
load("//tools:interop.bzl", "ts_project")
34

4-
ts_library(
5+
ts_project(
56
name = "unit_test_lib",
67
testonly = True,
78
srcs = glob(["**/*_spec.ts"]),
89
deps = [
9-
"//packages/angular/ssr/node",
10+
"//packages/angular/ssr/node:node_rjs",
11+
],
12+
)
13+
14+
# TODO: Clean this up when this repo runs ESM consistently.
15+
spec_bundle(
16+
name = "esm_tests_bundled",
17+
downlevel_async_await = False,
18+
platform = "node",
19+
run_angular_linker = False,
20+
deps = [
21+
":unit_test_lib",
1022
],
1123
)
1224

1325
jasmine_node_test(
1426
name = "test",
1527
deps = [
16-
":unit_test_lib",
28+
":esm_tests_bundled",
1729
],
1830
)

‎packages/angular/ssr/schematics/BUILD.bazel‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# found in the LICENSE file at https://angular.dev/license
55

66
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
7-
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
7+
load("//tools:defaults.bzl", "pkg_npm")
8+
load("//tools:interop.bzl", "ts_project")
89
load("//tools:ts_json_schema.bzl", "ts_json_schema")
910

1011
licenses(["notice"])
@@ -44,9 +45,8 @@ filegroup(
4445
),
4546
)
4647

47-
ts_library(
48+
ts_project(
4849
name = "schematics",
49-
package_name = "@angular/ssr/schematics",
5050
srcs = glob(
5151
include = ["**/*.ts"],
5252
exclude = [
@@ -59,13 +59,14 @@ ts_library(
5959
for (src, _) in ALL_SCHEMA_TARGETS
6060
],
6161
data = [":schematics_assets"],
62+
module_name = "@angular/ssr/schematics",
6263
deps = [
63-
"//packages/angular_devkit/schematics",
64-
"//packages/schematics/angular",
64+
"//packages/angular_devkit/schematics:schematics_rjs",
65+
"//packages/schematics/angular:angular_rjs",
6566
],
6667
)
6768

68-
ts_library(
69+
ts_project(
6970
name = "ssr_schematics_test_lib",
7071
testonly = True,
7172
srcs = glob(
@@ -77,12 +78,10 @@ ts_library(
7778
"node_modules/**",
7879
],
7980
),
80-
# @external_begin
8181
deps = [
82-
":schematics",
83-
"//packages/angular_devkit/schematics/testing",
82+
":schematics_rjs",
83+
"//packages/angular_devkit/schematics/testing:testing_rjs",
8484
],
85-
# @external_end
8685
)
8786

8887
jasmine_node_test(
Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,35 @@
11
load("@npm//@angular/build-tooling/bazel/spec-bundling:index.bzl", "spec_bundle")
22
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
3-
load("//tools:defaults.bzl", "ts_library")
3+
load("//tools:interop.bzl", "ts_project")
44

5-
ESM_TESTS = [
6-
"app_spec.ts",
7-
"app-engine_spec.ts",
8-
"routes/router_spec.ts",
9-
"routes/route-tree_spec.ts",
10-
"routes/ng-routes_spec.ts",
11-
]
12-
13-
ts_library(
5+
ts_project(
146
name = "unit_test_lib",
157
testonly = True,
168
srcs = glob(
17-
include = ["**/*_spec.ts"],
18-
exclude = ESM_TESTS + ["npm_package/**"],
9+
include = ["**/*.ts"],
1910
),
2011
deps = [
21-
"//packages/angular/ssr",
22-
],
23-
)
24-
25-
ts_library(
26-
name = "unit_test_with_esm_deps_lib",
27-
testonly = True,
28-
srcs = ESM_TESTS + ["testing-utils.ts"],
29-
deps = [
30-
"//packages/angular/ssr",
31-
"@npm//@angular/common",
32-
"@npm//@angular/compiler",
33-
"@npm//@angular/core",
34-
"@npm//@angular/platform-browser",
35-
"@npm//@angular/platform-server",
36-
"@npm//@angular/router",
12+
"//:root_modules/@angular/common",
13+
"//:root_modules/@angular/compiler",
14+
"//:root_modules/@angular/core",
15+
"//:root_modules/@angular/platform-browser",
16+
"//:root_modules/@angular/platform-server",
17+
"//:root_modules/@angular/router",
18+
"//packages/angular/ssr:ssr_rjs",
3719
],
3820
)
3921

4022
spec_bundle(
41-
name = "unit_test_with_esm_deps_lib_bundled",
23+
name = "esm_tests_bundled",
4224
downlevel_async_await = False,
4325
platform = "node",
4426
run_angular_linker = False,
4527
deps = [
46-
":unit_test_with_esm_deps_lib",
28+
":unit_test_lib",
4729
],
4830
)
4931

5032
jasmine_node_test(
5133
name = "test",
52-
deps = [
53-
":unit_test_lib",
54-
":unit_test_with_esm_deps_lib_bundled",
55-
],
34+
deps = [":esm_tests_bundled"],
5635
)

‎packages/angular/ssr/test/npm_package/BUILD.bazel‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
22
load("@bazel_skylib//rules:write_file.bzl", "write_file")
33
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
4-
load("//tools:defaults.bzl", "ts_library")
4+
load("//tools:interop.bzl", "ts_project")
55

6-
ts_library(
6+
ts_project(
77
name = "unit_test_lib",
88
testonly = True,
99
srcs = glob(["**/*.ts"]),
1010
deps = [
11-
"@npm//@bazel/runfiles",
11+
"//:root_modules/@bazel/runfiles",
1212
],
1313
)
1414

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /