blob: 9ee56e3b80f49289f14a06b85553077eba440f4a [file] [log] [blame]
James Kuszmaulf3ef9e12022-03-05 17:13:00 -08001load("@npm//@bazel/typescript:index.bzl", "ts_library")
2load("//tools/build_rules:js.bzl", "rollup_bundle")
Austin Schuh76f227c2022-02-23 16:34:08 -08003load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
4
5filegroup(
6 name = "files",
7 srcs = glob([
8 "**/*.html",
9 "**/*.css",
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080010 "**/*.png",
Austin Schuh76f227c2022-02-23 16:34:08 -080011 ]),
12 visibility = ["//visibility:public"],
13)
14
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080015ts_library(
16 name = "field_main",
17 srcs = [
18 "constants.ts",
19 "field_handler.ts",
20 "field_main.ts",
21 ],
22 target_compatible_with = ["@platforms//os:linux"],
23 deps = [
24 "//aos/network:connect_ts_fbs",
25 "//aos/network:web_proxy_ts_fbs",
26 "//aos/network/www:proxy",
27 "//y2022/control_loops/superstructure:superstructure_status_ts_fbs",
28 "//y2022/localizer:localizer_output_ts_fbs",
29 "//y2022/localizer:localizer_visualization_ts_fbs",
30 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
31 ],
32)
33
34rollup_bundle(
35 name = "field_main_bundle",
36 entry_point = "field_main.ts",
37 target_compatible_with = ["@platforms//os:linux"],
38 visibility = ["//y2022:__subpackages__"],
39 deps = [
40 ":field_main",
41 ],
42)
43
Austin Schuh76f227c2022-02-23 16:34:08 -080044aos_downloader_dir(
45 name = "www_files",
46 srcs = [
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080047 ":field_main_bundle",
Austin Schuh76f227c2022-02-23 16:34:08 -080048 ":files",
49 "//frc971/analysis:plot_index_bundle.min.js",
50 ],
51 dir = "www",
52 target_compatible_with = ["@platforms//os:linux"],
53 visibility = ["//visibility:public"],
54)