foolish-bandit/gary: Cloudflare Workers deploy path via @opennextjs/cloudflare

Three commits add a documented, working deploy path to Cloudflare Workers: Next.js bumped to 16.0.11 to satisfy `@opennextjs/cloudflare`'s peer requirement, a `wrangler.jsonc` added, and `cf:*` npm scripts plus README instructions documented.

infrastructure

The dependency bump is the prerequisite. @opennextjs/cloudflare requires next ~16.0.11 or ^16.1.5; the fork was pinned at 16.0.3. Commit b6dc0e42 pulls it forward and resolves the lockfile. The bulk of that diff is package-lock.json churn: several @cloudflare/* and @babel/* packages move from devOptional or dev: true to runtime dependencies, which is a side effect of the adapter's build requirements.

The wrangler.jsonc (commit f01df75f) is minimal: worker name "gary", compatibility_date: "2026-05-07", nodejs_compat and global_fetch_strictly_public flags, an assets binding pointed at .open-next/assets, a self-referencing WORKER_SELF_REFERENCE service binding for caching (per the OpenNext caching docs), and an IMAGES binding for image optimization.

The three new npm scripts are:

"cf:build":   "opennextjs-cloudflare build"
"cf:deploy":  "opennextjs-cloudflare deploy"
"cf:preview": "opennextjs-cloudflare preview"

cf:build produces the bundle in frontend/.open-next/; cf:deploy publishes it. The README gains a Deployment section with those three commands and a note that this targets Workers (not Cloudflare Pages).

This is a hosting stance decision, not a feature. Vercel is the default for Next.js; foolish-bandit chose the edge Workers path instead and documented it cleanly. The global_fetch_strictly_public flag is worth checking against your own network topology -- it restricts fetch to public addresses only.

So what Worth a look if you're considering Cloudflare Workers as your deployment target. The `wrangler.jsonc` and scripts are a solid starting point. Skip it if you're deploying elsewhere -- the lockfile changes from the Next.js bump are extensive and this PR brings no feature changes.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

3 commits from foolish-bandit/gary, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
b6dc0e42 Bump next to 16.0.11 for Cloudflare deploy compatibility Claude 2026-05-07 ↗ GitHub
commit body
@opennextjs/cloudflare requires next ~16.0.11 or ^16.1.5; the pin at
16.0.3 broke install on the Cloudflare deploy. Bumping to 16.0.11
satisfies the peer range with the smallest possible version change.
React, React DOM, @opennextjs/cloudflare, and other deps are unchanged
- the lockfile churn beyond the next version bump is just npm
renormalizing dev/devOptional flags and deduping transitive deps.

https://claude.ai/code/session_01McEfVnpbGdMs5TgeTM7P3R
f01df75f Add minimal wrangler.jsonc for Cloudflare deploy Claude 2026-05-07 ↗ GitHub
commit body
After bumping next to satisfy the peer range, the next failure on the
Cloudflare deploy was that opennextjs-cloudflare build couldn't find
a wrangler config. Adding the canonical default the @opennextjs/cloudflare
CLI emits: project name "gary", nodejs_compat + global_fetch_strictly_public
flags, ASSETS binding, the OpenNext self-reference service binding (required
for the OpenNext caching layer per opennext.js.org/cloudflare/caching), and
the IMAGES binding for image optimization.

https://claude.ai/code/session_01McEfVnpbGdMs5TgeTM7P3R
befcd221 Add cf:* scripts and Workers deploy docs Claude 2026-05-07 ↗ GitHub
commit body
The frontend deploys to Cloudflare Workers via @opennextjs/cloudflare,
not Cloudflare Pages. Add explicit cf:build, cf:deploy, cf:preview
scripts so the Cloudflare project's build/deploy commands map directly
to npm scripts (the existing combined preview/deploy/upload scripts
are kept for backward compatibility). Document the Workers deploy
flow in the README so contributors don't reach for the Pages path.

wrangler.jsonc already satisfies the OpenNext-on-Workers requirements
(main: .open-next/worker.js, assets.directory: .open-next/assets,
assets.binding: ASSETS, compatibility_flags includes nodejs_compat).

https://claude.ai/code/session_01McEfVnpbGdMs5TgeTM7P3R

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-277.md from inside the repo you want the changes in.

⬇ Download capture-thread-277.md