Skip to content

Commit 963c197

Browse files
authored
Merge pull request #1 from btravstack/feat/vitepress-monorepo
Restructure landing into a turborepo (@btravstack/theme + VitePress website)
2 parents 2d934cc + b763a2b commit 963c197

37 files changed

Lines changed: 3501 additions & 559 deletions

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["@btravstack/website"]
11+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy Website
2+
3+
# Builds apps/website (VitePress) and publishes it to GitHub Pages.
4+
# Requires: repo Settings → Pages → Source = "GitHub Actions".
5+
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- "apps/website/**"
11+
- "packages/theme/**"
12+
- "pnpm-lock.yaml"
13+
- "pnpm-workspace.yaml"
14+
- ".github/workflows/deploy-website.yml"
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
# Allow one concurrent deployment; don't cancel an in-progress production deploy.
23+
concurrency:
24+
group: pages
25+
cancel-in-progress: false
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: pnpm/action-setup@v4
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: 22
36+
cache: pnpm
37+
- run: pnpm install --frozen-lockfile
38+
# turbo builds @btravstack/theme first (the website depends on it)
39+
- run: pnpm turbo run build --filter=@btravstack/website
40+
- uses: actions/configure-pages@v5
41+
- uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: apps/website/.vitepress/dist
44+
45+
deploy:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
steps:
52+
- id: deployment
53+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
# Publishes @btravstack/theme to npm via changesets.
4+
#
5+
# Auth uses npm Trusted Publishing (OIDC) — no NPM_TOKEN. Prerequisites:
6+
# 1. The @btravstack scope/org exists on npmjs.com.
7+
# 2. @btravstack/theme has a Trusted Publisher configured pointing at this
8+
# repo + this workflow file (.github/workflows/release.yml).
9+
# 3. Repo secret RELEASE_PAT (classic PAT with `repo`, or fine-grained with
10+
# Contents + Pull requests read/write) so the "Version Packages" PR fires CI.
11+
12+
on:
13+
push:
14+
branches: [main]
15+
16+
concurrency: ${{ github.workflow }}-${{ github.ref }}
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
id-token: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
token: ${{ secrets.RELEASE_PAT }}
29+
- uses: pnpm/action-setup@v4
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 22
33+
cache: pnpm
34+
# npm Trusted Publishing (OIDC) requires npm >= 11.5.1
35+
- run: npm install -g npm@latest
36+
- run: pnpm install --frozen-lockfile
37+
- name: Create Release Pull Request or Publish to npm
38+
uses: changesets/action@v1
39+
with:
40+
version: pnpm run version
41+
publish: pnpm run release
42+
commit: "chore: release packages"
43+
title: "chore: release packages"
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
dist/
3+
.turbo/
4+
*.tsbuildinfo
5+
6+
# VitePress
7+
apps/website/.vitepress/cache/
8+
apps/website/.vitepress/dist/
9+
10+
.DS_Store

.nojekyll

Whitespace-only changes.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# btravstack web
2+
3+
Turborepo for the btravstack website and its shared VitePress theme.
4+
5+
```
6+
packages/theme/ @btravstack/theme — shared VitePress theme + design tokens (published to npm)
7+
apps/website/ the btravstack landing site (VitePress) → deployed to GitHub Pages
8+
```
9+
10+
## Develop
11+
12+
```sh
13+
pnpm install
14+
pnpm dev # runs the website dev server (builds the theme on demand)
15+
pnpm build # builds the theme, then the website
16+
```
17+
18+
## How it fits together
19+
20+
- **`@btravstack/theme`** wraps VitePress's default theme with the btravstack
21+
design tokens (beetroot brand, Montserrat + JetBrains Mono, light/dark
22+
surfaces). Every btravstack site — this website and the `amqp-contract` /
23+
`temporal-contract` / `unthrown` docs — depends on it, so they all share one
24+
look. It's built with `tsdown` and published to npm via `.github/workflows/release.yml`
25+
(changesets + npm Trusted Publishing).
26+
- **`apps/website`** is a VitePress site that consumes the theme via
27+
`workspace:*` and is deployed to GitHub Pages by `.github/workflows/deploy-website.yml`.
28+
29+
## Releasing the theme
30+
31+
Add a changeset (`pnpm changeset`), merge to `main`; the Release workflow opens
32+
a version PR and, when merged, publishes `@btravstack/theme`. Consumers bump the
33+
dependency to adopt it.

apps/website/.vitepress/config.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { defineConfig } from "vitepress";
2+
3+
const SITE_TITLE = "btravstack";
4+
const SITE_DESCRIPTION =
5+
"Type-safe building blocks for the TypeScript backend: contracts for AMQP & Temporal, and errors as values.";
6+
const SITE_URL = "https://btravstack.github.io";
7+
8+
// https://vitepress.dev/reference/site-config
9+
export default defineConfig({
10+
title: SITE_TITLE,
11+
titleTemplate: "An expressive, robust TypeScript backend",
12+
description: SITE_DESCRIPTION,
13+
lang: "en-US",
14+
// user/org site (btravstack.github.io) is served from the domain root
15+
base: "/",
16+
cleanUrls: true,
17+
sitemap: { hostname: SITE_URL },
18+
19+
head: [
20+
["link", { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }],
21+
["link", { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" }],
22+
["meta", { property: "og:type", content: "website" }],
23+
["meta", { property: "og:title", content: `${SITE_TITLE} — an expressive, robust TypeScript backend` }],
24+
["meta", { property: "og:description", content: SITE_DESCRIPTION }],
25+
["meta", { property: "og:url", content: `${SITE_URL}/` }],
26+
["meta", { property: "og:image", content: `${SITE_URL}/og-btravstack.png` }],
27+
["meta", { name: "twitter:card", content: "summary_large_image" }],
28+
["meta", { name: "twitter:image", content: `${SITE_URL}/og-btravstack.png` }],
29+
],
30+
31+
themeConfig: {
32+
logo: { light: "/logos/btravstack-light.svg", dark: "/logos/btravstack-dark.svg" },
33+
nav: [
34+
{ text: "Packages", link: "/#packages" },
35+
{
36+
text: "Docs",
37+
items: [
38+
{ text: "amqp-contract", link: "https://btravstack.github.io/amqp-contract/" },
39+
{ text: "temporal-contract", link: "https://btravstack.github.io/temporal-contract/" },
40+
{ text: "unthrown", link: "https://btravstack.github.io/unthrown/" },
41+
],
42+
},
43+
],
44+
socialLinks: [{ icon: "github", link: "https://github.com/btravstack" }],
45+
footer: {
46+
message: "Type-safe building blocks for the TypeScript backend. Released under the MIT License.",
47+
copyright: "© 2026 Benoit Travers · betterave 🇫🇷",
48+
},
49+
search: { provider: "local" },
50+
},
51+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Theme from "@btravstack/theme";
2+
3+
export default Theme;

apps/website/index.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
layout: home
3+
4+
hero:
5+
name: btravstack
6+
text: An expressive, robust TypeScript backend
7+
tagline: Type-safe building blocks for Node — contracts for your messaging and workflows, and a principled way to handle errors. Define things once, let the types flow everywhere.
8+
image:
9+
light: /logos/btravstack-light.svg
10+
dark: /logos/btravstack-dark.svg
11+
alt: btravstack
12+
actions:
13+
- theme: brand
14+
text: Explore on GitHub
15+
link: https://github.com/btravstack
16+
17+
features:
18+
- icon:
19+
light: /logos/amqp-contract-light.svg
20+
dark: /logos/amqp-contract-dark.svg
21+
title: amqp-contract
22+
details: Type-safe contracts for AMQP & RabbitMQ. Define exchanges, queues and messages once — get types and runtime validation on both ends, reliable retries with DLQs, and AsyncAPI 3.0 generation.
23+
link: https://btravstack.github.io/amqp-contract/
24+
linkText: Read the docs
25+
- icon:
26+
light: /logos/temporal-contract-light.svg
27+
dark: /logos/temporal-contract-dark.svg
28+
title: temporal-contract
29+
details: Type-safe contracts for Temporal.io. End-to-end types and automatic validation across workflows, activities and clients, with Result / Future error handling.
30+
link: https://btravstack.github.io/temporal-contract/
31+
linkText: Read the docs
32+
- icon:
33+
light: /logos/unthrown-light.svg
34+
dark: /logos/unthrown-dark.svg
35+
title: unthrown
36+
details: Explicit errors as values, with a separate defect channel for the unexpected. Only a true defect ever throws, and only at unwrap. Zero runtime dependencies.
37+
link: https://btravstack.github.io/unthrown/
38+
linkText: Read the docs
39+
---

apps/website/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@btravstack/website",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"description": "btravstack landing site",
7+
"license": "MIT",
8+
"author": "Benoit TRAVERS",
9+
"scripts": {
10+
"build": "vitepress build .",
11+
"dev": "vitepress dev .",
12+
"preview": "vitepress preview ."
13+
},
14+
"dependencies": {
15+
"@btravstack/theme": "workspace:*"
16+
},
17+
"devDependencies": {
18+
"vitepress": "catalog:"
19+
}
20+
}

0 commit comments

Comments
 (0)