Skip to content

CS1: the blog on Workers - #2

Merged
pullely merged 1 commit into
mainfrom
orun/CS-2-the-blog-on-workers
Oct 15, 2026
Merged

pullely merged 1 commit into
mainfrom
orun/CS-2-the-blog-on-workers

Conversation

@pullely

@pullely pullely commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

CS1 — the blog on Workers. apps/web is Vercel's Blog with Sanity CMS with the Workers build around it: sanity schema extract --force && sanity typegen generate at prebuild (offline), next build (standalone output, traced from the monorepo root; placeholder project id and dataset and a build-placeholder token when unset, so the credential-free build runs — verified with a fetch guard that it contacts no Sanity API), opennextjs-cloudflare build, populateCache local into the static-assets bundle. tests/web exercises urlForImage / resolveOpenGraphImage / resolveHref, the DateComponent, and GET /api/draft-mode/enable end to end through next-sanity/draft-mode and @sanity/preview-url-secret with a mocked client (8 tests).

Verified locally: typecheck, lint (0 errors, 1 upstream warning), test and build green; wrangler deploy --dry-run uploads 7.6 MB / 1.58 MB gzip with no Studio code in the Worker (the Studio is 10 MB of _next/static chunks); wrangler dev over the built Worker answers /studio (200, the shell with noindex), /studio/structure (200), its chunks and /favicon.ico (200), /nope (404), /api/draft-mode/enable without a secret (401 Invalid secret, no network), and / + /posts/[slug] reach Sanity's API CDN (with the placeholder project: 500, Sanity's "Dataset not found"). Departures from upstream, recorded in IMPLEMENTATION-STATUS.md: force-dynamic + fetchCache = "force-no-store" on the blog layout and generateStaticParams removed (ISR cannot run on the read-only static-assets cache; the API CDN's 60 s TTL is the interval upstream matched), the Studio loaded client-side only and its layout's metadata written out (both re-exports put sanity into the Worker's SSR chunks), VisualEditing from next-sanity/visual-editing, Cloudflare Web Analytics in place of Speed Insights (opt-in by NEXT_PUBLIC_CF_BEACON_TOKEN), next-sanity 13 / sanity 6 / @sanity/client as an explicit peer, Tailwind 4 CSS-first (Studio v6's stylesheet uses cascade layers Tailwind 3's PostCSS plugin rejects), the eslint 9 flat config with @typescript-eslint/no-explicit-any off by name, .env.example + .dev.vars.example in place of .env.local.example.

🤖 Generated with Claude Code

apps/web is Vercel's Blog with Sanity CMS with the Workers build around it:
typegen at prebuild (offline, against the schema), next build (standalone,
traced from the monorepo root, placeholders for the project id, dataset and
token when unset), opennextjs-cloudflare build, populateCache into the
static-assets bundle. tests/web exercises the image URL builder, the date
component and the draft-mode enable route end to end with a mocked client.

Departures from upstream, all recorded in the epic: the blog routes are
force-dynamic with fetchCache force-no-store (ISR cannot run on the
read-only static-assets cache; Sanity's API CDN is the 60 s cache) and
generateStaticParams goes with it, the Studio loads client-side only so
the sanity package ships as static assets and not inside the Worker (7.6 MB
instead of 31 MB uploaded), VisualEditing comes from
next-sanity/visual-editing, Speed Insights becomes the Cloudflare Web
Analytics beacon (opt-in by token), next-sanity 13 and sanity 6 are the
lines that declare Next 16, and Tailwind 4 replaces 3 because Studio v6's
stylesheet uses cascade layers Tailwind 3 rejects.

Orun-Task: CS-2
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@pullely
pullely merged commit 441a82b into main Oct 15, 2026
3 checks passed
@pullely
pullely deleted the orun/CS-2-the-blog-on-workers branch October 15, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants