### Preview Example App Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Builds and previews a specific example application end-to-end. Set SKIP_NEXT_APP_BUILD=true if only the adapter has changed. ```bash pnpm --filter preview ``` -------------------------------- ### Install and Postinstall Build Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Installs dependencies and triggers a postinstall build of the adapter. ```bash pnpm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md Command to install all project dependencies at the root of the workspace. ```sh > cd opennextjs-cloudflare > pnpm install ``` -------------------------------- ### Changeset File Example Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md A concrete example of a patch changeset for the @opennextjs/cloudflare package. ```md --- "@opennextjs/cloudflare": patch --- fix: replace the word "publish" with "deploy" everywhere. We should be consistent with the word that describes how we get a worker to the edge. The command is `deploy`, so let's use that everywhere. ``` -------------------------------- ### Start the development server Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/examples/bugs/gh-223/README.md Use these commands to launch the local development environment with your preferred package manager. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Bootstrap Next.js Middleware Example Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/examples/middleware/README.md Commands to initialize a new Next.js project with the middleware example template using different package managers. ```bash npx create-next-app --example middleware middleware-app ``` ```bash yarn create next-app --example middleware middleware-app ``` ```bash pnpm create next-app --example middleware middleware-app ``` -------------------------------- ### Run Development Server Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/examples/prisma/README.md Use these commands to start the Next.js development server. Open http://localhost:3000 in your browser to view the application. ```bash npm run dev ``` ```bash yarn dev ``` ```bash pnpm dev ``` ```bash bun dev ``` -------------------------------- ### Install Prerelease Package from Main Branch Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/README.md Install the latest prerelease version of the `@opennextjs/cloudflare` package from the main branch using npm. This version is updated with every push to main and is generally stable. ```bash npm i https://pkg.pr.new/@opennextjs/cloudflare@main ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/create-cloudflare/next/README.md Use this command to start the Next.js development server for local development. Open http://localhost:3000 to view the application. ```bash npm run dev # or similar package manager command ``` -------------------------------- ### Run Specific Example's End-to-End Tests Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Executes the Playwright end-to-end test suite for a particular example application. ```bash pnpm --filter e2e ``` -------------------------------- ### Run End-to-End Tests Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Executes the full suite of Playwright end-to-end tests against the example applications. ```bash pnpm e2e ``` -------------------------------- ### Bootstrap the blog starter project Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/examples/vercel-blog-starter/README.md Use the create-next-app CLI tool to initialize the project with the blog-starter template. ```bash npx create-next-app --example blog-starter blog-starter-app ``` ```bash yarn create next-app --example blog-starter blog-starter-app ``` ```bash pnpm create next-app --example blog-starter blog-starter-app ``` -------------------------------- ### Build and Preview Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md Commands for building the Cloudflare adaptor and previewing sample applications. ```sh pnpm --filter cloudflare build ``` ```sh pnpm --filter cloudflare build:watch ``` ```sh pnpm --filter app-router preview ``` ```sh SKIP_NEXT_APP_BUILD=true pnpm --filter app-router preview ``` -------------------------------- ### Run All Vitest Suites Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Builds the project and then executes all Vitest unit test suites. ```bash pnpm test ``` -------------------------------- ### Preview App with Wrangler Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/packages/cloudflare/README.md Run this command to preview your production build locally using Wrangler, Cloudflare's local development server. Ensure you have built the app first. ```bash npx wrangler dev ``` ```bash pnpm wrangler dev ``` ```bash yarn wrangler dev ``` ```bash bun wrangler dev ``` -------------------------------- ### Preview Application on Cloudflare Runtime Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/create-cloudflare/next/README.md This command allows you to preview the application locally using the Cloudflare runtime environment. Ensure you have the necessary Cloudflare configurations set up. ```bash npm run preview # or similar package manager command ``` -------------------------------- ### Build App for Cloudflare Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/packages/cloudflare/README.md Use this command to build your Next.js application and adapt it for deployment on Cloudflare. This is a prerequisite for previewing or deploying. ```bash npx opennextjs-cloudflare build ``` ```bash pnpm opennextjs-cloudflare build ``` ```bash yarn opennextjs-cloudflare build ``` ```bash bun opennextjs-cloudflare build ``` -------------------------------- ### Clone and Configure Repository Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md Commands to clone a fork, verify remotes, and add the upstream repository for synchronization. ```sh > git clone https://github.com//opennextjs-cloudflare > cd opennextjs-cloudflare ``` ```sh > git remote -v origin https://github.com//opennextjs-cloudflare (fetch) origin https://github.com//opennextjs-cloudflare (push) ``` ```sh > git remote add upstream https://github.com/opennextjs/opennextjs-cloudflare > git remote -v origin https://github.com//opennextjs-cloudflare (fetch) origin https://github.com//opennextjs-cloudflare (push) upstream https://github.com/opennextjs/opennextjs-cloudflare (fetch) upstream https://github.com/opennextjs/opennextjs-cloudflare (push) ``` -------------------------------- ### Build Cloudflare Adapter Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Builds the @opennextjs/cloudflare package from the repository root. ```bash pnpm build ``` -------------------------------- ### Watch Cloudflare Adapter Build Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Rebuilds the Cloudflare adapter on file changes. Use this for development. ```bash pnpm --filter cloudflare build:watch ``` -------------------------------- ### Deploy Application to Cloudflare Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/create-cloudflare/next/README.md Execute this command to deploy your Next.js application to Cloudflare. This command handles the build and deployment process. ```bash npm run deploy # or similar package manager command ``` -------------------------------- ### Create a Changeset Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Generates a changeset file to manage versioning and changelogs for the project. ```bash pnpm changeset ``` -------------------------------- ### Deploy App to Cloudflare Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/packages/cloudflare/README.md Execute these commands to build your Next.js application for Cloudflare and then deploy it to production. This process ensures your app is optimized for the Cloudflare environment. ```bash npx opennextjs-cloudflare build && npx opennextjs-cloudflare deploy ``` ```bash pnpm opennextjs-cloudflare build && pnpm opennextjs-cloudflare deploy ``` ```bash yarn opennextjs-cloudflare build && yarn opennextjs-cloudflare deploy ``` ```bash bun opennextjs-cloudflare build && bun opennextjs-cloudflare deploy ``` -------------------------------- ### Manage Changesets Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md Commands to create a new changeset and stage it for commit. ```sh pnpm changeset ``` ```sh git add ./changeset/*.md ``` -------------------------------- ### Run Tests Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md Commands to execute unit tests via Vitest or end-to-end tests via Playwright. ```sh pnpm run test ``` ```sh pnpm run e2e pnpm run e2e:dev ``` -------------------------------- ### Sync with Upstream Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md Commands to update the local main branch from the upstream repository. ```sh > git switch main > git pull upstream main From https://github.com/opennextjs/opennextjs-cloudflare * branch main -> FETCH_HEAD Already up to date. ``` -------------------------------- ### Changeset Format Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Follow this format when creating a changeset. The type indicates the nature of the change (feature, fix, refactor, docs, chore), and the body explains the reasoning. ```markdown : ``` -------------------------------- ### Changeset Message Format Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md The standard template for changeset files to ensure consistency in the generated changelog. ```text : <BODY> [BREAKING CHANGES <BREAKING_CHANGE_NOTES>] ``` -------------------------------- ### Auto-fix Code Formatting and Linting Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Automatically fixes code formatting issues with Prettier and linting issues with ESLint. ```bash pnpm fix ``` -------------------------------- ### Run Code Checks Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Performs code quality checks including Prettier formatting, ESLint linting, and TypeScript type checking. ```bash pnpm code:checks ``` -------------------------------- ### Run End-to-End Tests in Development Mode Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/AGENTS.md Executes the Playwright end-to-end tests in development mode, likely with watch capabilities. ```bash pnpm e2e:dev ``` -------------------------------- ### Code Quality Checks Source: https://github.com/opennextjs/opennextjs-cloudflare/blob/main/CONTRIBUTING.md Commands to run linting, formatting, and type checks, or to automatically fix issues. ```sh pnpm run code:checks ``` ```sh pnpm run fix ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.