Static documentation site for the Sablier protocols (Lockup, Flow, Airdrops). Built with Docusaurus.
- Docusaurus 3.10 with
future.v4andfasterflags (static site generator) - TypeScript 5.8 (strict, extends
@docusaurus/tsconfig) - React 18.2 (pinned)
- Bun as package manager and runtime (Node >=20 required)
- Just as command runner (extends
@sablier/devkit/just/base.just) - MDX with KaTeX (math), Mermaid (diagrams),
llmfood(LLM-optimized output)
cli/— Bun-executedcommanderCLI (cli/index.ts) for autogen taskscli/commands/autogen/— generators fordeployments,graphql,indexerscli/autogen-reference.sh— shells out to generate Solidity reference docsconfig/— Docusaurus config split:head-tags,plugins,presets,redirects,sidebars,theme-configdocs/— MDX content:concepts/,guides/,reference/,api/,apps/,solana/,support/src/components/— atomic design (atoms/,molecules/,organisms/)src/pages/,src/theme/,src/css/,src/snippets/src/autogen/— generated MDX, never edit by hand (gitignored, regenerated)static/— static assets served as-isrepos/evm-monorepo— git submodule used as a source for autogen reference
Run via just (not raw bun docusaurus ...) so autogen runs first.
just start— autogen + dev server onlocalhost:3000just build— autogen + static build intobuild/just serve— serve the prebuilt sitejust clean— clear Docusaurus cache andsrc/autogen/**just full-check— Biome + Prettier + ESLint +tsc --noEmitjust full-write— apply Biome + Prettier + ESLint fixesjust autogen— regenerate everything with--overwritejust autogen-deployments/autogen-graphql/autogen-indexers/autogen-referencejust deploy— Vercel prod deploy (requires$VERCEL_TOKEN)
cli/autogen-reference.sh rebuilds docs/reference/{airdrops,bob,flow,lockup,utils}/contracts/ from the evm-monorepo
submodule via forge doc, then post-processes the output: rewrites forge-relative paths, resolves {Symbol} natspec
refs to docs links, copies evm-utils abstracts/interfaces into each consumer package, and applies targeted content
fixes. Run with bash cli/autogen-reference.sh from repo root.
Natspec for LockupMath.calculateStreamedAmountLD/LL/LPG in evm-monorepo writes math in Unicode-art (⎧⎨⎩, ⌊⌋,
─) so the Solidity source reads cleanly. KaTeX can't parse those, so the script does a perl -i -0pe pass that
rewrites the four affected $$...$$ blocks to LaTeX (\begin{cases}, \frac, \lfloor/\rfloor, \cdot). See the
if [ "$repo" = "lockup" ]; then branch in cli/autogen-reference.sh.
If natspec adds a new Unicode-art block or changes the text inside an existing one, the substitutions silently no-op and
broken art leaks into the published docs. After autogen, grep
docs/reference/lockup/contracts/libraries/library.LockupMath.md for ⎧ ⎨ ⎩ ⌊ ⌋ ─ - inside $$...$$ and add a
matching substitution. Long-term fix: rewrite the natspec in evm-monorepo as LaTeX directly.
- Content lives in
docs/**/*.{md,mdx}. Filename numeric prefixes (01-,02-) drive sidebar order. - Markdown is prose-wrapped (
proseWrap: "always"in Prettier). Don't reflow paragraphs by hand — let Prettier do it. onBrokenLinks: "throw"andonBrokenMarkdownLinks: "throw"— every link must resolve at build time.- Use Mermaid in fenced
```mermaidblocks; math via$...$/$$...$$(remark-math + rehype-katex). - Redirects go in
config/redirects.ts; never write client-side redirect hacks in pages. llmfoodplugin emitsllms-{airdrops,flow,lockup,full}.txt. When adding a top-level docs section, updateincludePatternsandsectionOrderinconfig/plugins.ts.
- BiomeJS (
ultracite/core+@sablier/devkit/biome/base) is the source of truth for TS/JS/JSON/CSS — runjust biome-writebefore committing. - ESLint runs only on MD/MDX (see
eslint.config.mjs). Don't add ESLint rules for TS. - Prettier handles MD/MDX formatting; Biome handles everything else. Don't fight them.
- TypeScript: prefer functional patterns, explicit return types on exports, no
any. - Path imports use
baseUrl: ".", so referencesrc/...andconfig/...from project root. - React components follow atomic design — pick the right tier (
atoms→molecules→organisms).
- Never edit files under
src/autogen/— regenerate viajust autogen-*. - Never edit files under
repos/— they are git submodules. - Don't bump
react/react-dompast 18.2 without checking Docusaurus compatibility. node_modules,build,.docusaurus,repos,src/autogenare excluded from Biome andtsc.- Husky + lint-staged run on commit — don't
--no-verifyto bypass failures; fix the lint issue.
- Default branch:
main. Submodules underrepos/— rungit submodule update --init --recursiveafter clone. - PRs: fork → feature branch →
just full-check→ PR.
@README.md @package.json