Skip to main content

max / balanced_breakfast

Seal balanced_breakfast's dead makeover vocabulary at 26 of 42 check_vocabulary_use shipped in makeover-build 0.22.0 and nothing called it, because the file set it takes is different in every app and picking it wrong is worse than not having the check: too small a list records a ceiling that never bites, too large a one counts prose as usage. This app's list is index.html and frontend/js; css/ is out, since a class in a stylesheet is that class being styled rather than that class being emitted. Twenty-six of forty-two is the highest of the three, and it is the only one of the three that is a true reading. goingson and the MNW server both seal at eighteen because their described screens emit classes from quasi-webview at render time, which no file in either repo names; this app has no described screens, so nothing is hidden from the scan. What it measures is a real sixty-two percent of the vocabulary shipped and never written -- every table class, the whole cell and row family, and the raised/latched/chosen states. The seal only ratchets down: over it fails, under it warns and asks for the number to be lowered. makeover-build moves to 0.24.0 to reach the function.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-12 14:55 UTC
Signed with PGP, not checked
Commit: d008ee9aa89a5a7c2165b1a9887fe13947c81b1a
Parent: a685f8b
3 files changed, +51 insertions, -13 deletions
M Cargo.lock +12 -12
@@ -3141,9 +3141,9 @@
3141 3141
3142 3142 [[package]]
3143 3143 name = "makeover-build"
3144 - version = "0.23.1"
3144 + version = "0.24.0"
3145 3145 source = "registry+https://github.com/rust-lang/crates.io-index"
3146 - checksum = "09326dad8b7fdbf1ae4359f866e8f4432a86c837f5a8bf1576bf0c298afcd41b"
3146 + checksum = "12bcb5bc04026df9a5f4007e2a0f17ed34d8671573ea6445b4d17d7f44280d69"
3147 3147 dependencies = [
3148 3148 "makeover",
3149 3149 "makeover-geometry",
@@ -3174,9 +3174,9 @@
3174 3174
3175 3175 [[package]]
3176 3176 name = "makeover-webview"
3177 - version = "0.30.1"
3177 + version = "0.31.0"
3178 3178 source = "registry+https://github.com/rust-lang/crates.io-index"
3179 - checksum = "d6f86fc082c5fc0d73192a3f3f5f74840848ba2cc815154ab207b1fc707f7c64"
3179 + checksum = "f9f97c1694d50160ed5c980a17c96b1c8d007dbdb2d6b9472a2a5270e28cb4fd"
3180 3180 dependencies = [
3181 3181 "makeover-geometry",
3182 3182 "makeover-layout",
@@ -7940,14 +7940,6 @@
7940 7940 "winnow 1.0.4",
7941 7941 ]
7942 7942
7943 - [[patch.unused]]
7944 - name = "kberg"
7945 - version = "0.1.0"
7946 -
7947 - [[patch.unused]]
7948 - name = "painhours"
7949 - version = "0.1.0"
7950 -
7951 7943 [[patch.unused]]
7952 7944 name = "quasi-axum"
7953 7945 version = "0.1.0"
@@ -7971,3 +7963,11 @@
7971 7963 [[patch.unused]]
7972 7964 name = "quasi-webview"
7973 7965 version = "0.1.0"
7966 +
7967 + [[patch.unused]]
7968 + name = "kberg"
7969 + version = "0.1.0"
7970 +
7971 + [[patch.unused]]
7972 + name = "painhours"
7973 + version = "0.1.0"
@@ -18,7 +18,7 @@
18 18 # Materialises all three generated files: themes/, geometry.css, layout.css.
19 19 # The build script needs nothing else; makeover and makeover-geometry reach it
20 20 # through here.
21 - makeover-build = "0.23.1"
21 + makeover-build = "0.24.0"
22 22
23 23 [dependencies]
24 24 bb-interface.workspace = true
@@ -27,6 +27,11 @@
27 27 &["geometry.css", "layout.css"],
28 28 REVIEWED_OVERLAPS,
29 29 );
30 + makeover_build::check_vocabulary_use(
31 + &markup_files(&frontend),
32 + &makeover_build::Emit::default(),
33 + DEAD_VOCABULARY_HIGH_WATER,
34 + );
30 35 makeover_build::check_touch_density(frontend.join("js"));
31 36
32 37 tauri_build::build();
@@ -52,3 +57,36 @@
52 57 /// An entry that stops colliding fails the build, so this list cannot outlive
53 58 /// what it describes.
54 59 const REVIEWED_OVERLAPS: &[(&str, &str)] = &[("button", "color"), ("button", "cursor")];
60 +
61 + /// How many generated classes may go unused before the build fails.
62 + ///
63 + /// One-sided: over this fails, under it warns and asks for the seal to be
64 + /// lowered. A build that broke on deleting dead CSS would teach the wrong
65 + /// lesson, so the number only ever ratchets down.
66 + ///
67 + /// Measured against [`markup_files`]: `index.html` and every `frontend/js`
68 + /// file, which is the whole of what this app writes a class from. The `css/`
69 + /// directory is deliberately out -- a class in a stylesheet is that class being
70 + /// styled, not that class being emitted, and counting it would mark the whole
71 + /// vocabulary used by definition.
72 + ///
73 + /// This app has no described screens, so unlike goingson and the MNW server the
74 + /// number here is the real one: nothing is emitted by a renderer at runtime
75 + /// that a file in this repo does not name.
76 + const DEAD_VOCABULARY_HIGH_WATER: usize = 26;
77 +
78 + /// Every file that can carry a class name.
79 + fn markup_files(frontend: &std::path::Path) -> Vec<std::path::PathBuf> {
80 + let mut files = vec![frontend.join("index.html")];
81 + let mut scripts: Vec<std::path::PathBuf> = std::fs::read_dir(frontend.join("js"))
82 + .expect("read frontend/js")
83 + .map(|entry| entry.expect("read frontend/js entry").path())
84 + .filter(|path| path.extension().is_some_and(|ext| ext == "js"))
85 + .collect();
86 + // Sorted, or the order is the filesystem's and two machines seal against
87 + // the same set in a different order. It makes no difference to the count
88 + // and every difference to reading a diff of the warning.
89 + scripts.sort();
90 + files.extend(scripts);
91 + files
92 + }