Skip to content

Commit d2e154c

Browse files
committed
build: migrate more targets to ts_project
This commit migrates more targets from `ts_library` to `ts_project`.
1 parent 2888934 commit d2e154c

File tree

26 files changed

+138
-127
lines changed

26 files changed

+138
-127
lines changed

.bazelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ common --@aspect_rules_ts//ts:default_to_tsc_transpiler
1111
# https://github.com/bazelbuild/rules_typescript/issues/12 which affects the common case of
1212
# having `tsconfig.json` in the WORKSPACE directory. Instead, you should run
1313
# `bazel info output_base` to find out where the outputs went.
14-
build --symlink_prefix=/
14+
build --symlink_prefix=dist/
1515

1616
# Performance: avoid stat'ing input files
1717
build --watchfs

integration/size-test/BUILD.bazel

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@npm//@bazel/esbuild:index.bzl", "esbuild_config")
2-
load("//tools:defaults.bzl", "ts_library")
2+
load("//tools:defaults2.bzl", "ts_project")
33

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

@@ -19,16 +19,14 @@ esbuild_config(
1919
],
2020
)
2121

22-
ts_library(
22+
ts_project(
2323
name = "check-size",
2424
srcs = ["check-size.ts"],
25-
# TODO(ESM): remove this once the Bazel NodeJS rules can handle ESM with `nodejs_binary`.
26-
devmode_module = "commonjs",
2725
deps = [
28-
"@npm//@bazel/runfiles",
29-
"@npm//@types/node",
30-
"@npm//@types/yaml",
31-
"@npm//chalk",
32-
"@npm//yaml",
26+
"//:node_modules/@bazel/runfiles",
27+
"//:node_modules/@types/node",
28+
"//:node_modules/@types/yaml",
29+
"//:node_modules/chalk",
30+
"//:node_modules/yaml",
3331
],
3432
)

src/BUILD.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
44
load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS")
55
load("//src/material:config.bzl", "MATERIAL_ENTRYPOINTS", "MATERIAL_TESTING_ENTRYPOINTS")
66
load("//tools/dgeni:index.bzl", "dgeni_api_docs")
7-
load("//tools:defaults.bzl", "ts_library")
7+
load("//tools:defaults2.bzl", "ts_project")
88

99
package(default_visibility = ["//visibility:public"])
1010

@@ -56,7 +56,7 @@ dgeni_api_docs(
5656
tags = ["docs-package"],
5757
)
5858

59-
ts_library(
59+
ts_project(
6060
name = "dev_mode_types",
6161
srcs = ["dev-mode-types.d.ts"],
6262
)

src/cdk-experimental/BUILD.bazel

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
load("//src/cdk-experimental:config.bzl", "CDK_EXPERIMENTAL_TARGETS")
2-
load("//tools:defaults.bzl", "ng_package", "ts_library")
2+
load("//tools:defaults.bzl", "ng_package")
3+
load("//tools:defaults2.bzl", "ts_project")
34

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

6-
ts_library(
7+
ts_project(
78
name = "cdk-experimental",
89
srcs = glob(
910
["*.ts"],
1011
exclude = ["**/*.spec.ts"],
1112
),
12-
deps = ["@npm//@angular/core"],
13+
deps = ["//:node_modules/@angular/core"],
1314
)
1415

1516
ng_package(
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
load("//tools:defaults.bzl", "ts_library")
1+
load("//tools:defaults2.bzl", "ts_project")
22

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

5-
ts_library(
5+
ts_project(
66
name = "ui-patterns",
77
srcs = glob(
88
["**/*.ts"],
99
exclude = ["**/*.spec.ts"],
1010
),
1111
deps = [
12-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
13-
"//src/cdk-experimental/ui-patterns/listbox",
14-
"@npm//@angular/core",
12+
"//:node_modules/@angular/core",
13+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
14+
"//src/cdk-experimental/ui-patterns/listbox:listbox_rjs",
1515
],
1616
)
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
load("//tools:defaults.bzl", "ts_library")
1+
load("//tools:defaults2.bzl", "ts_project")
22

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

5-
ts_library(
5+
ts_project(
66
name = "event-manager",
77
srcs = glob(
88
["**/*.ts"],
99
exclude = ["**/*.spec.ts"],
1010
),
1111
deps = [
12-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
12+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
1313
],
1414
)

src/cdk-experimental/ui-patterns/behaviors/list-focus/BUILD.bazel

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library")
1+
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite")
2+
load("//tools:defaults2.bzl", "ts_project")
23

34
package(default_visibility = ["//visibility:public"])
45

5-
ts_library(
6+
ts_project(
67
name = "list-focus",
78
srcs = glob(
89
["**/*.ts"],
910
exclude = ["**/*.spec.ts"],
1011
),
1112
deps = [
12-
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation",
13-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
13+
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation:list-navigation_rjs",
14+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
1415
],
1516
)
1617

src/cdk-experimental/ui-patterns/behaviors/list-navigation/BUILD.bazel

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library")
1+
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite")
2+
load("//tools:defaults2.bzl", "ts_project")
23

34
package(default_visibility = ["//visibility:public"])
45

5-
ts_library(
6+
ts_project(
67
name = "list-navigation",
78
srcs = glob(
89
["**/*.ts"],
910
exclude = ["**/*.spec.ts"],
1011
),
1112
deps = [
12-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
13-
"@npm//@angular/core",
13+
"//:node_modules/@angular/core",
14+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
1415
],
1516
)
1617

src/cdk-experimental/ui-patterns/behaviors/list-selection/BUILD.bazel

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library")
1+
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite")
2+
load("//tools:defaults2.bzl", "ts_project")
23

34
package(default_visibility = ["//visibility:public"])
45

5-
ts_library(
6+
ts_project(
67
name = "list-selection",
78
srcs = glob(
89
["**/*.ts"],
910
exclude = ["**/*.spec.ts"],
1011
),
1112
deps = [
12-
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation",
13-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
14-
"@npm//@angular/core",
13+
"//:node_modules/@angular/core",
14+
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation:list-navigation_rjs",
15+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
1516
],
1617
)
1718

src/cdk-experimental/ui-patterns/behaviors/list-typeahead/BUILD.bazel

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library")
1+
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite")
2+
load("//tools:defaults2.bzl", "ts_project")
23

34
package(default_visibility = ["//visibility:public"])
45

5-
ts_library(
6+
ts_project(
67
name = "list-typeahead",
78
srcs = glob(
89
["**/*.ts"],
910
exclude = ["**/*.spec.ts"],
1011
),
1112
deps = [
12-
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation",
13-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
14-
"@npm//@angular/core",
13+
"//:node_modules/@angular/core",
14+
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation:list-navigation_rjs",
15+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
1516
],
1617
)
1718

src/cdk-experimental/ui-patterns/behaviors/signal-like/BUILD.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
load("//tools:defaults.bzl", "ts_library")
1+
load("//tools:defaults2.bzl", "ts_project")
22

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

5-
ts_library(
5+
ts_project(
66
name = "signal-like",
77
srcs = ["signal-like.ts"],
88
deps = [],
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
load("//tools:defaults.bzl", "ts_library")
1+
load("//tools:defaults2.bzl", "ts_project")
22

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

5-
ts_library(
5+
ts_project(
66
name = "listbox",
77
srcs = glob(
88
["**/*.ts"],
99
exclude = ["**/*.spec.ts"],
1010
),
1111
deps = [
12-
"//src/cdk-experimental/ui-patterns/behaviors/event-manager",
13-
"//src/cdk-experimental/ui-patterns/behaviors/list-focus",
14-
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation",
15-
"//src/cdk-experimental/ui-patterns/behaviors/list-selection",
16-
"//src/cdk-experimental/ui-patterns/behaviors/list-typeahead",
17-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
18-
"@npm//@angular/core",
12+
"//:node_modules/@angular/core",
13+
"//src/cdk-experimental/ui-patterns/behaviors/event-manager:event-manager_rjs",
14+
"//src/cdk-experimental/ui-patterns/behaviors/list-focus:list-focus_rjs",
15+
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation:list-navigation_rjs",
16+
"//src/cdk-experimental/ui-patterns/behaviors/list-selection:list-selection_rjs",
17+
"//src/cdk-experimental/ui-patterns/behaviors/list-typeahead:list-typeahead_rjs",
18+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
1919
],
2020
)

src/cdk/BUILD.bazel

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS", "CDK_ENTRYPOINTS_WITH_STYLES", "CDK_SCSS_LIBS", "CDK_TARGETS")
2-
load("//tools:defaults.bzl", "ng_package", "sass_library", "ts_library")
2+
load("//tools:defaults.bzl", "ng_package", "sass_library")
3+
load("//tools:defaults2.bzl", "ts_project")
34

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

6-
ts_library(
7+
ts_project(
78
name = "cdk",
89
srcs = glob(
910
["*.ts"],
1011
exclude = ["**/*.spec.ts"],
1112
),
12-
deps = ["@npm//@angular/core"],
13+
deps = ["//:node_modules/@angular/core"],
1314
)
1415

1516
# List of style files that need to be copied to the root of the CDK package. We do this

src/cdk/coercion/BUILD.bazel

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
load("//tools:defaults.bzl", "karma_web_test_suite", "markdown_to_html", "ts_library")
1+
load("//tools:defaults.bzl", "karma_web_test_suite", "markdown_to_html")
2+
load("//tools:defaults2.bzl", "ts_project")
23

34
package(default_visibility = ["//visibility:public"])
45

5-
ts_library(
6+
ts_project(
67
name = "coercion",
78
srcs = glob(
89
["**/*.ts"],
910
exclude = ["**/*.spec.ts"],
1011
),
1112
deps = [
12-
"@npm//@angular/core",
13+
"//:node_modules/@angular/core",
1314
],
1415
)
1516

16-
ts_library(
17+
ts_project(
1718
name = "unit_test_sources",
1819
testonly = True,
1920
srcs = glob(
2021
["**/*.spec.ts"],
2122
exclude = ["**/*.e2e.spec.ts"],
2223
),
2324
deps = [
24-
":coercion",
25-
"@npm//@angular/core",
26-
"@npm//@types/jasmine",
25+
":coercion_rjs",
26+
"//:node_modules/@angular/core",
2727
],
2828
)
2929

src/cdk/keycodes/BUILD.bazel

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
load("//tools:defaults.bzl", "karma_web_test_suite", "markdown_to_html", "ng_module", "ts_library")
1+
load("//tools:defaults.bzl", "karma_web_test_suite", "markdown_to_html", "ng_module")
2+
load("//tools:defaults2.bzl", "ts_project")
23

34
package(default_visibility = ["//visibility:public"])
45

@@ -14,17 +15,19 @@ ng_module(
1415
),
1516
)
1617

17-
ts_library(
18+
ts_project(
1819
name = "unit_test_sources",
1920
testonly = True,
2021
srcs = glob(
2122
["**/*.spec.ts"],
2223
exclude = ["**/*.e2e.spec.ts"],
2324
),
24-
deps = [
25+
interop_deps = [
2526
":keycodes",
2627
"//src/cdk/testing/private",
27-
"@npm//@types/jasmine",
28+
],
29+
deps = [
30+
"//:node_modules/@types/jasmine",
2831
],
2932
)
3033

src/cdk/testing/private/BUILD.bazel

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
load("//tools:defaults.bzl", "ts_library")
1+
load("//tools:defaults2.bzl", "ts_project")
22

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

5-
ts_library(
5+
ts_project(
66
name = "private",
77
testonly = True,
88
srcs = glob(
99
["**/*.ts"],
1010
exclude = ["**/*.spec.ts"],
1111
),
12-
deps = [
12+
interop_deps = [
1313
"//src/cdk/testing/testbed",
14-
"@npm//@angular/core",
15-
"@npm//@types/jasmine",
14+
],
15+
deps = [
16+
"//:node_modules/@angular/core",
17+
"//:node_modules/@types/jasmine",
1618
],
1719
)

src/cdk/testing/protractor/BUILD.bazel

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
load("//tools:defaults.bzl", "ts_library")
1+
load("//tools:defaults2.bzl", "ts_project")
22

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

5-
ts_library(
5+
ts_project(
66
name = "protractor",
77
srcs = glob(
88
["**/*.ts"],
99
exclude = ["**/*.spec.ts"],
1010
),
11-
deps = [
11+
interop_deps = [
1212
"//src/cdk/testing",
13-
"@npm//protractor",
13+
],
14+
deps = [
15+
"//:node_modules/protractor",
1416
],
1517
)
1618

0 commit comments

Comments
 (0)