Skip to content

Add Cloudflare as a deploy target to our website#1508

Merged
fabian-hiller merged 4 commits into
mainfrom
cloudflare-deploy
Jun 16, 2026
Merged

Add Cloudflare as a deploy target to our website#1508
fabian-hiller merged 4 commits into
mainfrom
cloudflare-deploy

Conversation

@fabian-hiller

@fabian-hiller fabian-hiller commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Adds Cloudflare Workers as a deploy target to serve the built dist for valibot.dev with workers.dev preview URLs. Sets caching/redirect rules and stabilizes the build to avoid concurrent rebuilds that previously broke playground bundles.

  • New Features

    • Added wrangler.jsonc to serve dist with html_handling: auto-trailing-slash, 404 handling, routes for valibot.dev, and workers.dev previews.
    • Added _headers and _redirects for immutable asset caching, CORS on playground bundles (*-index.min.mjs), OG 1‑day cache, Qwik q-data short cache with SWR, and guide redirects.
    • Scripts: new build.cloudflare (prebuilds library, packages/to-json-schema, and codemod/zod-to-valibot before site build) and deploy.cloudflare; Vercel deploy moved to deploy.vercel. .wrangler ignored in git.
    • Dependencies/workspace: added wrangler; enabled workerd builds and allowed new Cloudflare packages via minimumReleaseAgeExclude. Security: pinned shell-quote@1 to 1.8.4 via workspace overrides.
  • Migration

    • Cloudflare: pnpm --filter website build.cloudflare then pnpm --filter website deploy.cloudflare. Vercel: pnpm --filter website deploy.vercel.
    • Production serves via valibot.dev; branch previews use workers.dev URLs.

Written for commit faefb57. Summary will update on new commits.

Review in cubic

Copilot AI review requested due to automatic review settings June 16, 2026 16:40
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
valibot Ready Ready Preview, Comment Jun 16, 2026 6:40pm

Request Review

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. github GitHub related changes tooling Tooling for devs labels Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 80bdfee5-4f35-4d2c-8a6a-26f1819ab784

📥 Commits

Reviewing files that changed from the base of the PR and between 2ebf553 and faefb57.

📒 Files selected for processing (1)
  • website/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/package.json

Walkthrough

This PR adds Cloudflare Workers static-assets deployment support for the valibot website. A new website/wrangler.jsonc file defines the Workers project configuration, serving built assets from ./dist with HTML trailing-slash handling and a 404 fallback, routed to valibot.dev via custom domain. New _headers and _redirects files configure response caching, CORS, and URL redirects. The website/package.json scripts are updated to include build.cloudflare and separate deploy.cloudflare/deploy.vercel scripts, with wrangler added to devDependencies. The root pnpm-workspace.yaml allows the workerd native binary to build and excludes Cloudflare-related packages from minimum release age checks. .wrangler is added to website/.gitignore.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding Cloudflare as a deployment target for the website, which is the primary objective reflected in all modified files.
Description check ✅ Passed The description is directly related to the changeset, providing comprehensive details about adding Cloudflare Workers deployment, configuration files, build scripts, and dependencies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/valibot@1508

commit: faefb57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Cloudflare Workers as an additional deployment target for the website/ package, including Wrangler configuration and Cloudflare-compatible redirect/header rules.

Changes:

  • Add wrangler.jsonc and new deploy.cloudflare / build.cloudflare scripts to deploy the built static site via Cloudflare Workers.
  • Introduce Cloudflare _redirects and _headers files to replicate existing redirect/caching behavior.
  • Update pnpm workspace config + lockfile to allow/build Cloudflare tooling (wrangler, workerd, miniflare).

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/wrangler.jsonc Adds Wrangler (Workers static assets) configuration for deploying the built site.
website/public/_redirects Adds Cloudflare redirect rules mirroring the existing guide redirects.
website/public/_headers Adds Cloudflare header rules for caching and CORS on built assets.
website/package.json Adds wrangler dev dependency and new Cloudflare build/deploy scripts.
website/.gitignore Ignores Wrangler local state directory.
pnpm-workspace.yaml Allows building workerd and excludes very recent Cloudflare-related releases from minimum release age.
pnpm-lock.yaml Locks wrangler and its dependency tree.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/wrangler.jsonc
Comment thread website/public/_headers
Comment thread website/public/_headers

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@website/package.json`:
- Around line 21-22: The deploy.cloudflare script in package.json runs wrangler
deploy directly without ensuring the build step completes first, which can
deploy stale artifacts. Update the deploy.cloudflare script to chain the
build.cloudflare command before wrangler deploy by modifying it to run both
commands in sequence using &&, ensuring the dist directory is properly built
before deployment occurs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb18a521-9332-4b15-83ca-d02a3808e6cb

📥 Commits

Reviewing files that changed from the base of the PR and between c05bf95 and 301f8ec.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • pnpm-workspace.yaml
  • website/.gitignore
  • website/package.json
  • website/public/_headers
  • website/public/_redirects
  • website/wrangler.jsonc

Comment thread website/package.json

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 301f8ec702

ℹ️ 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".

Comment thread website/public/_headers

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread website/wrangler.jsonc
Comment thread website/public/_headers

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f141d3e51a

ℹ️ 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".

Comment thread website/package.json Outdated
@fabian-hiller fabian-hiller merged commit 9bb6617 into main Jun 16, 2026
17 checks passed
@fabian-hiller fabian-hiller deleted the cloudflare-deploy branch June 16, 2026 18:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faefb576d2

ℹ️ 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".

Comment thread website/wrangler.jsonc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github GitHub related changes size:M This PR changes 30-99 lines, ignoring generated files. tooling Tooling for devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants