Skip to content
Merged
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
1 change: 1 addition & 0 deletions specs/epics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace.

| Epic | Cluster | Status | What it is |
|------|---------|--------|------------|
| [`astro-paper/`](./astro-paper/) | **AP** | In progress (AP0) | Vercel's AstroPaper template — an Astro blog with Pagefind search and build-time Open Graph images — built static and served as Cloudflare Workers Static Assets behind one Worker, and an Orun baseline that instantiates it (AP2) |

As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`.
11 changes: 11 additions & 0 deletions specs/epics/astro-paper/IMPLEMENTATION-STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# astro-paper — implementation status

| Milestone | State | Landed |
|---|---|---|
| AP0 — the spec | ✅ | the repository's first commit |
| AP1 — the blog on Workers | planned | AP-2 |
| AP2 — a baseline | planned | AP-3 |

## Departures from the upstream template

Recorded as they land, from AP1 on.
33 changes: 33 additions & 0 deletions specs/epics/astro-paper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# astro-paper — Vercel's AstroPaper template on Cloudflare Workers

**AstroPaper builds fully static — its search index and Open Graph images
included — so the port is where it is served: `dist/` as Cloudflare Workers
Static Assets behind one small Worker, deployed by Orun to stage and prod on
every merge — and the baseline that makes a copy of it somebody else's blog
in one landing.**

| | |
|---|---|
| Status | In progress — AP0 on main |
| Upstream | [satnaing/astro-paper](https://github.com/satnaing/astro-paper) (MIT), at `35cfa7f` (v6.1.0 and one fix, 2026-08-05) |
| Reference | [astro-boilerplate](https://github.com/sourceplane/astro-boilerplate) — the same scaffolding, tests and bootstrap; [astrowind](https://github.com/sourceplane/astrowind) — the same static build behind one Worker |
| Key | `AP` |

## Read in this order

1. [design.md](design.md) — the theme, how each Vercel piece maps to
Cloudflare, the repository and the build, and the alternative rejected.
2. [implementation-plan.md](implementation-plan.md) — the milestones and
what each one lands.
3. [risks-and-open-questions.md](risks-and-open-questions.md) — what is not
proven, and what was accepted.
4. [IMPLEMENTATION-STATUS.md](IMPLEMENTATION-STATUS.md) — what shipped, and
every departure from the upstream theme.

## Milestones

| Milestone | What it lands | Task |
|---|---|---|
| AP0 — the spec | the repository, its intent, CI, tooling and spec index; this doc set | AP-1 |
| AP1 — the blog on Workers | the theme in `apps/web`, built static with its search index and images, served as assets behind one Worker | AP-2 |
| AP2 — a baseline | the console card, the build document, the context pack and the baseline's tests | AP-3 |
84 changes: 84 additions & 0 deletions specs/epics/astro-paper/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# astro-paper — design

## The theme

[AstroPaper](https://github.com/satnaing/astro-paper) is a minimal,
responsive, accessible and SEO-friendly Astro 7 + Tailwind CSS 4 blog theme:
a home page with featured and recent posts, Markdown and MDX posts in
`src/content/posts/` (in folders, with drafts and scheduled posts), a
paginated posts index, tag pages, archives, an about page from
`src/content/pages/about.md`, full-text search with Pagefind, a dynamic Open
Graph image for the site (`/og.png`) and for every post without one of its
own (`/posts/<slug>/index.png`) rendered with satori and sharp, light and
dark mode, callouts, an image lightbox, an RSS feed and a sitemap. Its user
configuration is one file, `astro-paper.config.ts`, typed by
`defineAstroPaperConfig`; `src/config.ts` resolves it with defaults.

It is `output: 'static'`: every route is a file at build time, and the build
runs Pagefind over the output (`astro check && astro build && pagefind --site
dist`). Its demo is on Cloudflare Pages, and it ships a Dockerfile for nginx.

## How it maps to Cloudflare

| Vercel | Here | Why |
|---|---|---|
| Static output on Vercel's CDN | `dist/` as Workers Static Assets, uploaded with `<repo>-web-<env>` | The theme is static; the assets are the site |
| — | One Worker, `apps/web/worker/index.ts`, hands unmatched requests to the assets | The `cloudflare-workers-assets-turbo` composition deploys a Worker with its assets; a request no file matches reaches it and gets the site's 404 |
| The build's Pagefind step | Unchanged: `pagefind --site dist` writes `dist/pagefind`, served as assets | Search is client-side over a static index |
| Open Graph images rendered at build | Unchanged: satori and sharp in Node during `astro build` | Nothing is rendered at request time; the Worker needs no image code |
| Directory pages linked with a trailing slash | `assets.html_handling: auto-trailing-slash` | The theme's own host (Cloudflare Pages) serves `/posts/<slug>/` and redirects `/posts/<slug>` to it |
| The host's 404 | `not_found_handling: 404-page` → `dist/404.html` with a 404 | The theme's own 404 page |
| `site.url: https://astro-paper.pages.dev/` | `PUBLIC_SITE_URL` per deploy: the environment's `SITE_URL`, else its workers.dev URL; `site.url` (`<repo>.example.com`) for a local build | Canonical and Open Graph links, the sitemap, robots.txt and the RSS feed need an origin at build |

## The repository

The same as astro-boilerplate's, with astrowind's static build: `apps/web` is
the only component (type `cloudflare-workers-assets-turbo`, lane `isolated`,
deployed on stage and prod on a push to `main`, verified on dev and on pull
requests), its tests live in the app because Astro components render only
under Astro's Vite config, and there is no infrastructure: no database, no
bucket, no runtime secret. The site's name is one seam, `SITE_NAME` in
`src/site.ts`, which `astro-paper.config.ts` reads as `site.title` — the
header, every page's title, the Open Graph site name and images, the feed.
`astro.config.ts` takes `PUBLIC_SITE_URL` over the config's `site.url`, and
`src/config.ts` resolves the URL from Astro's own `site`
(`import.meta.env.SITE`), so the feed and the images use the same origin as
the canonical links. The edit-post link and the GitHub social link point at
the site's own repository.

This baseline's slug is the theme's own name, and the theme spells it in its
code and its writing: its config file is `astro-paper.config.ts` (imported by
that name), its helper `defineAstroPaperConfig`, its home page introduces it
by name, and its posts — its documentation and its release notes — name it
throughout, its release posts at URLs like `/posts/astro-paper-v6/`. Renaming
the config file or the helper would leave those posts describing a file and
a function the site does not have, so the rename engine masks them as the
theme's credit, with the theme's repository and the home page's sentence.
In the posts and pages under `src/content` the theme's name in either
spelling is the theme's. Everywhere else — every code file, every manifest,
every doc a site carries — the slug, its Pascal form and its env prefix
still fail the leftover sweep.

## The build

`repo-blueprint.yaml` is astro-boilerplate's: one landing (`01-product`)
places, brands and lands the whole tree, one convergence builds and deploys
stage and prod side by side, and `03-docs` records what went live. The
smoke checks the home page is the theme's, that `/posts/` lists its posts,
that the search index is served, and that an unknown path is a 404.

## Out of scope

- Comments: the theme documents Giscus in a post; it is not wired, as
upstream.
- Google Search Console: `site.googleVerification` (or
`PUBLIC_GOOGLE_SITE_VERIFICATION` at build) is empty, as upstream.

## The alternative rejected

