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", |
| 29 | "//y2022/localizer:localizer_visualization_ts_fbs", |
| 30 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
| 31 | ], |
| 32 | ) |
| 33 | |
| 34 | rollup_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 Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 44 | aos_downloader_dir( |
| 45 | name = "www_files", |
| 46 | srcs = [ |
James Kuszmaul | f3ef9e1 | 2022-03-05 17:13:00 -0800 | [diff] [blame^] | 47 | ":field_main_bundle", |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 48 | ":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 | ) |