Repository navigation
MC1: the blog on Workers - #2
Merged
Merged
Conversation
microcmsio/simple-blog-with-microcms (4077da9, the template behind Vercel's Next.js Blog with microCMS) in apps/web as one Cloudflare Worker with Static Assets (cloudflare-workers-assets-turbo). The template's tree is kept — app/ (home, /p/[current], /blogs/[slug], /tags/[tagId] and its pages, /search and its pages, not-found), components/, constants/, libs/, public/, microcms-template.json, its ESLint and TypeScript configuration and its MIT LICENSE. Next ^16.4.1 → 16.4.5 on @opennextjs/cloudflare 1.20.16, both pinned (1.20.16's floor on the 16 line): output standalone traced from the workspace root, images unoptimized, BASE_URL inlined per environment, the static-assets incremental cache, and wrangler.jsonc with nodejs_compat and Workers Observability. libs/microcms.ts reads MICROCMS_SERVICE_DOMAIN and MICROCMS_API_KEY per request from the Worker (getCloudflareContext().env; process.env without a context) and creates the SDK client per request — upstream threw at module load without them; while either is missing every read is answered by libs/sample.ts (three posts, two tags and a writer in the template's API shapes) under a 'not connected' notice (components/ConnectMicroCMS). The layout is force-dynamic. proxy.ts is removed: its rule (a draft, ?dk=, never cached) is a second headers() entry after the template's CDN-Cache-Control one — OpenNext runs a Node proxy only experimentally and appended its header. One seam, app/site.ts: the title template, the Open Graph title, the logo's alt text and the footer read SITE_NAME. An article's canonical URL is /blogs/<id> (upstream: /articles/<id>, which does not exist). apps/web/component.yaml unsets the microCMS secrets for the build and pushes them to the Worker after it (tooling/wire/worker-secrets.mjs; a verify lane holds no Cloudflare credential and pushes nothing); the smoke reads the home page and a missing article's 404. tests/web (vitest): the reads and their sample fallback (the Worker's env over the process, a key changed between reads), the highlighting, the template's components, the cache headers and the sample content against microcms-template.json. The Worker is 1.9 MiB gzipped (Workers Free). typecheck, lint, test and build are green; wrangler dev answers every route with the sample posts, and — behind a test-only entry that sends *.microcms.io to a local stand-in — the service's posts, an article with its writer, a draft and a tag. Co-Authored-By: Claude <noreply@anthropic.com> Orun-Task: MC-2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
microcmsio/simple-blog-with-microcms (4077da9, the template behind Vercel's Next.js Blog with microCMS) in apps/web as one Cloudflare Worker with Static Assets (cloudflare-workers-assets-turbo). The template's tree is kept — app/ (home, /p/[current], /blogs/[slug], /tags/[tagId] and its pages, /search and its pages, not-found), components/, constants/, libs/, public/, microcms-template.json, its ESLint and TypeScript configuration and its MIT LICENSE. Next ^16.4.1 → 16.4.5 on @opennextjs/cloudflare 1.20.16, both pinned (1.20.16's floor on the 16 line): output standalone traced from the workspace root, images unoptimized, BASE_URL inlined per environment, the static-assets incremental cache, and wrangler.jsonc with nodejs_compat and Workers Observability. libs/microcms.ts reads MICROCMS_SERVICE_DOMAIN and MICROCMS_API_KEY per request from the Worker (getCloudflareContext().env; process.env without a context) and creates the SDK client per request — upstream threw at module load without them; while either is missing every read is answered by libs/sample.ts (three posts, two tags and a writer in the template's API shapes) under a 'not connected' notice (components/ConnectMicroCMS). The layout is force-dynamic. proxy.ts is removed: its rule (a draft, ?dk=, never cached) is a second headers() entry after the template's CDN-Cache-Control one — OpenNext runs a Node proxy only experimentally and appended its header. One seam, app/site.ts: the title template, the Open Graph title, the logo's alt text and the footer read SITE_NAME. An article's canonical URL is /blogs/ (upstream: /articles/, which does not exist). apps/web/component.yaml unsets the microCMS secrets for the build and pushes them to the Worker after it (tooling/wire/worker-secrets.mjs; a verify lane holds no Cloudflare credential and pushes nothing); the smoke reads the home page and a missing article's 404. tests/web (vitest): the reads and their sample fallback (the Worker's env over the process, a key changed between reads), the highlighting, the template's components, the cache headers and the sample content against microcms-template.json. The Worker is 1.9 MiB gzipped (Workers Free). typecheck, lint, test and build are green; wrangler dev answers every route with the sample posts, and — behind a test-only entry that sends *.microcms.io to a local stand-in — the service's posts, an article with its writer, a draft and a tag.
🤖 Generated with Claude Code