diff --git a/specs/epics/README.md b/specs/epics/README.md index 29155e3..aa616d8 100644 --- a/specs/epics/README.md +++ b/specs/epics/README.md @@ -7,5 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace. | Epic | Cluster | Status | What it is | |------|---------|--------|------------| +| [`screwfast/`](./screwfast/) | **SF** | In progress (SF0) | Vercel's ScrewFast template — an Astro marketing site in English and French with Starlight docs in seven languages — built static and served as Cloudflare Workers Static Assets behind one Worker, and an Orun baseline that instantiates it (SF2) | As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`. diff --git a/specs/epics/screwfast/IMPLEMENTATION-STATUS.md b/specs/epics/screwfast/IMPLEMENTATION-STATUS.md new file mode 100644 index 0000000..16a5491 --- /dev/null +++ b/specs/epics/screwfast/IMPLEMENTATION-STATUS.md @@ -0,0 +1,11 @@ +# screwfast — implementation status + +| Milestone | State | Landed | +|---|---|---| +| SF0 — the spec | ✅ | the repository's first commit | +| SF1 — the site on Workers | planned | SF-2 | +| SF2 — a baseline | planned | SF-3 | + +## Departures from the upstream template + +Recorded as they land, from SF1 on. diff --git a/specs/epics/screwfast/README.md b/specs/epics/screwfast/README.md new file mode 100644 index 0000000..6f3098f --- /dev/null +++ b/specs/epics/screwfast/README.md @@ -0,0 +1,34 @@ +# screwfast — Vercel's ScrewFast template on Cloudflare Workers + +**ScrewFast builds fully static — its docs, their search index and every +optimised image included — so the port is where it is served: `dist/` as +Cloudflare Workers Static Assets behind one small Worker (the French 404 +page under `/fr/`), deployed by Orun to stage and prod on every merge, with +the site's name moved into one seam the copy reads — and the baseline that +makes a copy of it somebody else's site in one landing.** + +| | | +|---|---| +| Status | In progress — SF0 on main | +| Upstream | [mearashadowfax/ScrewFast](https://github.com/mearashadowfax/ScrewFast) (MIT), at `86b25a9` (2026-10-27; the repository has no release tags) | +| Reference | [astro-boilerplate](https://github.com/sourceplane/astro-boilerplate) — the same scaffolding, tests and bootstrap; [astro-paper](https://github.com/sourceplane/astro-paper) and [astrowind](https://github.com/sourceplane/astrowind) — the same static build behind one Worker | +| Key | `SF` | + +## Read in this order + +1. [design.md](design.md) — the template, 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 template. + +## Milestones + +| Milestone | What it lands | Task | +|---|---|---| +| SF0 — the spec | the repository, its intent, CI, tooling and spec index; this doc set | SF-1 | +| SF1 — the site on Workers | the template in `apps/web`, built static with its docs and their index, served as assets behind one Worker, its name one seam | SF-2 | +| SF2 — a baseline | the console card, the build document, the context pack and the baseline's tests | SF-3 | diff --git a/specs/epics/screwfast/design.md b/specs/epics/screwfast/design.md new file mode 100644 index 0000000..16d2cca --- /dev/null +++ b/specs/epics/screwfast/design.md @@ -0,0 +1,94 @@ +# screwfast — design + +## The template + +[ScrewFast](https://github.com/mearashadowfax/ScrewFast) is an Astro 7, +Tailwind CSS 4 and Preline UI marketing site for a fictional hardware and +construction company: a home page (hero, clients, features, pricing, FAQ, +testimonials, statistics), products with a page per product, services, +contact with a demo form, a blog and customer insights, with GSAP and Lenis +animation and light and dark mode. The marketing pages exist in English +(`/`) and French (`/fr/`): their words are typed copy tables +(`src/copy/en.ts`, `fr.ts` — a key missing from French fails `astro check`), +their data per-language files (`src/data_files/`), and a middleware resolves +the locale per page. Beside them is a Starlight documentation section in +seven languages (English, German, Spanish, Farsi right to left, French, +Japanese, Simplified Chinese) with Starlight's Pagefind search, the +template's own Starlight components (its site title, head, theme switch) and +the site's 404 page in place of Starlight's. + +It is `output: 'static'`: every route is a file at build time, the demo's +Unsplash photos are downloaded and optimised with the rest, and the build +minifies the pages afterwards (`astro check && astro build && node +process-html.mjs`). On Vercel, `vercel.json` adds security headers and +rewrites unknown French paths to the French 404 page. + +## How it maps to Cloudflare + +| Vercel | Here | Why | +|---|---|---| +| Static output on Vercel's CDN | `dist/` as Workers Static Assets, uploaded with `-web-` | The template is static; the assets are the site | +| `vercel.json` headers | `public/_headers`, the same headers | Workers Static Assets serve a `_headers` file's rules with every asset | +| `vercel.json` rewrite `/fr/:path*` → `/fr/404` | One Worker, `apps/web/worker/index.ts`: a path under `/fr/` matching no file answers `/fr/404/` with a 404 | The assets serve the nearest `404.html`, and Astro writes the French 404 page as `fr/404/index.html`; the composition deploys a Worker with its assets anyway | +| The host's 404 | `not_found_handling: 404-page` → `dist/404.html` with a 404 | The template's own 404 page (Starlight's is disabled) | +| Directory pages linked with a trailing slash | `assets.html_handling: auto-trailing-slash` | Astro writes `/index.html`; `/products` redirects to `/products/` | +| Starlight's Pagefind step | Unchanged: Starlight indexes the built docs into `dist/pagefind`, served as assets | Search is client-side over a static index | +| `site: 'https://screwfast.uk'` | `PUBLIC_SITE_URL` per deploy: the environment's `SITE_URL`, else its workers.dev URL; `.example.com` for a local build | Canonical, hreflang and Open Graph links, the sitemap and robots.txt need an origin at build | + +## The repository + +The same as astro-boilerplate's, with astro-paper'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 name + +This baseline's slug is the template's own name, and the template is a +company's site: the name is in its constants, its copy tables in both +languages (titles, descriptions, the hero, the services, the testimonials), +its features, pricing and FAQ data, its logos' labels, its web app manifest, +Starlight's title, and throughout its demo content. So the site's name moves +into one seam, `SITE_NAME` in `src/site.ts`, and every place in the code that +named the company reads it: the copy tables' strings become template +literals over it, the data files that named it become TypeScript modules +doing the same, the constants' title is it, Starlight's title is +`` `${SITE_NAME} Docs` ``. A site named something else says that name on +every page's chrome and in all its copy — and `src/test/site.test.ts` holds +it there, rendering with a different name. + +The demo content under `src/content` — the products, posts, insights and +docs — is the template's writing as that company, and keeps its name: it is +masked from the rename and allowed in the leftover sweep, there only and in +the template's spelling only, with the template's repository and its name in +the credits. Because the slug is one word that the template writes +`ScrewFast`, the sweep looks for it in any case: `Screwfast`, `SCREWFAST` or +a `screwfast_` file name (the template's Starlight logo files, renamed) fails +it anywhere else, as the slug, its Pascal form and its env prefix do. + +## 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 that the home page links its French version, that +`/products/` lists the first product, that the docs' welcome page and their +search index are served, and that unknown paths are 404s — the French page +under `/fr/`. + +## Out of scope + +- The contact form: the template's is a demo that submits nowhere, as + upstream. +- The demo content: it stays the template's until a site replaces it. + +## The alternative rejected + +**Astro's Cloudflare adapter**, as astro-boilerplate uses. It would move the +build's prerendering — 109 pages in seven languages and their images — into +workerd through the Cloudflare Vite plugin, emit a server entry nothing +calls and generate a second wrangler config, for a site with no on-demand +route. A static build with a Worker in front of it is what the template is; +the Worker earns its place with the French 404 page. diff --git a/specs/epics/screwfast/epic.yaml b/specs/epics/screwfast/epic.yaml new file mode 100644 index 0000000..6f2941e --- /dev/null +++ b/specs/epics/screwfast/epic.yaml @@ -0,0 +1,31 @@ +# The epic's declaration. metadata.name equals the directory name; metadata.key +# is the task-key prefix this epic reserves (SF → SF-1, SF-2, …). Owner, target +# date and health are the platform's — never written here. +apiVersion: orun.io/v1 +kind: Epic +metadata: + name: screwfast + key: SF +spec: + title: "Vercel's ScrewFast template on Cloudflare Workers" + summary: "ScrewFast — an Astro, Tailwind CSS and Preline UI marketing site (home, products, services, pricing, FAQ, contact, a blog and customer insights, in English and French) with a Starlight documentation section in seven languages and its search — 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 site from nothing to live on stage and prod in one landing." + state: started + milestones: + - name: "SF0 — 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: [SF-1] + - name: "SF1 — the site on Workers" + exitCriteria: + - "apps/web is the upstream template, built static with its docs and their search index, with one Worker in front of dist/ as Workers Static Assets that serves the French 404 page under /fr/" + - "the site's name is one seam that the copy, the data, the logos, the manifest and the docs' title read" + - "`pnpm typecheck`, `pnpm lint`, `pnpm test` and `pnpm build` are green" + - "`wrangler dev` serves every marketing page in both languages, the docs in all seven, the search index, the security headers, directory URLs and both 404 pages" + - "the README says how to run, test, preview and deploy it, and how every Vercel piece maps to Cloudflare" + tasks: [SF-2] + - name: "SF2 — a baseline" + exitCriteria: + - "blueprint.yaml (the console card) and repo-blueprint.yaml (the build) take a new site 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 template's credit and demo content 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: [SF-3] diff --git a/specs/epics/screwfast/implementation-plan.md b/specs/epics/screwfast/implementation-plan.md new file mode 100644 index 0000000..9ae22d9 --- /dev/null +++ b/specs/epics/screwfast/implementation-plan.md @@ -0,0 +1,39 @@ +# screwfast — implementation plan + +Three milestones, each one reviewed pull request (SF0 is the repository's +first commit), each green before it merges. + +## SF0 — the spec (SF-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. + +## SF1 — the site on Workers (SF-2) + +- The template's `src/`, `public/`, `astro.config.mjs`, `process-html.mjs`, + its smoke script and its Prettier configuration in `apps/web`, its + dependencies in `apps/web/package.json`; Astro and MDX held where the + runners' Node 22 can run them. +- `worker/index.ts` and `wrangler.jsonc`: the Worker in front of `dist/`, + directory URLs, both 404 pages; `public/_headers`, the template's headers. +- The site's name in `src/site.ts`, read by the copy, the data, the + constants, the logos, the manifest and Starlight; the origin from + `PUBLIC_SITE_URL` through Astro's `site`; the GitHub links to the site's + own repository and the contact address on its domain. +- `component.yaml`: the deploy contract and its smoke. +- Tests (`src/test`): the name seam (another name, rendered), the origin, + the Worker. +- The README's "How it maps to Vercel". + +## SF2 — a baseline (SF-3) + +astro-boilerplate's machinery, renamed: `blueprint.yaml`, +`repo-blueprint.yaml`, `.baseline/` (identity, product README, task +contracts), `tooling/rebrand` (the template's credit and demo content +masked; the slug swept in any case), `tooling/bootstrap`, +`hooks/render-deployment-docs.sh` (probing `/`, `/products/` and the docs), +`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`. diff --git a/specs/epics/screwfast/risks-and-open-questions.md b/specs/epics/screwfast/risks-and-open-questions.md new file mode 100644 index 0000000..49ca1aa --- /dev/null +++ b/specs/epics/screwfast/risks-and-open-questions.md @@ -0,0 +1,12 @@ +# screwfast — risks and open questions + +| ID | Risk | State | Notes | +|---|---|---|---| +| SF-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 | +| SF-B | A Worker in front of a static site | ACCEPTED | The composition deploys a Worker with its assets; this one answers only what no file matches, with the site's 404 page — the French one under `/fr/`, as the template's Vercel rewrite did. A request that matches a file never reaches it | +| SF-C | Absolute links are built in, per environment | ACCEPTED | Canonical, hreflang and Open Graph links, the sitemap and robots.txt 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 | +| SF-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 | +| SF-E | The build downloads the demo's Unsplash photos | ACCEPTED | Astro's image service fetches the remote avatars and product shots at build time and optimises them, as upstream; every lane has the network. Replacing them with local images removes it | +| SF-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 | +| SF-G | The slug is the template's own name | RESOLVED | The code reads the site's name from one seam; the demo content keeps the template's company name, masked there only, with the template's repository and its name in the credits. The slug is swept in any case, so any other spelling anywhere else fails. `testing/rebrand.test.sh` holds both sides, `apps/web/src/test/site.test.ts` the seam | +| SF-H | The demo content names the template's company | ACCEPTED | A site's chrome and copy say its own name from its first build; its products, posts, insights and docs say the template's until the owner replaces them (README, "Make the site yours") | diff --git a/tasks/SF-1.TaskContract.yaml b/tasks/SF-1.TaskContract.yaml new file mode 100644 index 0000000..e542b38 --- /dev/null +++ b/tasks/SF-1.TaskContract.yaml @@ -0,0 +1,15 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SF-1 + title: "The spec" +spec: + goal: The screwfast repository is born with its intent, CI, tooling and spec index, and the screwfast epic — declaration, doc set and task contracts — is on main + affects: + - specs/epics/screwfast + - specs/epics/README.md + - tasks + doneWhen: + - epic.yaml, README, design, implementation plan, risks and status are on main + - the three task contracts exist + gates: [] diff --git a/tasks/SF-2.TaskContract.yaml b/tasks/SF-2.TaskContract.yaml new file mode 100644 index 0000000..e35d670 --- /dev/null +++ b/tasks/SF-2.TaskContract.yaml @@ -0,0 +1,17 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SF-2 + title: "The site on Workers" +spec: + goal: ScrewFast runs on Cloudflare Workers + Static Assets — built static with its docs and their search index, served as assets behind one Worker that answers the French 404 page under /fr/, its name one seam the copy reads — with its README saying how it maps to Vercel + affects: + - apps/web + - pnpm-lock.yaml + - pnpm-workspace.yaml + - README.md + - .gitignore + doneWhen: + - pnpm typecheck, lint, test and build are green + - wrangler dev serves every marketing page in both languages, the docs in all seven, the search index, the headers and both 404 pages + gates: [] diff --git a/tasks/SF-3.TaskContract.yaml b/tasks/SF-3.TaskContract.yaml new file mode 100644 index 0000000..613c441 --- /dev/null +++ b/tasks/SF-3.TaskContract.yaml @@ -0,0 +1,28 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SF-3 + title: "screwfast becomes an Orun baseline" +spec: + goal: blueprint.yaml and repo-blueprint.yaml take a new ScrewFast site 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/screwfast + - README.md + doneWhen: + - every Baseline CI tier is green + - a site placed from it carries the site only, branded, with the template's credit and demo content intact + gates: []