**Astro's Cloudflare adapter**, as astro-boilerplate uses. It would move the
build's prerendering into workerd through the Cloudflare Vite plugin, emit a
server entry nothing calls, generate a second wrangler config the e2e tier
would have to hold to the committed one, and move the Open Graph images'
sharp out of Node — all for a site with no on-demand route. A static build
with a Worker in front of it is what the theme is.
30 changes: 30 additions & 0 deletions specs/epics/astro-paper/epic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# The epic's declaration. metadata.name equals the directory name; metadata.key
# is the task-key prefix this epic reserves (AP → AP-1, AP-2, …). Owner, target
# date and health are the platform's — never written here.
apiVersion: orun.io/v1
kind: Epic
metadata:
name: astro-paper
key: AP
spec:
title: "Vercel's AstroPaper template on Cloudflare Workers"
summary: "AstroPaper — a minimal, accessible Astro blog theme (Markdown and MDX posts with tags, archives and pagination, Pagefind search, an Open Graph image per post rendered at build time, light and dark mode, RSS and a sitemap) — builds fully static and is served as Cloudflare Workers Static Assets behind one small Worker, inside the Cirrus baseline's repository conventions, and becomes an Orun baseline that takes a new blog from nothing to live on stage and prod in one landing."
state: started
milestones:
- name: "AP0 — the spec"
exitCriteria:
- "the repository is born with its intent, CI, tooling and spec index, and this doc set and the task contracts are on main"
tasks: [AP-1]
- name: "AP1 — the blog on Workers"
exitCriteria:
- "apps/web is the upstream theme, built static with its Pagefind index and Open Graph images, with one Worker in front of dist/ as Workers Static Assets"
- "`pnpm typecheck`, `pnpm lint`, `pnpm test` and `pnpm build` are green"
- "`wrangler dev` serves every page, post, tag page, image, feed and sitemap, the search index, directory URLs and the site's own 404"
- "the README says how to run, test, preview and deploy it, and how every Vercel piece maps to Cloudflare"
tasks: [AP-2]
- name: "AP2 — a baseline"
exitCriteria:
- "blueprint.yaml (the console card) and repo-blueprint.yaml (the build) take a new blog from nothing to live on stage and prod in one landing, then record it"
- "a site built from it carries the site only, renamed throughout to its own name, repository and Worker, with the theme's credit intact"
- "Baseline CI is green: contract tests, generated component docs, the blueprint read by the pinned orun, the leak gate, the offline bootstrap and the end-to-end tier"
tasks: [AP-3]
37 changes: 37 additions & 0 deletions specs/epics/astro-paper/implementation-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# astro-paper — implementation plan

Three milestones, each one reviewed pull request (AP0 is the repository's
first commit), each green before it merges.

## AP0 — the spec (AP-1)

The repository is born: `intent.yaml` with the placeholder workspace
`ws_CHANGE_ME`, `ci.yml` (byte for byte turso-starter's, which plans nothing
until the workspace is set), the shared TypeScript and ESLint configuration,
the spec index, this doc set and the task contracts.

## AP1 — the blog on Workers (AP-2)

- The theme's `src/`, `public/`, `astro-paper.config.ts`, `astro.config.ts`,
ESLint and Prettier configuration in `apps/web`, its dependencies in
`apps/web/package.json`, its VS Code post snippets beside the workspace's
settings.
- `worker/index.ts` and `wrangler.jsonc`: the Worker in front of `dist/`,
directory URLs, the 404 page.
- The site's name in `src/site.ts`, read as `site.title`; the origin from
`PUBLIC_SITE_URL` through Astro's `site`; the edit and GitHub links to the
site's own repository.
- `component.yaml`: the deploy contract and its smoke.
- Tests (`src/test`): the name seam, the header, the origin, the Worker.
- The README's "How it maps to Vercel".

## AP2 — a baseline (AP-3)

