Mercurial
annotate hg-web/BUILD @ 191:a06710325c30 hg-web
[HgWeb] Fully working copy.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sat, 24 Jan 2026 21:51:51 -0800 |
| parents | a2725419f988 |
| children | 9f4429c49733 |
| rev | line source |
|---|---|
|
104
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
1 load("@rules_cc//cc:cc_binary.bzl", "cc_binary") |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
2 load("//gui_ze:gui_ze.bzl", "move_files_into_dir", "bundle", "bun_bundle") |
|
175
71ad34a8bc9a
[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
MrJuneJune <me@mrjunejune.com>
parents:
147
diff
changeset
|
3 |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
4 # Source files |
|
176
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
5 filegroup( |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
6 name = "src_ts_files", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
7 srcs = glob([ |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
8 "src/**/*.ts", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
9 "src/**/*.tsx", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
10 "src/**/*.js", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
11 "src/**/*.jsx", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
12 ], allow_empty = True), |
|
176
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
13 ) |
|
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
14 |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
15 # Bundle TypeScript with Bun |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
16 bun_bundle( |
|
175
71ad34a8bc9a
[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
MrJuneJune <me@mrjunejune.com>
parents:
147
diff
changeset
|
17 name = "page", |
|
71ad34a8bc9a
[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
MrJuneJune <me@mrjunejune.com>
parents:
147
diff
changeset
|
18 src = "src/main.tsx", |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
19 deps = [ |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
20 ":src_ts_files", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
21 "//markdown_converter:markdown_to_html_wasm", |
| 191 | 22 "//third_party/highlight:js", |
|
175
71ad34a8bc9a
[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
MrJuneJune <me@mrjunejune.com>
parents:
147
diff
changeset
|
23 ], |
|
71ad34a8bc9a
[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
MrJuneJune <me@mrjunejune.com>
parents:
147
diff
changeset
|
24 visibility = ["//visibility:public"], |
|
71ad34a8bc9a
[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
MrJuneJune <me@mrjunejune.com>
parents:
147
diff
changeset
|
25 ) |
|
104
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
26 |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
27 # Prepare compiled assets |
|
104
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
28 move_files_into_dir( |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
29 name = "compiled_js", |
|
104
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
30 srcs = [ |
|
175
71ad34a8bc9a
[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
MrJuneJune <me@mrjunejune.com>
parents:
147
diff
changeset
|
31 ":page", |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
32 "//markdown_converter:markdown_to_html_wasm", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
33 "//third_party/highlight:js", |
|
104
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
34 ], |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
35 dest = "src", |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
36 ) |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
37 |
|
176
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
38 move_files_into_dir( |
|
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
39 name = "public_files", |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
40 srcs = ["//mrjunejune:public_files"], |
|
176
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
41 dest = "src/public", |
|
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
42 ) |
|
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
43 |
|
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
44 filegroup( |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
45 name = "all_assets", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
46 srcs = glob(["src/**"]) + [":compiled_js", ":public_files"], |
|
176
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
47 ) |
|
fed99fc04e12
[HgWeb] Problem with the emscript lol
MrJuneJune <me@mrjunejune.com>
parents:
175
diff
changeset
|
48 |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
49 # Server binaries |
|
104
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
50 cc_binary( |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
51 name = "hg_web_server", |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
52 srcs = ["main.c"], |
|
190
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
53 deps = ["//seobeo:seobeo"], |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
54 data = [":all_assets"], |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
55 ) |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
56 |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
57 cc_binary( |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
58 name = "hg_web_server_debug", |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
59 srcs = ["main.c"], |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
60 deps = ["//seobeo:seobeo"], |
|
a2725419f988
Updated so that bun builds will with already existing js files.
MrJuneJune <me@mrjunejune.com>
parents:
188
diff
changeset
|
61 data = [":all_assets"], |
|
104
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
62 ) |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
63 |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
64 bundle( |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
65 name = "hg_web_server_bundle", |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
66 binary = ":hg_web_server", |
|
2301aeb7503b
[Hg Web] Super simple mercurial server.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
67 ) |