James Kuszmaul | f3ef9e1 | 2022-03-05 17:13:00 -0800 | [diff] [blame] | 1 | load("@npm//@bazel/typescript:index.bzl", "ts_library") |
| 2 | load("//tools/build_rules:js.bzl", "rollup_bundle") |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 3 | load("//frc971/downloader:downloader.bzl", "aos_downloader_dir") |
| 4 | |
| 5 | filegroup( |
| 6 | name = "files", |
| 7 | srcs = glob([ |
| 8 | "**/*.html", |
| 9 | "**/*.css", |
James Kuszmaul | f3ef9e1 | 2022-03-05 17:13:00 -0800 | [diff] [blame] | 10 | "**/*.png", |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 11 | ]), |
| 12 | visibility = ["//visibility:public"], |
| 13 | ) |
| 14 | |
James Kuszmaul | f3ef9e1 | 2022-03-05 17:13:00 -0800 | [diff] [blame] | 15 | ts_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", |
James Kuszmaul | dac091f | 2022-03-22 09:35:06 -0700 | [diff] [blame] | 29 | "//y2022/localizer:localizer_status_ts_fbs", |
James Kuszmaul | f3ef9e1 | 2022-03-05 17:13:00 -0800 | [diff] [blame] | 30 | "//y2022/localizer:localizer_visualization_ts_fbs", |
| 31 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
| 32 | ], |
| 33 | ) |
| 34 | |
| 35 | rollup_bundle( |
| 36 | name = "field_main_bundle", |
| 37 | entry_point = "field_main.ts", |
| 38 | target_compatible_with = ["@platforms//os:linux"], |
| 39 | visibility = ["//y2022:__subpackages__"], |
| 40 | deps = [ |
| 41 | ":field_main", |
| 42 | ], |
| 43 | ) |
| 44 | |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 45 | aos_downloader_dir( |
| 46 | name = "www_files", |
| 47 | srcs = [ |
James Kuszmaul | 1b73423 | 2022-03-12 10:40:28 -0800 | [diff] [blame] | 48 | ":field_main_bundle.min.js", |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 49 | ":files", |
| 50 | "//frc971/analysis:plot_index_bundle.min.js", |
| 51 | ], |
| 52 | dir = "www", |
| 53 | target_compatible_with = ["@platforms//os:linux"], |
| 54 | visibility = ["//visibility:public"], |
| 55 | ) |