Something went wrong. Try again.
Something went wrong. Try again.
Architecture #
jfalava's shared UI, one source of design for every site, CLI and app: the brand's CSS, tokens and fonts come first, and each surface (Astro docs, Effect web apps, share cards, Effect and clap terminals, Rune apps) reads them and adds its own components. It is a Bun workspace of npm packages, a Cargo workspace with one published crate, and a second Cargo workspace for the Rune theme.
Packages #
brand/(@jfalava/ui-brand): the brand in plain CSS with no dependencies, plus a Tailwind v4 theme.brand/tokens.cssis the single source of its values;brand/tokens.jsonandbrand/tailwind-merge.jsonare generated from it bybrand/scripts/tokens.tsfor consumers that cannot read CSS. It also owns the fonts (brand/fonts.css,brand/ttf/). It depends on no other package here.astro/(@jfalava/ui-astro): Nimbus docs components for Astro sites.astro/nimbus/is Cloudflare's Nimbus code, copied unchanged byastro/scripts/sync-nimbus.tsand never edited by hand;astro/theme.cssis jfalava's own layer, which imports the brand's fonts and tokens and points Nimbus's theme at them. Depends onbrand/.effect-ui/(@jfalava/ui-effect-ui): web components for Effect UI apps, ineffect-ui/src/: Omnibar search (omnibar.ts), the Vellum and Folio writers (vellum.ts,folio.ts, withblocks.tsandhistory.ts) and Hotkeys (hotkeys.ts).effect-ui/src/parts.tsholds the view functions they share, andeffect-ui/theme.cssis the Tailwind theme they are drawn with. Depends onbrand/.og/(@jfalava/ui-og): share cards (OG images) for any site or framework.og/src/index.tsdraws a 1200 × 630 PNG with Satori and resvg from the brand's tokens and fonts,og/src/paths.tsmaps a page's address to its card, andog/src/vite.tsis the Vite plugin that emits the cards with a build's assets. Depends onbrand/.effect-cli/(@jfalava/ui-effect-cli): terminal UI for Effect CLIs, one module per export ineffect-cli/src/: styles and glyphs (style.ts), OSC 7501 status (status.ts), progress, prompts, tables, help and Listr output. It reads nothing from the other packages.clap/(jfalava-ui-clap, a crate on crates.io): terminal UI for clap CLIs, the Rust counterpart ofeffect-cli/. It takeseffect-cli/'s glyph sets and status lines, andclap/tests/parity.rsfails when the two drift. Member of the root Cargo workspace inCargo.toml.rune/(jfalava-ui-rune, a crate that ispublish = falseand used from git): the brand for Rune apps, a rune-kit theme with an update badge, callouts and other components.rune/src/lib.rsembedsbrand/tokens.jsonand the fonts inbrand/ttf/at compile time. It is a Cargo workspace of its own, excluded from the root one, so Rune's wgpu and winit stay out ofclap/'s lockfile and Linux build.
brand/ ──► astro/
│ ├───► effect-ui/
│ ├───► og/
│ └───► rune/ (compile-time include of tokens and fonts)
effect-cli/ ◄── parity ──► clap/
Flow #
A brand change reaches every surface by one path:
- Edit a value in
brand/tokens.css. bun run tokensinbrand/rewritesbrand/tokens.jsonandbrand/tailwind-merge.json;tokens:checkfails when either is stale.- The web packages pick the CSS up through
@jfalava/ui-brand,og/src/index.tsreads the JSON and the TTFs, andrune/src/lib.rsembeds them.
State #
The repo keeps no runtime state. Generated files are tracked and have one writer each: brand/scripts/tokens.ts writes brand/tokens.json and brand/tailwind-merge.json, and astro/scripts/sync-nimbus.ts writes astro/nimbus/.
Entry points #
- Each npm package's
exportsin itspackage.json:brand/and the themes are CSS,effect-cli/,effect-ui/andog/are modules built into a dist folder bybuild:npm. .github/workflows/ci.yml: thechangesjob decides which ofcheck(Bun gate),rust(clap/crate gate) andrune(macOS gate and gallery renders) run..github/workflows/release.yml: on a push tomainthat changes apackage.jsonorCargo.toml, publishes each package to npm and each crate to crates.io whose version is not on its registry yet. Each package has its own version.rune/examples/gallery.rs: opens the Rune gallery, or renders its scenes to PNGs headless.
Invariants #
brand/depends on nothing here; every other package may depend on it, and none on a sibling other thanbrand/.- Nothing in
astro/nimbus/is edited by hand; changes go inastro/theme.cssor the sync script. brand/tokens.jsonandbrand/tailwind-merge.jsonare never edited by hand.clap/andeffect-cli/share glyphs and status lines only throughclap/tests/parity.rsandeffect-cli/test/fixtures/lines.json, not through a shared package.rune/never joins the root Cargo workspace.