diff hg-web/BUILD @ 175:71ad34a8bc9a hg-web

[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
author MrJuneJune <me@mrjunejune.com>
date Tue, 20 Jan 2026 06:06:47 -0800
parents 6de849867459
children fed99fc04e12
line wrap: on
line diff
--- a/hg-web/BUILD	Mon Jan 19 18:59:23 2026 -0800
+++ b/hg-web/BUILD	Tue Jan 20 06:06:47 2026 -0800
@@ -1,19 +1,46 @@
 load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
-load("//gui_ze:gui_ze.bzl", "move_files_into_dir", "bundle")
+load("//gui_ze:gui_ze.bzl", "move_files_into_dir", "bundle", "bun_build")
+
+filegroup(
+  name = "raw_file",
+  srcs = glob(["src/**"]),
+)
+
+filegroup(
+  name = "src_files",
+  srcs = [":raw_file", ":compiled_ts"],
+)
+
+filegroup(
+  name = "all_ts_files",
+  srcs = glob([
+      "**/*.ts",
+      "**/*.tsx",
+      "**/*.js",
+      "**/*.jsx",
+  ], allow_empty=True)
+)
+
+bun_build(
+  name = "page",
+  src = "src/main.tsx",
+  src_folder = "hg-web",
+  data = [
+    "//third_party/bun:bun_files",
+    ":all_ts_files",
+  ],
+  visibility = ["//visibility:public"],
+)
 
 move_files_into_dir(
   name = "compiled_ts",
   srcs = [
     "//markdown_converter:markdown_to_html",
+    ":page",
   ],
   dest = "src",
 )
 
-filegroup(
-  name = "src_files",
-  srcs = glob(["src/**"]) + [":compiled_ts"],
-)
-
 cc_binary(
   name = "hg_web_server",
   srcs = ["main.c"],
@@ -32,7 +59,7 @@
 cc_binary(
   name = "hg_web_server_debug",
   srcs = ["main.c"],
-  deps = ["//seobeo:seobeo_tcp_server_ws_debug"],
+  deps = ["//seobeo:seobeo"],
   data = [":src_files"],
 )