f4c-build-infra v0.1.0
subsystem
capsule://quake0day/[email protected]
Provides the necessary configuration and scripts for building, deploying, and running the Next.js application as a Cloudflare Worker using OpenNext.js and Wrangler. It includes GitHub Actions workflows and Cloudflare-specific configuration files.
Owns
- Cloudflare Worker configuration (`wrangler.jsonc`)
- OpenNext.js build configuration (`open-next.config.ts`)
- GitHub Actions workflows for CI/CD
- Node.js version management (`.node-version`, `.nvmrc`)
- Cloudflare-specific TypeScript declarations (`cloudflare-env.d.ts`)
Does not own
- Application source code
- Core logic or UI components
- Generic development tooling (linting, formatting)
AI orientation
This capsule defines the build and deployment pipeline for Cloudflare. Agents should focus on optimizing build times, ensuring correct Worker bindings, and maintaining deployment stability. Any changes to the application's Cloudflare infrastructure should be made here.
Avoid
- Modifying application logic or UI components.
- Introducing non-Cloudflare specific build tools or configurations.
Provides
cli:cf-build— Command to build the Next.js app for Cloudflare Workers.cli:cf-deploy— Command to deploy the Cloudflare Worker.env:Cloudflare Worker Bindings— Defines Cloudflare KV and Durable Object bindings for the worker.
Requires
env:CLOUDFLARE_API_TOKEN— Cloudflare API token for deployment.env:CLOUDFLARE_ACCOUNT_ID— Cloudflare account ID for deployment.env:NEXT_PUBLIC_TURNSTILE_SITE_KEY— Public Turnstile site key, baked into frontend at build time.library:@opennextjs/cloudflare— Library for deploying Next.js apps to Cloudflare Workers.library:wrangler— Cloudflare's CLI tool for Workers.
Dependencies
Capsules
f4c-bot-service>=0.1.0f4c-room-api>=0.1.0f4c-scheduled-cleanup>=0.1.0
Invariants (must always hold)
- The `cf-build` script must successfully compile the Next.js app into a Cloudflare Worker.
- The `wrangler.jsonc` must correctly define all necessary KV and Durable Object bindings.
Source files (8)
Click any file to view its content; the path on the right shows where the file lands when this capsule is installed.
src/.github/workflows/deploy-web.yml→github/workflows/deploy-web.ymlsrc/app/.node-version→node-versionsrc/app/.nvmrc→nvmrcsrc/app/cloudflare-env.d.ts→cloudflare-env.d.tssrc/app/open-next.config.ts→open-next.config.tssrc/app/tsconfig.json→tsconfig.jsonsrc/app/worker.ts→worker.tssrc/app/wrangler.jsonc→wrangler.jsonc
Plus capsule.yaml and
install.json.