Prepare for migration from ts_library to ts_project
With the upcoming migration from rules_nodejs to rules_js, I am
changing all the `ts_library` targets to become `ts_project` targets.
This patch introduces an alias for a NOP effect. A future patch will
switch the actual implementation.
I am leaving the scouting directory alone because all the build rules
will change completely. They will use Angular-specific rules.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I4b4fd4d14dbf25d6dbdaa3c1725ee6b651eedab6
diff --git a/aos/network/www/BUILD b/aos/network/www/BUILD
index 03f41a5..81b9e16 100644
--- a/aos/network/www/BUILD
+++ b/aos/network/www/BUILD
@@ -1,5 +1,4 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
load("//aos:config.bzl", "aos_config")
exports_files(["styles.css"])
@@ -13,7 +12,7 @@
visibility = ["//visibility:public"],
)
-ts_library(
+ts_project(
name = "proxy",
srcs = [
"config_handler.ts",
@@ -31,7 +30,7 @@
],
)
-ts_library(
+ts_project(
name = "main",
srcs = [
"main.ts",
@@ -68,7 +67,7 @@
visibility = ["//aos:__subpackages__"],
)
-ts_library(
+ts_project(
name = "reflection_test_main",
srcs = [
"reflection_test_main.ts",
@@ -83,7 +82,7 @@
],
)
-ts_library(
+ts_project(
name = "reflection_ts",
srcs = ["reflection.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -96,7 +95,7 @@
],
)
-ts_library(
+ts_project(
name = "colors",
srcs = [
"colors.ts",
@@ -105,7 +104,7 @@
visibility = ["//visibility:public"],
)
-ts_library(
+ts_project(
name = "plotter",
srcs = [
"plotter.ts",
@@ -115,7 +114,7 @@
deps = [":colors"],
)
-ts_library(
+ts_project(
name = "aos_plotter",
srcs = [
"aos_plotter.ts",
@@ -134,7 +133,7 @@
],
)
-ts_library(
+ts_project(
name = "demo_plot",
srcs = [
"demo_plot.ts",
diff --git a/build_tests/BUILD b/build_tests/BUILD
index ea05c0b..1e9043b 100644
--- a/build_tests/BUILD
+++ b/build_tests/BUILD
@@ -1,9 +1,9 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_go_library", "flatbuffer_py_library")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//tools/build_rules:apache.bzl", "apache_wrapper")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite")
load("//tools/build_rules:autocxx.bzl", "autocxx_library")
@@ -161,12 +161,12 @@
deps = [":hello_lib"],
)
-ts_library(
+ts_project(
name = "build_tests_ts",
srcs = ["basic.ts"],
)
-ts_library(
+ts_project(
name = "ts_test",
testonly = True,
srcs = ["basic_test.ts"],
diff --git a/frc971/analysis/BUILD b/frc971/analysis/BUILD
index c1ae252..36c450a 100644
--- a/frc971/analysis/BUILD
+++ b/frc971/analysis/BUILD
@@ -1,5 +1,4 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
load("//aos:config.bzl", "aos_config")
@@ -33,7 +32,7 @@
deps = ["//aos:configuration_fbs_python"],
)
-ts_library(
+ts_project(
name = "plot_index",
srcs = ["plot_index.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -127,7 +126,7 @@
target_compatible_with = ["@platforms//os:linux"],
)
-ts_library(
+ts_project(
name = "plot_data_utils",
srcs = ["plot_data_utils.ts"],
visibility = ["//visibility:public"],
diff --git a/frc971/analysis/cpp_plot/BUILD b/frc971/analysis/cpp_plot/BUILD
index d6e74c3..7f34afe 100644
--- a/frc971/analysis/cpp_plot/BUILD
+++ b/frc971/analysis/cpp_plot/BUILD
@@ -1,9 +1,8 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
package(default_visibility = ["//visibility:public"])
-ts_library(
+ts_project(
name = "cpp_plot",
srcs = ["cpp_plot.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/frc971/control_loops/drivetrain/BUILD b/frc971/control_loops/drivetrain/BUILD
index 13c8ade..86c1ec0 100644
--- a/frc971/control_loops/drivetrain/BUILD
+++ b/frc971/control_loops/drivetrain/BUILD
@@ -1,9 +1,9 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
load("//aos:config.bzl", "aos_config")
load("//tools/build_rules:select.bzl", "cpu_select")
load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
@@ -786,7 +786,7 @@
],
)
-ts_library(
+ts_project(
name = "down_estimator_plotter",
srcs = ["down_estimator_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -798,7 +798,7 @@
],
)
-ts_library(
+ts_project(
name = "spline_plotter",
srcs = ["spline_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -809,7 +809,7 @@
],
)
-ts_library(
+ts_project(
name = "drivetrain_plotter",
srcs = ["drivetrain_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -821,7 +821,7 @@
],
)
-ts_library(
+ts_project(
name = "robot_state_plotter",
srcs = ["robot_state_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/frc971/image_streamer/www/BUILD b/frc971/image_streamer/www/BUILD
index 908c5b4..f808a73 100644
--- a/frc971/image_streamer/www/BUILD
+++ b/frc971/image_streamer/www/BUILD
@@ -1,5 +1,4 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
package(default_visibility = ["//visibility:public"])
@@ -12,7 +11,7 @@
]),
)
-ts_library(
+ts_project(
name = "proxy",
srcs = [
"proxy.ts",
@@ -23,7 +22,7 @@
],
)
-ts_library(
+ts_project(
name = "main",
srcs = [
"main.ts",
diff --git a/frc971/wpilib/BUILD b/frc971/wpilib/BUILD
index eb0571c..ca3dd0c 100644
--- a/frc971/wpilib/BUILD
+++ b/frc971/wpilib/BUILD
@@ -1,4 +1,4 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
load("//aos:config.bzl", "aos_config")
@@ -469,7 +469,7 @@
],
)
-ts_library(
+ts_project(
name = "imu_plot_utils",
srcs = ["imu_plot_utils.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -484,7 +484,7 @@
],
)
-ts_library(
+ts_project(
name = "imu_plotter",
srcs = ["imu_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/tools/build_rules/js.bzl b/tools/build_rules/js.bzl
index 5510266..d334764 100644
--- a/tools/build_rules/js.bzl
+++ b/tools/build_rules/js.bzl
@@ -3,7 +3,15 @@
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@npm//@bazel/protractor:index.bzl", "protractor_web_test_suite")
-load("@npm//@bazel/typescript:index.bzl", "ts_project")
+load("@npm//@bazel/typescript:index.bzl", upstream_ts_library = "ts_library", upstream_ts_project = "ts_project")
+
+def ts_project(**kwargs):
+ """A trivial wrapper to prepare for the rules_js migration.
+
+ The intent is to change his macro to wrap the new rules_js ts_project
+ implementation.
+ """
+ upstream_ts_library(**kwargs)
def rollup_bundle(name, deps, visibility = None, **kwargs):
"""Calls the upstream rollup_bundle() and exposes a .min.js file.
@@ -72,7 +80,7 @@
See the documentation for more information:
https://bazelbuild.github.io/rules_nodejs/Protractor.html#protractor_web_test_suite
"""
- ts_project(
+ upstream_ts_project(
name = name + "__lib",
srcs = srcs,
testonly = 1,
diff --git a/y2019/vision/server/BUILD b/y2019/vision/server/BUILD
index 93172b4..b0b7674 100644
--- a/y2019/vision/server/BUILD
+++ b/y2019/vision/server/BUILD
@@ -1,9 +1,9 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("//aos/seasocks:gen_embedded.bzl", "gen_embedded")
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-ts_library(
+ts_project(
name = "demo",
srcs = [
"demo.ts",
diff --git a/y2019/vision/server/www/BUILD b/y2019/vision/server/www/BUILD
index 7c40eaa..2e8be80 100644
--- a/y2019/vision/server/www/BUILD
+++ b/y2019/vision/server/www/BUILD
@@ -1,5 +1,4 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
package(default_visibility = ["//visibility:public"])
@@ -10,7 +9,7 @@
]),
)
-ts_library(
+ts_project(
name = "visualizer",
srcs = glob([
"*.ts",
diff --git a/y2020/control_loops/drivetrain/BUILD b/y2020/control_loops/drivetrain/BUILD
index 0455d0f..fa153f0 100644
--- a/y2020/control_loops/drivetrain/BUILD
+++ b/y2020/control_loops/drivetrain/BUILD
@@ -1,7 +1,7 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
load("//aos:config.bzl", "aos_config")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
genrule(
name = "genrule_drivetrain",
@@ -216,7 +216,7 @@
],
)
-ts_library(
+ts_project(
name = "localizer_plotter",
srcs = ["localizer_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2020/control_loops/superstructure/BUILD b/y2020/control_loops/superstructure/BUILD
index d3f303f..d1f20a2 100644
--- a/y2020/control_loops/superstructure/BUILD
+++ b/y2020/control_loops/superstructure/BUILD
@@ -1,6 +1,6 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
@@ -136,7 +136,7 @@
],
)
-ts_library(
+ts_project(
name = "turret_plotter",
srcs = ["turret_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -152,7 +152,7 @@
],
)
-ts_library(
+ts_project(
name = "finisher_plotter",
srcs = ["finisher_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -163,7 +163,7 @@
],
)
-ts_library(
+ts_project(
name = "accelerator_plotter",
srcs = ["accelerator_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -174,7 +174,7 @@
],
)
-ts_library(
+ts_project(
name = "hood_plotter",
srcs = ["hood_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2020/www/BUILD b/y2020/www/BUILD
index 8467994..0c05900 100644
--- a/y2020/www/BUILD
+++ b/y2020/www/BUILD
@@ -1,8 +1,7 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
-ts_library(
+ts_project(
name = "camera_main",
srcs = [
"camera_main.ts",
@@ -21,7 +20,7 @@
],
)
-ts_library(
+ts_project(
name = "field_main",
srcs = [
"constants.ts",
diff --git a/y2021_bot3/control_loops/superstructure/BUILD b/y2021_bot3/control_loops/superstructure/BUILD
index f5b5b3b..be18cbe 100644
--- a/y2021_bot3/control_loops/superstructure/BUILD
+++ b/y2021_bot3/control_loops/superstructure/BUILD
@@ -1,5 +1,5 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
@@ -104,7 +104,7 @@
],
)
-ts_library(
+ts_project(
name = "superstructure_plotter",
srcs = ["superstructure_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2022/control_loops/superstructure/BUILD b/y2022/control_loops/superstructure/BUILD
index 3bc1297..a085049 100644
--- a/y2022/control_loops/superstructure/BUILD
+++ b/y2022/control_loops/superstructure/BUILD
@@ -1,6 +1,6 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
@@ -200,7 +200,7 @@
],
)
-ts_library(
+ts_project(
name = "superstructure_plotter",
srcs = ["superstructure_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -211,7 +211,7 @@
],
)
-ts_library(
+ts_project(
name = "catapult_plotter",
srcs = ["catapult_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -222,7 +222,7 @@
],
)
-ts_library(
+ts_project(
name = "intake_plotter",
srcs = ["intake_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -233,7 +233,7 @@
],
)
-ts_library(
+ts_project(
name = "turret_plotter",
srcs = ["turret_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
@@ -244,7 +244,7 @@
],
)
-ts_library(
+ts_project(
name = "climber_plotter",
srcs = ["climber_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2022/localizer/BUILD b/y2022/localizer/BUILD
index 2a0a9fe..1d45516 100644
--- a/y2022/localizer/BUILD
+++ b/y2022/localizer/BUILD
@@ -1,9 +1,9 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-ts_library(
+ts_project(
name = "localizer_plotter",
srcs = ["localizer_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2022/vision/BUILD b/y2022/vision/BUILD
index 31644e4..8d8a43c 100644
--- a/y2022/vision/BUILD
+++ b/y2022/vision/BUILD
@@ -1,8 +1,8 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-ts_library(
+ts_project(
name = "vision_plotter",
srcs = ["vision_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2022/www/BUILD b/y2022/www/BUILD
index 957045d..386ca90 100644
--- a/y2022/www/BUILD
+++ b/y2022/www/BUILD
@@ -1,5 +1,4 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
filegroup(
@@ -12,7 +11,7 @@
visibility = ["//visibility:public"],
)
-ts_library(
+ts_project(
name = "field_main",
srcs = [
"constants.ts",
diff --git a/y2023/control_loops/superstructure/BUILD b/y2023/control_loops/superstructure/BUILD
index 5246b3e..718a575 100644
--- a/y2023/control_loops/superstructure/BUILD
+++ b/y2023/control_loops/superstructure/BUILD
@@ -1,6 +1,6 @@
+load("//tools/build_rules:js.bzl", "ts_project")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
@@ -133,7 +133,7 @@
],
)
-ts_library(
+ts_project(
name = "superstructure_plotter",
srcs = ["superstructure_plotter.ts"],
target_compatible_with = ["@platforms//os:linux"],
diff --git a/y2023/www/BUILD b/y2023/www/BUILD
index 5dae3c6..539fa6d 100644
--- a/y2023/www/BUILD
+++ b/y2023/www/BUILD
@@ -1,5 +1,4 @@
-load("@npm//@bazel/typescript:index.bzl", "ts_library")
-load("//tools/build_rules:js.bzl", "rollup_bundle")
+load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
filegroup(
@@ -12,7 +11,7 @@
visibility = ["//visibility:public"],
)
-ts_library(
+ts_project(
name = "field_main",
srcs = [
"constants.ts",