astro-boilerplate's machinery, renamed: `blueprint.yaml`,
`repo-blueprint.yaml`, `.baseline/` (identity, product README, task
contracts), `tooling/rebrand` (with the theme's credit masked: its
repository, its config API, its home page's sentence, its own posts),
`tooling/bootstrap`, `hooks/render-deployment-docs.sh` (probing `/` and
`/posts/`), `docs/phases/`, the context pack, `testing/` (the leak and
placement gates on this tree's files; the e2e tier reading every route the
site promises) and `baseline.yml` / `tag.yml`.
11 changes: 11 additions & 0 deletions specs/epics/astro-paper/risks-and-open-questions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# astro-paper — risks and open questions

| ID | Risk | State | Notes |
|---|---|---|---|
| AP-A | `baseline-v1` is not yet proven live | OPEN | Proven offline in Baseline CI: the offline bootstrap with the blueprint's own hooks, the stage lane's own steps in a staged job tree, the site served by `wrangler dev` and smoke-tested with the component's own command. A console bootstrap closes it |
| AP-B | A Worker in front of a static site | ACCEPTED | The composition deploys a Worker with its assets; this one only hands unmatched requests back to the assets. It costs nothing a request that matches a file pays: those are served without reaching it |
| AP-C | Absolute links are built in, per environment | ACCEPTED | Canonical and Open Graph links, the sitemap, robots.txt and the RSS feed carry the origin the deploy built for: the environment's `SITE_URL` (a custom domain), else its workers.dev URL. Attaching a domain is setting `SITE_URL` and merging; a local build uses `astro-paper.config.ts`'s `site.url` |
| AP-D | The tests live in the app | ACCEPTED | Astro components render only under Astro's Vite config (the container API); a `tests/web` package would need it anyway |
| AP-E | The build fetches its font over the network | ACCEPTED | Astro's Fonts API downloads Google Sans Code from Google Fonts at build time, as upstream, and the Open Graph images read it back; every lane has the network |
| AP-F | stack-tectonic 0.19.0, not 0.20.0 | ACCEPTED | 0.20.0's lane-shared install links each job's `node_modules` out of its tree; the siblings pin 0.19.0 for it and the site would save nothing |
| AP-G | The slug is the theme's own name | RESOLVED | The theme's credit is masked from the rename and allowed in the leftover sweep, each piece exactly: its repository, its config file, helper and types, the home page's sentence, and its name in its own posts and pages. Anything else spelling the slug, `AstroPaper` or `ASTRO_PAPER_` fails. `testing/rebrand.test.sh` holds both sides |
15 changes: 15 additions & 0 deletions tasks/AP-1.TaskContract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: orun.io/v1
kind: TaskContract
metadata:
name: AP-1
title: "The spec"
spec:
goal: The astro-paper repository is born with its intent, CI, tooling and spec index, and the astro-paper epic — declaration, doc set and task contracts — is on main
affects:
- specs/epics/astro-paper
- specs/epics/README.md
- tasks
doneWhen:
- epic.yaml, README, design, implementation plan, risks and status are on main
- the three task contracts exist
gates: []
18 changes: 18 additions & 0 deletions tasks/AP-2.TaskContract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: orun.io/v1
kind: TaskContract
metadata:
name: AP-2
title: "The blog on Workers"
spec:
goal: AstroPaper runs on Cloudflare Workers + Static Assets — built static with its search index and Open Graph images, served as assets behind one Worker — with its README saying how it maps to Vercel
affects:
- apps/web
- pnpm-lock.yaml
- pnpm-workspace.yaml
- README.md
- .gitignore
- .vscode
doneWhen:
- pnpm typecheck, lint, test and build are green
- wrangler dev serves every route the theme has, its search index, its images and its 404
gates: []
28 changes: 28 additions & 0 deletions tasks/AP-3.TaskContract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: orun.io/v1
kind: TaskContract
metadata:
name: AP-3
title: "astro-paper becomes an Orun baseline"
spec:
goal: blueprint.yaml and repo-blueprint.yaml take a new AstroPaper blog from nothing to live on stage and prod in one landing, held by Baseline CI
affects:
- blueprint.yaml
- repo-blueprint.yaml
- BOOTSTRAP.md
- .baseline
- .github/workflows/baseline.yml
- .github/workflows/tag.yml
- ai/context
- docs/phases
- hooks
- testing
- tooling/rebrand
- tooling/bootstrap
- tooling/catalog
- apps/web/docs
- specs/epics/astro-paper
- README.md
doneWhen:
- every Baseline CI tier is green
- a site placed from it carries the site only, branded, with the theme's credit intact
gates: []
Loading