Migrate the documentation deployment from Netlify to Cloudflare Workers - #1719
Migrate the documentation deployment from Netlify to Cloudflare Workers#1719qunabu wants to merge 3 commits into
Conversation
Deploy the documentation site as the `hyperformula-docs` Cloudflare Worker, driven by Workers Builds. The Git integration is configured on the Cloudflare side, so no deployment workflow, API token or account secret lives in the repository: pushes to `master` deploy production, pushes to any other branch and every pull request upload a preview version with its own URL. - `wrangler.jsonc` serves the VuePress output as static assets. The asset directory is `docs/.vuepress/dist`, not `docs/.vuepress/dist/docs`, so that every document keeps the `/docs/` prefix it is built with. - `worker/index.js` resolves directory and extensionless URLs and redirects `/docs` to `/docs/`, while `"html_handling": "none"` keeps `.html` URLs served as they are. This reproduces the URL behaviour of the previous hosting. - `docs/.vuepress/cf/_headers` caches the content-hashed assets indefinitely, `docs/.vuepress/cf/_redirects` points the asset root at `/docs/`. Both are copied into the build output by `script/prepare-cf-assets.js`, as they have to sit in the root of the asset directory. - `.nvmrc` now selects Node.js 22, the version all CI workflows already use and the one the Cloudflare build image picks up from this file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for hyperformula-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | b8542ec | Commit Preview URL Branch Preview URL |
Jul 31 2026, 06:27 PM |
`not_found_handling: "404-page"` makes the asset router answer browser navigations (requests carrying `Sec-Fetch-Mode: navigate`) on its own, without invoking the Worker. Combined with `html_handling: "none"`, that turned every directory and extensionless URL into a 404 in browsers, while plain requests without the navigation headers kept working. Leave `not_found_handling` at `"none"` so that requests matching no asset reach the Worker, and serve the nearest `404.html` from there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8bf2585. Configure here.
Conflicts resolved as follows: - `package.json` — kept the `docs:dev` and `docs:build` scripts from `develop` (they now generate the built-in function docs first) and added the `docs:*:cf` scripts on top of them. - `package-lock.json` — regenerated from the `develop` lockfile. - `DEV_DOCS.md` — kept the rewritten file from `develop` and moved the deployment description into its `Documentation` section. - `.gitignore` — kept both sets of entries. - `netlify.toml` — stays deleted. `develop` had corrected its publish directory and Node.js version, but the file is obsolete with the deployment on Cloudflare.
|
@sequba @GreenFlux please let me know if you see any issues here https://feature-cloudflare-docs-deployment-hyperformula-docs.handsoncode.workers.dev/docs |
Performance comparison of head (b8542ec) vs base (ebaa2b2) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1719 +/- ##
========================================
Coverage 97.31% 97.31%
========================================
Files 195 195
Lines 15734 15734
Branches 3456 3456
========================================
Hits 15312 15312
Misses 414 414
Partials 8 8 🚀 New features to boost your workflow:
|

Summary
Move the documentation site off Netlify and onto Cloudflare Workers, deployed as the
hyperformula-docsWorker in the Handsontable account. Deployments are driven by Workers Builds with the Git integration configured on the Cloudflare side, so the repository carries no deployment workflow, API token or account secret:masternpx wrangler deploy)https://<branch>-hyperformula-docs.handsoncode.workers.dev, posted as a pull request comment (npx wrangler versions upload)Production traffic keeps reaching the documentation through the
hyperformula-websiteWorker, which proxies/docs*. ItsDOCS_ORIGINhas to be repointed fromhttps://hyperformula-docs.netlify.apptohttps://hyperformula-docs.handsoncode.workers.devonce this lands onmasterand a production build succeeds. Until then, Netlify keeps serving production.Changes
wrangler.jsonc— serves the VuePress output as static assets. The asset directory isdocs/.vuepress/dist, notdocs/.vuepress/dist/docs, so every document keeps the/docs/prefix it is built with.worker/index.js— resolves directory URLs (/docs/,/docs/api/) and extensionless URLs, redirects/docsto/docs/, and serves the nearest404.html. Combined with"html_handling": "none",.htmlURLs are served as they are instead of being redirected to extensionless URLs.not_found_handlingis deliberately left at"none". Any other value makes the asset router answer browser navigations (requests carryingSec-Fetch-Mode: navigate) on its own, bypassing the Worker and turning every directory and extensionless URL into a 404 in browsers while plain requests still succeed.docs/.vuepress/cf/_headers,docs/.vuepress/cf/_redirects— indefinite caching for the content-hashed/docs/assets/*, and a redirect from the asset root to/docs/so preview URLs are usable at their root.script/prepare-cf-assets.jscopies them into the root of the build output, where they have to sit.package.json—docs:build:cf(the Cloudflare build command),docs:deploy:cf,docs:preview:cf, and thewranglerdev dependency..nvmrc— Node.js 22, the version all CI workflows already use and the one the Cloudflare build image reads from this file. Wrangler also requires Node.js 20 or newer.netlify.toml— removed.DEV_DOCS.md— documents the deployment, the dashboard build settings and the manual commands.Test plan
Verified against a production deployment built from this branch (
npm run docs:build:cf+wrangler deploy, 480 assets). URL behaviour matches the Netlify site exactly:/docs//docs/api//docs/guide/basic-usage.html/docs/guide/basic-usage/docs/docs//docs/, query preserved/docs/nopeEach row was checked both as a plain request and as a browser navigation (
Sec-Fetch-Mode: navigate,Sec-Fetch-Dest: document), against the deployed preview.npm run lintpasses.npm run docs:build:cfwritesdocs/.vuepress/dist/docs,_headersand_redirects./docs/assets/*is served withcache-control: public, max-age=31536000, immutable; documents keepmax-age=0, must-revalidate.sitemap.xmlstill listshttps://hyperformula.handsontable.com/docs/...URLs.developmerged in:npm run docs:build:cfsucceeds on the merged tree and/docs/guide/built-in-functions.html(generated by the docs pipeline added ondevelop) is served.Follow-up outside this repository
DOCS_ORIGINin thehyperformula-websiteproject once this reachesmasterand a production build succeeds.hyperformula-docs(production) andhyperformula-dev-docs(the deploy previews on this pull request). Deletingnetlify.tomldoes not stop them, because their Git integration lives on the Netlify side.🤖 Generated with Claude Code
Note
Medium Risk
This changes how production and preview documentation are built and served; URL routing depends on the new Worker and asset settings, and production still needs the separate
hyperformula-websiteDOCS_ORIGINcutover after deploy.Overview
Moves the VuePress documentation site from Netlify to Cloudflare Workers (
hyperformula-docs), with CI/deploy handled by Workers Builds rather than in-repo Netlify config.Hosting and routing: Adds
wrangler.jsonc(static assets fromdocs/.vuepress/dist),worker/index.jsto mirror prior URL behavior (directoryindex.html, extensionless paths →.html, trailing-slash redirect, nearest404.html), anddocs/.vuepress/cf/_headers/_redirects(long-lived cache for hashed/docs/assets/*, root →/docs/).script/prepare-cf-assets.jscopies those files into the dist root after build.Tooling: New npm scripts
docs:build:cf,docs:deploy:cf,docs:preview:cf; wrangler as a dev dependency;.nvmrcbumped to 22;.gitignorefor Wrangler local state.netlify.tomlis removed.Docs:
DEV_DOCS.mddocuments the Cloudflare deployment flow, dashboard settings, and manual commands.Reviewed by Cursor Bugbot for commit b8542ec. Bugbot is set up for automated code reviews on this repo. Configure here.