Skip to content

Cloudflare/Next: add worker build step, standalone output, payload Cloudflare build detection, and replace demo homepage with ToDoPhuket UI - #3

Open
cryptohardcore wants to merge 2 commits into
mainfrom
codex/create-front-page-for-todophuket.com-1kgj1t
Open

cryptohardcore wants to merge 2 commits into
mainfrom
codex/create-front-page-for-todophuket.com-1kgj1t

Conversation

@cryptohardcore

Copy link
Copy Markdown
Owner

Motivation

  • Make the Next/Cloudflare build and deploy flow explicit and safe for CI by adding a worker build step and clarifying deploy commands to avoid uploading inactive Worker versions.
  • Ensure Payload configuration behaves correctly during the Next production build phase so Cloudflare platform bindings and logging are configured only when appropriate.
  • Replace the minimal demo homepage with a static ToDoPhuket sample UI and accompanying styles to provide a richer local preview and starter layout.

Description

  • Update package.json to run npm run build:worker after next build and add a build:worker script that runs opennextjs-cloudflare build --skipNextBuild.
  • Add output: 'standalone' to next.config.ts to produce a standalone Next output compatible with the Cloudflare/OpenNext flow.
  • Modify src/payload.config.ts to detect Next's production build phase via NEXT_PHASE === 'phase-production-build', set isNextBuild, and avoid using remote bindings during that phase; also enable the Cloudflare JSON logger in production.
  • Replace the previous Payload-authenticated demo page at src/app/(frontend)/page.tsx with a static, accessible ToDoPhuket homepage including sections for news, events, featured articles, and a real-estate search form, and export dynamic = 'force-dynamic' and revalidate = 0.
  • Overhaul src/app/(frontend)/styles.css with a new design: root variables, responsive grid layout, header/footer, card styles, and form controls for the new page.
  • Update README.md with deployment guidance emphasizing using pnpm run deploy or npx wrangler deploy for immediate production releases and warning against using npx wrangler versions upload alone.

Testing

  • No automated tests were run as part of this change.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
payloadcms a574bdb Jun 01 2026, 02:20 PM

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

output: 'standalone',

P2 Badge Keep the start script compatible with standalone output

With this setting enabled, the existing package.json start script still runs next start; after building this commit, Next 15 prints "next start" does not work with "output: standalone" configuration. Use "node .next/standalone/server.js" instead. This breaks the supported production-start path for anyone using pnpm start locally or in a non-Cloudflare deployment, so either update the start command to run the standalone server or avoid enabling standalone for that path.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant