Skip to main content

max / goingson

Move themes/ and layout.css onto makeover-build Both emitters were byte-identical to Balanced Breakfast's. They live in makeover-build now and this build script calls it, which closes makeover-geometry's open question 3 without waiting for a third copy. materialize_geometry stays here. The two apps genuinely disagree about how the touch preset is selected, and extracting that would pick one policy by accident inside a shared crate. It follows once density selection has an owner. build.rs 106 -> 45 lines.
Author: Max Johnson <me@maxj.phd> · 2026-07-28 21:53 UTC
Signed with PGP, not checked
Commit: 108d9b7a1a533498cb516bc9376d7d24140261df
Parent: 44cfb4c
3 files changed, +28 insertions, -60 deletions
M Cargo.lock +21 -4
@@ -65,7 +65,7 @@
65 65 source = "registry+https://github.com/rust-lang/crates.io-index"
66 66 checksum = "fbb156a777c35110c1b19aac32d9eb52b0c05048812c8cd74a7f3b51b44b1552"
67 67 dependencies = [
68 - "makeover",
68 + "makeover 2.2.0",
69 69 "ratatui",
70 70 ]
71 71
@@ -2246,9 +2246,9 @@
2246 2246 "lettre",
2247 2247 "libsqlite3-sys",
2248 2248 "mailparse",
2249 - "makeover",
2249 + "makeover 2.2.0",
2250 + "makeover-build",
2250 2251 "makeover-geometry",
2251 - "makeover-webview",
2252 2252 "notify",
2253 2253 "notify-debouncer-mini",
2254 2254 "open",
@@ -2294,7 +2294,7 @@
2294 2294 "chrono",
2295 2295 "goingson-core",
2296 2296 "goingson-db-sqlite",
2297 - "makeover",
2297 + "makeover 2.2.0",
2298 2298 "ratatui",
2299 2299 "sqlx",
2300 2300 "tokio",
@@ -3374,6 +3374,23 @@
3374 3374 "toml 1.1.3+spec-1.1.0",
3375 3375 ]
3376 3376
3377 + [[package]]
3378 + name = "makeover"
3379 + version = "2.3.0"
3380 + dependencies = [
3381 + "include_dir",
3382 + "serde",
3383 + "toml 1.1.3+spec-1.1.0",
3384 + ]
3385 +
3386 + [[package]]
3387 + name = "makeover-build"
3388 + version = "0.1.0"
3389 + dependencies = [
3390 + "makeover 2.3.0",
3391 + "makeover-webview",
3392 + ]
3393 +
3377 3394 [[package]]
3378 3395 name = "makeover-geometry"
3379 3396 version = "0.1.0"
@@ -16,9 +16,8 @@
16 16 tauri-build = { workspace = true }
17 17 makeover.workspace = true
18 18 makeover-geometry.workspace = true
19 - # Phase A of the description layer: the component stylesheet, emitted at build
20 - # time beside geometry.css. Path dep while unpublished.
21 - makeover-webview = { path = "../../../Libraries/makeover-webview" }
19 + # Materialises themes/ and the phase-A stylesheet. Path dep while unpublished.
20 + makeover-build = { path = "../../../Libraries/makeover-build" }
22 21
23 22 [dependencies]
24 23 goingson-core = { workspace = true }
@@ -1,31 +1,5 @@
1 1 use std::path::Path;
2 2
3 - /// Write the themes `makeover` ships into `themes/`, where `tauri.conf.json`
4 - /// picks them up as a bundled resource.
5 - ///
6 - /// Tauri's resource globs are read by the Tauri CLI against the crate
7 - /// directory, so they cannot point into a registry checkout or `OUT_DIR`.
8 - /// Materializing the embedded set here keeps `makeover` the single source of
9 - /// truth without vendoring a second copy of the theme files into this repo.
10 - /// The directory is generated, and gitignored.
11 - fn materialize_themes() {
12 - let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("themes");
13 - std::fs::create_dir_all(&dir).expect("create themes/");
14 -
15 - // Clear stale files first, so a theme removed upstream (or renamed) does
16 - // not linger in the bundle from an earlier build.
17 - for entry in std::fs::read_dir(&dir).expect("read themes/").flatten() {
18 - let path = entry.path();
19 - if path.extension().is_some_and(|e| e == "toml") {
20 - std::fs::remove_file(&path).expect("remove stale theme");
21 - }
22 - }
23 -
24 - for (id, source) in makeover::embedded_themes() {
25 - std::fs::write(dir.join(format!("{id}.toml")), source).expect("write theme");
26 - }
27 - }
28 -
29 3 /// Write the geometry layer `makeover-geometry` defines into
30 4 /// `frontend/css/geometry.css`, which `index.html` links ahead of the
31 5 /// stylesheet.
@@ -60,34 +34,12 @@
60 34 std::fs::write(path, css).expect("write geometry.css");
61 35 }
62 36
63 - /// Write the component layer `makeover-webview` emits into
64 - /// `frontend/css/layout.css`, which `index.html` links after `geometry.css`
65 - /// and before the stylesheet.
66 - ///
67 - /// Third generated file in a pipeline that already runs twice, and the same
68 - /// shape as the other two: a crate owns the rule, `build.rs` materialises it,
69 - /// the app links it and never edits it.
70 - ///
71 - /// Phase A is the stylesheet only, deliberately. This app builds markup from
72 - /// template literals at 145 sites, so adopting generated *markup* is a
73 - /// migration; adopting a generated stylesheet is a deletion. The `--bevel-*`
74 - /// properties this emits were hand-written in `styles.css` until now, and the
75 - /// crate has a test asserting the emitted text matches what both Tauri apps
76 - /// wrote by hand, so this changes nothing on screen.
77 - ///
78 - /// The file is generated, and gitignored.
79 - fn materialize_layout() {
80 - let css = makeover_webview::stylesheet(&makeover_webview::Emit::default());
81 - let path = Path::new(env!("CARGO_MANIFEST_DIR"))
82 - .join("frontend")
83 - .join("css")
84 - .join("layout.css");
85 - std::fs::write(path, css).expect("write layout.css");
86 - }
87 -
88 37 fn main() {
89 - materialize_themes();
38 + // themes/ and frontend/css/layout.css. Both were written out here until
39 + // they had a second identical copy in the other Tauri app; they live in
40 + // makeover-build now. The geometry emitter below stays local, because the
41 + // two apps genuinely disagree about how the touch preset is selected.
42 + makeover_build::tauri_frontend(env!("CARGO_MANIFEST_DIR"), &makeover_build::Emit::default());
90 43 materialize_geometry();
91 - materialize_layout();
92 44 tauri_build::build();
93 45 }