Skip to content

CC1: the blog on Workers - #2

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

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

Conversation

@pullely

@pullely pullely commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

vercel/next.js examples/cms-contentful in apps/web: Next.js 16.3.8 (upstream's latest is 16.4, which OpenNext does not support) with React 19, built by next build, then @opennextjs/cloudflare (standalone output, the static-assets incremental cache) into one Worker with Static Assets. / and /posts/[slug] render on request (force-dynamic, no generateStaticParams, reads no-store against Contentful's API CDN). The space id and Content Delivery API token are read at build and inlined into the server bundle (server-only); the preview token and the preview and revalidate secrets are Worker secrets read at request time. /api/draft checks CONTENTFUL_PREVIEW_SECRET, looks the post up through the Content Preview API, enables draft mode and redirects, in place of @contentful/vercel-nextjs-toolkit (Vercel's protection-bypass token); the template's preview URL is unchanged. With no space the blog is unconnected: three bundled sample posts under a "connect your Contentful space" notice, and draft mode answers 401 with the reason. An unknown post is a 404; the slug is quoted as a GraphQL string literal; an embedded rich-text image goes through the template's Contentful loader. The blog's name is one seam (SITE_NAME in app/site.ts: the heading, the title, the link home). The content-model import stays pnpm --filter @app/web run setup, a person's step with a management token. tests/web: identity, the sample mode, the GraphQL reads, the rich-text body and the draft route. typecheck, lint, test and build are green; wrangler dev serves the home page, every sample post, a 404, draft mode's 401, leaving draft mode and the webhook's 401. The Worker is 1.1 MiB gzipped.

🤖 Generated with Claude Code

vercel/next.js examples/cms-contentful in apps/web: Next.js 16.3.8 (upstream's `latest` is 16.4, which OpenNext does not support) with React 19, built by next build, then @opennextjs/cloudflare (standalone output, the static-assets incremental cache) into one Worker with Static Assets. / and /posts/[slug] render on request (force-dynamic, no generateStaticParams, reads no-store against Contentful's API CDN). The space id and Content Delivery API token are read at build and inlined into the server bundle (server-only); the preview token and the preview and revalidate secrets are Worker secrets read at request time. /api/draft checks CONTENTFUL_PREVIEW_SECRET, looks the post up through the Content Preview API, enables draft mode and redirects, in place of @contentful/vercel-nextjs-toolkit (Vercel's protection-bypass token); the template's preview URL is unchanged. With no space the blog is unconnected: three bundled sample posts under a "connect your Contentful space" notice, and draft mode answers 401 with the reason. An unknown post is a 404; the slug is quoted as a GraphQL string literal; an embedded rich-text image goes through the template's Contentful loader. The blog's name is one seam (SITE_NAME in app/site.ts: the heading, the title, the link home). The content-model import stays `pnpm --filter @app/web run setup`, a person's step with a management token. tests/web: identity, the sample mode, the GraphQL reads, the rich-text body and the draft route. typecheck, lint, test and build are green; wrangler dev serves the home page, every sample post, a 404, draft mode's 401, leaving draft mode and the webhook's 401. The Worker is 1.1 MiB gzipped.

Co-Authored-By: Claude <noreply@anthropic.com>
Orun-Task: CC-2
@pullely
pullely merged commit 669dcee into main Oct 28, 2026
2 checks passed
@pullely
pullely deleted the orun/CC-2-the-blog-on-workers branch October 28, 2026 06:01
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