Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10
version: 11.21.0

- name: Set up Node
uses: actions/setup-node@v6
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.12.0
24.19.0
2 changes: 1 addition & 1 deletion website/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.16.0
24.19.0
26 changes: 14 additions & 12 deletions website/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Site URL: `https://bub.build`

| Layer | Tool |
|---------------|----------------------------------------|
| Framework | **Astro 6** (static output) |
| Docs | **@astrojs/starlight** ≥ 0.38 |
| Framework | **Astro 7** (static output, Vite 8/Rolldown) |
| Docs | **@astrojs/starlight** ≥ 0.41 |
| Styling | **Tailwind CSS v4** via `@tailwindcss/vite` + `@astrojs/starlight-tailwind` |
| Component lib | shadcn/ui conventions (base-vega style) |
| Animations | `motion` (formerly Framer Motion) |
Expand All @@ -36,6 +36,8 @@ Site URL: `https://bub.build`

**pnpm** — always use `pnpm` to install packages and run scripts.

The repository pins pnpm in `package.json`. pnpm 11 build-script approvals and dependency overrides live in `pnpm-workspace.yaml`.

```bash
pnpm install # install deps
pnpm dev # dev server
Expand Down Expand Up @@ -139,7 +141,7 @@ Follows the **exact pattern** from [`withastro/starlight/docs`](https://github.c
**Locale configuration** — `astro.config.mjs`:
- English is the **`root` locale** — content files live under `src/content/docs/docs/` (e.g., `docs/getting-started/run-bub-locally.mdx`).
- Other locales get **subdirectories**: `src/content/docs/zh-cn/docs/getting-started/run-bub-locally.mdx`.
- The inner `docs/` directory creates the `/docs/` URL prefix — Starlight 0.38 has no `routePrefix` option, so this nesting is the standard way to namespace docs routes.
- The inner `docs/` directory creates the `/docs/` URL prefix, keeping documentation routes namespaced without changing content IDs.
- This keeps the URL scheme consistent: `/docs/…` for docs, `/posts/…` for blog.

```js
Expand All @@ -165,10 +167,12 @@ locales: {
sidebar: [{
label: 'Getting Started',
translations: { 'zh-CN': '快速开始' },
autogenerate: { directory: 'docs/getting-started' },
items: [{ autogenerate: { directory: 'docs/getting-started' } }],
}]
```

Astro 7 uses the Sätteri Markdown processor by default. Keep `astro-mermaid` at 2.1 or newer and register it before Starlight so Mermaid code blocks are transformed by the active processor.

**Content schema** — `src/content.config.ts`:
- Uses `docsLoader()` + `docsSchema()` from `@astrojs/starlight/loaders` and `@astrojs/starlight/schema`.
- Uses `i18nLoader()` + `i18nSchema()` for the i18n collection.
Expand Down Expand Up @@ -367,13 +371,12 @@ Starlight ships with a blue accent (hue 224/234) and blue-tinted grays. The main
3. Starlight bridge: @import '@astrojs/starlight-tailwind';
4. Tailwind layers: @import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/utilities.css' layer(utilities);
5. Animation utilities: @import "tw-animate-css"; (unlayered — @utility can't nest)
6. @theme inline { … } — fonts, Starlight color scales, site design tokens, radius
7. :root { … } — raw light tokens (unlayered)
8. .dark, [data-theme="dark"] { … } — raw dark tokens (unlayered)
9. :root { --sl-font/color overrides } — unlayered to beat bridge @layer utilities
10. .dark, [data-theme="dark"] { --sl-color-* overrides }
11. @layer base { … } — Tailwind preflight + site base resets (lowest priority)
5. @theme inline { … } — fonts, Starlight color scales, site design tokens, radius
6. :root { … } — raw light tokens (unlayered)
7. .dark, [data-theme="dark"] { … } — raw dark tokens (unlayered)
8. :root { --sl-font/color overrides } — unlayered to beat bridge @layer utilities
9. .dark, [data-theme="dark"] { --sl-color-* overrides }
10. @layer base { … } — Tailwind preflight + site base resets (lowest priority)
```

**Why this order matters:**
Expand All @@ -392,7 +395,6 @@ Starlight ships with a blue accent (hue 224/234) and blue-tinted grays. The main
- **Define Starlight colors via `@theme` scales** — `--color-accent-50` through `--color-accent-950` and `--color-gray-50` through `--color-gray-950`. The bridge reads these and generates `--sl-color-*` in `@layer utilities`.
- **Override `--sl-*` colors and fonts manually (unlayered)** — the bridge's auto-mapped values don't produce the right contrast for the monochrome theme. Unlayered `:root` / `.dark, [data-theme="dark"]` blocks with explicit `--sl-color-*` values win over the bridge's `@layer utilities` output.
- **Import `tailwindcss/preflight.css` in `@layer base`** — restores box-sizing, link resets, and other base styles that the split Tailwind import omits. Because `base` is the lowest layer, EC and Starlight styles still override it.
- **`tw-animate-css` must be imported unlayered** — it contains `@utility` directives that cannot be nested inside `@layer`.
- **The `@layer base` `*` reset is safe** — because EC styles live in `@layer starlight.components` (higher priority), they always win.

**Starlight color scales (in `@theme`):**
Expand Down
2 changes: 1 addition & 1 deletion website/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Recommended settings:
- Deploy command: `pnpm wrangler deploy`
- Path: `website`
- Environment variable: `SITE_URL=https://bub.build`
- Environment variable: `NODE_VERSION=22.16.0`
- Environment variable: `NODE_VERSION=24.19.0`
- Build secret: `GITHUB_TOKEN=<GitHub PAT>` (optional, recommended for higher GitHub API limits)

The repo keeps a minimal [wrangler.jsonc](./wrangler.jsonc) and relies on
Expand Down
16 changes: 9 additions & 7 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const image_service =

export default defineConfig({
// SSG by default; landing pages opt-in to SSR via `export const prerender = false`.
compressHTML: true,
adapter: cloudflare({
// Prefer an explicit mode from the calling command so local docs workflows
// stay deterministic. Fall back to the Astro command name for direct
Expand Down Expand Up @@ -52,6 +53,7 @@ export default defineConfig({
starlight({
title: 'Bub',
description: 'A common shape for agents that live alongside people.',
favicon: '/favicon.ico',
expressiveCode: false,
logo: {
light: './src/assets/bub-logo.png',
Expand All @@ -60,7 +62,7 @@ export default defineConfig({
},
// Use the resolved file URL so Vite's module graph reliably
// includes global.css on every Starlight docs page in dev mode.
// (Astro v6 scopes CSS per-page from the import graph; with a
// (Astro scopes CSS per-page from the import graph; with a
// relative path Vite occasionally fails to resolve / dedupe in
// dev, leaving the docs route unstyled even though
// `astro build` + preview both work.)
Expand All @@ -81,32 +83,32 @@ export default defineConfig({
{
label: 'Getting Started',
translations: { 'zh-CN': '快速开始' },
autogenerate: { directory: 'docs/getting-started' },
items: [{ autogenerate: { directory: 'docs/getting-started' } }],
},
{
label: 'Concepts',
translations: { 'zh-CN': '概念' },
autogenerate: { directory: 'docs/concepts' },
items: [{ autogenerate: { directory: 'docs/concepts' } }],
},
{
label: 'Operate',
translations: { 'zh-CN': '运行' },
autogenerate: { directory: 'docs/operate' },
items: [{ autogenerate: { directory: 'docs/operate' } }],
},
{
label: 'Build',
translations: { 'zh-CN': '构建' },
autogenerate: { directory: 'docs/build' },
items: [{ autogenerate: { directory: 'docs/build' } }],
},
{
label: 'Tutorials',
translations: { 'zh-CN': '教程' },
autogenerate: { directory: 'docs/tutorials' },
items: [{ autogenerate: { directory: 'docs/tutorials' } }],
},
{
label: 'Reference',
translations: { 'zh-CN': '参考' },
autogenerate: { directory: 'docs/reference' },
items: [{ autogenerate: { directory: 'docs/reference' } }],
},
],
}),
Expand Down
43 changes: 19 additions & 24 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "website",
"type": "module",
"version": "0.0.1",
"packageManager": "pnpm@11.21.0",
"engines": {
"node": ">=22.12.0"
"node": ">=24.0.0"
},
"scripts": {
"generate:github-snapshot": "node ./scripts/generate-github-snapshot.mjs",
Expand All @@ -14,32 +15,26 @@
"preview": "wrangler dev"
},
"dependencies": {
"@astrojs/cloudflare": "^13.1.9",
"@astrojs/starlight": "^0.38.3",
"@astrojs/cloudflare": "^14.2.1",
"@astrojs/starlight": "^0.41.7",
"@astrojs/starlight-tailwind": "^5.0.0",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"@fontsource-variable/outfit": "^5.2.8",
"@fontsource/noto-sans-sc": "^5.2.9",
"@fontsource/outfit": "^5.2.8",
"@tailwindcss/vite": "^4.1.14",
"astro": "^6.1.10",
"astro-mermaid": "^2.0.1",
"class-variance-authority": "^0.7.1",
"@fontsource-variable/jetbrains-mono": "^5.3.0",
"@fontsource-variable/outfit": "^5.3.0",
"@fontsource/noto-sans-sc": "^5.3.0",
"@fontsource/outfit": "^5.3.0",
"@tailwindcss/vite": "^4.3.3",
"astro": "^7.2.1",
"astro-mermaid": "^2.1.0",
"clsx": "^2.1.1",
"mermaid": "^11.15.0",
"motion": "^12.38.0",
"satori": "^0.26.0",
"sharp": "^0.34.2",
"tailwind-merge": "^3.5.0",
"tw-animate-css": "^1.4.0"
"mermaid": "^11.16.1",
"motion": "^13.1.0",
"satori": "^0.29.0",
"sharp": "^0.35.3",
"tailwind-merge": "^3.6.0"
},
"devDependencies": {
"@lucide/astro": "^1.8.0",
"react-grab": "^0.1.32",
"tailwindcss": "^4.1.14",
"wrangler": "^4.13.2"
},
"overrides": {
"vite": "^7.3.2"
"@lucide/astro": "^1.31.0",
"tailwindcss": "^4.3.3",
"wrangler": "^4.123.0"
}
}
Loading
Loading