0010 First-party Bun SSG for the wiki
Context
ADR/0009 Logseq wiki on Cloudflare Pages chose the official
logseq/publish-spaaction as the renderer. In practice it clones and compiles the entire Logseq frontend (yarn + ClojureScript) in CI β ~20 minutes on a cold cache β and the pinned 2024-era release (v0.3.1) sets up Node 18 and leaves it onPATH; wrangler 4 requires Node β₯ 20. The published site was also a multi-megabyte SPA for what is fundamentally a documentation site.
Decision
Replace the renderer with a first-party static site generator:
apps/wikiβ ~400 lines of TypeScript run by Bun, with shiki as the only dependency.It renders the Logseq subset this wiki actually uses: outline blocks,
[[wikilinks]]with a linked-references panel, namespaces with sub-page listings,key:: valueproperties (ADRstatus::gets colored chips),#tagswith tag pages, tables, and dual-theme highlighted code β plus a βK search index and a canvas force-directed graph view.Deploys run
bun x wrangler pages deployβ bun brings its own runtime, so the Node-version dance disappears. The hosting decision (Cloudflare Pages, wiki.lolwtf.ca, public) from ADR/0009 is unchanged, anddocs/remains a normal Logseq graph β the editing workflow is untouched.
Consequences
Builds take about a second instead of ~20 minutes; CI is checkout +
bun install+ one script.Full control over markup, theme, and payload β the site is a few hundred KB of static HTML.
We own a parser: it covers the constructs used today, but Logseq features we don't use (block refs
((β¦)), embeds,{{query}}) are unsupported β avoid them indocs/, or extendapps/wiki/build.tsfirst.The authentic Logseq SPA (and its native graph UI) is gone; the custom graph view at
/graph/fills that niche.
Links
ADR/0009 Logseq wiki on Cloudflare Pages, Contributing,
apps/wiki/README.md
Linked references 4
ADR/0010 First-party Bun SSG for the wiki β the renderer that actually builds it
This wiki is the docs/ directory of jonpulsifer/infra β a Logseq graph. Editing it is a normal PR; merging to main publishes it to wiki.lolwtf.ca via .github/workflows/wiki.yml (ADR/0009 Logseq wiki on Cloudflare Pages), rendered by the first-party Bun SSG in apps/wiki (ADR/0010 First-party Bun SSG for the wiki).
Renderer superseded by ADR/0010 First-party Bun SSG for the wiki β publish-spa pins Node 18 on PATH (incompatible with wrangler 4) and takes ~20 min per cold build. Hosting, domain, and graph layout here still stand.
The first deploy promptly broke β publish-spa leaked Node 18 onto PATH and wrangler 4 refused. Replaced the renderer with a first-party Bun SSG (apps/wiki) the same day: ADR/0010 First-party Bun SSG for the wiki. Builds went from ~20 minutes to ~1 second.