summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-26 04:37:03 -0300
committerGabriel Schneider <[email protected]>2026-11-26 04:41:35 -0300
commit77b22e7c7623696feb52292bb86839870e20050d (patch)
treef923275a1d118bc4227a349842c7202f74004d7d /build
parentfed268f2282a6d393a116d103e1fd88da87ecbff (diff)
downloadpardes-77b22e7c7623696feb52292bb86839870e20050d.tar.gz
pardes-77b22e7c7623696feb52292bb86839870e20050d.zip
themes, vendor, colors, gen_themes, exec, ctl, dump: DESIGN.md E's 44 themes retired, each name standing for its successor wherever it is still read (the themes programme's L7; DESIGN.md E, F): GONE: 28 helix sources (base16_default_light, base16_terminal, base16_transparent, bogster_light, cyan_light, eldritch_transparent, gruvbox-material, hex_lavender, hex_poison, ingrid, iroaseta, nord_light, nyxvamp-transparent, peachpuff, the six helix seoul256s, term16_dark, term16_light, tokyonight, ttox, ttox_soft, vesper-transparent, zed_onedark, zed_onelight), zed's ayu.json and gruvbox.json (every variant in them retired: ayu_dark/light/mirage_zed, the six gruvbox_*_zed) and their licences (ayu.LICENSE, gruvbox.LICENSE: zed's, covering those files alone; helix's licences each cover a kept theme), seoul256's 238, 239, 252 and 253 (their rows, their citations, their lines in its G4 block); vendor/themes/base/ holds the retired three kept themes inherit from (ayu_dark_helix, hex_steel, nord_helix; the designer's list named seven, but no kept theme inherits seoul256_dark/_light, term16_dark or zed_onedark once their children retire), passed to the generator as `base=<path>` (build/core.zig `vendoredThemes` per directory), read for `inherits`, never rung; THE SUCCESSORS: `colors.retired`, 44 names and the kept one each stands for (the kept twin, the nearest kept seoul256 step, dark or light for the terminal-colour themes, the default where there is none: ingrid), read by `successorOf`: a `Theme` (an init file's line, a click, a /ctl write) naming one wears its successor and says so once, as a notice: "Theme gruvbox_dark_zed was retired: gruvbox instead" (exec.applySettingBuiltin); /ctl takes such a write (ctl.zig); a dump or Restore naming one restores its successor (`colors.restoredIndex`, dump.zig's two readers, which said the same loop twice; one this build has nothing of keeps the theme in effect as before, else the default by name, where it was index 0, dark's now); an unknown name keeps today's path and words; THE RING TEST'S LIST: empty, so gone (`ring_expected` and its bookkeeping: every theme in the ring passes every floor it is held to, or the test names it); RUN (TEST FIRST): colors.zig "a retired theme's name stands for its successor in an init file and a dump, said once; an unknown one leaves the default, in today's words" (an init `Theme gruvbox_dark_zed`, `Theme TTOX` (any case), `Theme ingrid` and `Theme no-such-theme`: gruvbox, dark, orchard and orchard, each with its one message; a dump of a session in acme with `ttox` put in for its theme's name, as an older build's: restored in dark): fails on L5 (gruvbox_dark_zed still in the ring, worn as itself), passes now; "every retired theme's successor is in the ring, and no retired name is" (44); the ring test: 245 of 245 themes pass every floor (289 at L5, 44 retired); "seoul256's eight backgrounds ring in their order"; the G4 test holds every port's file; core-test 1142/1315 (173 skipped: L5's 1140/1313 + the two retirement tests); OUTSIDE my files: build/core.zig (`vendoredThemes` per directory, the base arguments), core/exec.zig (`Theme`'s retired branch, 7 lines), core/ninep/ctl.zig (1 line), core/dump.zig (its two readers, `restoredIndex`); the dump's bytes and layout unchanged and a name in this build's ring restored as before (restoredIndex's first loop is the old one), so a join or a restore within a build never reaches the new branches: no fuzz or soak
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'build')
-rw-r--r--build/core.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/build/core.zig b/build/core.zig
index f9cb450f..c787fdc8 100644
--- a/build/core.zig
+++ b/build/core.zig
@@ -131,9 +131,11 @@ fn patchesHash(b: *std.Build, io: std.Io) u64 {
return h;
}
-fn vendoredThemes(b: *std.Build, io: std.Io) []const []const u8 {
+/// The theme sources in `sub` of vendor/themes, sorted: the ring's (`.`),
+/// or the retired ones kept themes inherit from (`base`, read, never rung).
+fn vendoredThemes(b: *std.Build, io: std.Io, sub: []const u8) []const []const u8 {
var names: std.ArrayList([]const u8) = .empty;
- var dir = b.root.root_dir.handle.openDir(io, "vendor/themes", .{ .iterate = true }) catch @panic("open vendor/themes");
+ var dir = b.root.root_dir.handle.openDir(io, b.pathJoin(&.{ "vendor/themes", sub }), .{ .iterate = true }) catch @panic("open vendor/themes");
defer dir.close(io);
var it = dir.iterate();
while (it.next(io) catch @panic("read vendor/themes")) |e| {
@@ -161,7 +163,8 @@ pub fn generatedThemes(b: *std.Build, io: std.Io, target: std.Build.ResolvedTarg
});
const run_theme_gen = b.addRunArtifact(theme_gen);
const themes_out = run_theme_gen.addOutputDirectoryArg("themes");
- for (vendoredThemes(b, io)) |name| run_theme_gen.addFileArg(b.path(b.fmt("vendor/themes/{s}", .{name})));
+ for (vendoredThemes(b, io, ".")) |name| run_theme_gen.addFileArg(b.path(b.fmt("vendor/themes/{s}", .{name})));
+ for (vendoredThemes(b, io, "base")) |name| run_theme_gen.addPrefixedFileArg("base=", b.path(b.fmt("vendor/themes/base/{s}", .{name})));
return b.createModule(.{
.target = target,
.optimize = optimize,