diff --git a/specs/epics/README.md b/specs/epics/README.md index 19eeb1c..1bef85d 100644 --- a/specs/epics/README.md +++ b/specs/epics/README.md @@ -7,6 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace. | Epic | Cluster | Status | What it is | |------|---------|--------|------------| -| [`cms-sanity/`](./cms-sanity/) | **CS** | Draft | Vercel's Sanity CMS blog, equivalent in code and function, running on Cloudflare Workers + Static Assets via OpenNext | +| [`cms-sanity/`](./cms-sanity/) | **CS** | ✅ Shipped | Vercel's Sanity CMS blog, equivalent in code and function, running on Cloudflare Workers + Static Assets via OpenNext | As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`. diff --git a/specs/epics/cms-sanity/IMPLEMENTATION-STATUS.md b/specs/epics/cms-sanity/IMPLEMENTATION-STATUS.md index bc06deb..97f5a3a 100644 --- a/specs/epics/cms-sanity/IMPLEMENTATION-STATUS.md +++ b/specs/epics/cms-sanity/IMPLEMENTATION-STATUS.md @@ -5,9 +5,9 @@ the code departed from `design.md` or from the upstream template. | Milestone | State | PR | |---|---|---| -| CS0 — the spec | | | -| CS1 — the blog on Workers | | | -| CS2 — ready to instantiate | | | +| CS0 — the spec | ✅ Shipped | [#1](https://github.com/sourceplane/cms-sanity/pull/1) | +| CS1 — the blog on Workers | ✅ Shipped | [#2](https://github.com/sourceplane/cms-sanity/pull/2) | +| CS2 — ready to instantiate | ✅ Shipped | [#3](https://github.com/sourceplane/cms-sanity/pull/3) | ## Departures from the upstream template @@ -103,6 +103,30 @@ declares it as a peer. ## Verified +- Local: `pnpm typecheck`, `pnpm lint` (0 errors, 1 upstream warning), + `pnpm test` (8 tests), `pnpm build` green with no Sanity values set, and + green again under a `fetch` guard that fails on any `sanity.io` URL (the + build contacts no Sanity API; `next/font` fetches Inter). `wrangler deploy + --dry-run`: 7.6 MB uploaded, 1.58 MB gzip, no Studio code in + `handler.mjs` (4.8 MB; 21 MB before the client-side split). `wrangler dev` + over `.open-next/worker.js` with a throwaway `.dev.vars` token: `/studio` + 200 (the Studio shell, `robots: noindex`, `referrer: same-origin`, + `viewport-fit: cover`), `/studio/structure` 200, `_next/static` chunks + 200 (the 3.4 MB Studio chunk included), `/favicon.ico` 200, `/nope` 404, + `/api/draft-mode/enable` without a secret 401 `Invalid secret` with no + network; `/` and `/posts/nope` 500 because the placeholder build has no + project (Sanity's API CDN answers 404 `Dataset "placeholder" not found for + project ID "placeholder"`). Without `.dev.vars` every blog route and the + draft-mode route are 500 `Missing SANITY_API_READ_TOKEN` at module + evaluation, as upstream's `token.ts` dictates. +- CI: `Checks` green on #1 (12 s) and #2 (2 m 12 s); the Orun lanes skip + until `ORUN_CI` is set. +- Not verified: a page rendered from a real Sanity project (none was + contacted), the Presentation tool's live preview in a browser + (`risks-and-open-questions.md` CS-H), a live deploy (gated until the + product is linked to an Orun workspace with a Cloudflare connection), and + the Web Analytics beacon with a real token. + ## Versions | Package | Version | Why | diff --git a/specs/epics/cms-sanity/README.md b/specs/epics/cms-sanity/README.md index d77a19f..88c735c 100644 --- a/specs/epics/cms-sanity/README.md +++ b/specs/epics/cms-sanity/README.md @@ -8,7 +8,7 @@ The upstream code stays the code: the GROQ queries, the schemas, the Portable Te | Field | Value | |-------|-------| -| Status | Draft | +| Status | ✅ Shipped — CS0–CS2 landed (#1, #2, #3) | | Cluster | **CS** (CS0–CS2) | | Owner(s) | `apps/web` (the blog and the Studio) · `tests/web` (image URLs, the date component, the draft-mode route) | | Builds on | `cirrus-baseline` conventions; the `portfolio-starter-kit` port's build shape (static-assets incremental cache + `populateCache`) and its analytics beacon; the `turso-starter` port's `force-dynamic` answer to a read-only cache | @@ -16,7 +16,7 @@ The upstream code stays the code: the GROQ queries, the schemas, the Portable Te | Changes | Adds the Workers build, the monorepo wrapper, tests and the deploy contract; makes the blog routes dynamic; mounts the Studio client-side; swaps Speed Insights for one Cloudflare beacon; moves next-sanity/sanity to their Next 16 lines and Tailwind to 4 | | Decisions locked | (1) OpenNext on Workers + Static Assets, the static-assets incremental cache. (2) Blog routes `force-dynamic` + `fetchCache = "force-no-store"`; Sanity's API CDN is the cache; no R2/DO cache. (3) The Studio loads through `next/dynamic` with `ssr: false`; the Studio layout's metadata is written out, not re-exported. (4) Project id and dataset are build-time values exported by the Orun build from the product's secrets; the read token is a Worker secret. (5) Tailwind 4, CSS-first. | | Gate | CS1 is the first user-visible rung. | -| Shipped as | | +| Shipped as | `main` after [#3](https://github.com/sourceplane/cms-sanity/pull/3); verified locally under `wrangler dev` with no Sanity project, deploy gated until a workspace is linked | ## Read order diff --git a/specs/epics/cms-sanity/epic.yaml b/specs/epics/cms-sanity/epic.yaml index aeb87c2..4207c46 100644 --- a/specs/epics/cms-sanity/epic.yaml +++ b/specs/epics/cms-sanity/epic.yaml @@ -9,7 +9,7 @@ metadata: spec: title: "Vercel's Blog with Sanity CMS on Cloudflare Workers" summary: "Vercel's cms-sanity example — a blog whose posts, authors and settings live in a Sanity dataset, read with next-sanity and GROQ, with draft mode and live preview through the Presentation tool, Sanity TypeGen, AI Assist and Unsplash presets, and the Sanity Studio embedded at /studio — runs on Cloudflare Workers + Static Assets through @opennextjs/cloudflare inside the Cirrus baseline's repository conventions. Sanity stays the SaaS it is; the port moves the three things Workers force: the blog renders on request against Sanity's API CDN instead of ISR on a read-only cache, the Studio mounts client-side so it ships as static assets and not in the Worker, and Speed Insights becomes the Cloudflare Web Analytics beacon." - state: backlog + state: completed milestones: - name: "CS0 — the spec" exitCriteria: diff --git a/specs/epics/cms-sanity/implementation-plan.md b/specs/epics/cms-sanity/implementation-plan.md index 4f6ad30..b37d50c 100644 --- a/specs/epics/cms-sanity/implementation-plan.md +++ b/specs/epics/cms-sanity/implementation-plan.md @@ -3,7 +3,7 @@ Milestones land in order; each task is one pull request on an `orun/CS-n-` branch with an `Orun-Task: CS-n` trailer. -## CS0 — the spec +## CS0 — the spec ✅ This doc set, `epic.yaml` and the task contracts, merged to `main`. @@ -11,7 +11,7 @@ This doc set, `epic.yaml` and the task contracts, merged to `main`. - the five documents and `epic.yaml` are on `main` - `tasks/CS-1..CS-3.TaskContract.yaml` exist -## CS1 — the blog on Workers +## CS1 — the blog on Workers ✅ `apps/web` is the upstream template with the Workers build around it; `tests/web` exercises the image URL builder, the date component and the @@ -22,7 +22,7 @@ draft-mode enable route. - the Worker bundle holds no Studio code (`wrangler deploy --dry-run` well under the 3 MB gzip free-plan limit) and the Studio is in `_next/static` - `wrangler dev` answers `/studio` (200, the Studio shell with `robots: noindex`), `/studio/structure` (200), a `_next/static` chunk (200), `/favicon.ico` (200), `/nope` (404) and `/api/draft-mode/enable` without a secret (401 `Invalid secret`, no network); `/` and `/posts/[slug]` reach Sanity's API CDN for the configured project -## CS2 — ready to instantiate +## CS2 — ready to instantiate ✅ README (run, test, preview, deploy; the Sanity project, dataset and read token; `NEXT_PUBLIC_CF_BEACON_TOKEN`), `IMPLEMENTATION-STATUS.md`, epic