From d46cefaf2f82e6dc8f70cded98eecb7f15e8c007 Mon Sep 17 00:00:00 2001 From: sriramveeraghanta Date: Thu, 16 Jul 2026 19:01:05 +0530 Subject: [PATCH] chore(propel-docs): set up Cloudflare Workers static-assets deploy Configure apps/propel-docs for deployment on Cloudflare Workers (Static Assets), driven by Cloudflare's Git integration (no GitHub Actions): - wrangler.jsonc: enable workers.dev + per-version preview URLs, set not_found_handling to "404-page" (correct for a multi-page static site, unlike the SPA fallback Storybook uses), and drop the account_id TODO (the account comes from the connected Cloudflare account, not config). Left a TODO for the custom-domain route + astro `site` once a domain is assigned. - Add src/pages/404.astro so "404-page" handling has a real dist/404.html to serve, styled with the site's BaseLayout + design tokens. --- apps/propel-docs/src/pages/404.astro | 23 +++++++++++++++++++++++ apps/propel-docs/wrangler.jsonc | 22 +++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 apps/propel-docs/src/pages/404.astro diff --git a/apps/propel-docs/src/pages/404.astro b/apps/propel-docs/src/pages/404.astro new file mode 100644 index 00000000..f827c3be --- /dev/null +++ b/apps/propel-docs/src/pages/404.astro @@ -0,0 +1,23 @@ +--- +import BaseLayout from "~/layouts/BaseLayout.astro"; +--- + + +
+
+

404

+

Page not found

+

+ The page you're looking for doesn't exist or has moved. +

+
+ + Back to home + +
+
diff --git a/apps/propel-docs/wrangler.jsonc b/apps/propel-docs/wrangler.jsonc index 0dea5451..15307cc2 100644 --- a/apps/propel-docs/wrangler.jsonc +++ b/apps/propel-docs/wrangler.jsonc @@ -1,10 +1,30 @@ { "$schema": "./node_modules/wrangler/config-schema.json", + // The docs site is deployed as a static site on Cloudflare Workers (Static Assets). + // No Worker script is needed — `assets.directory` alone serves the built output. + // Deployment is driven by Cloudflare's Git integration (Workers Builds connected to the + // GitHub repo), which builds on push and reads this config; the account is the connected + // Cloudflare account, so no `account_id` belongs in this file. + // https://developers.cloudflare.com/workers/static-assets/ + // https://developers.cloudflare.com/workers/ci-cd/builds/ "name": "propel-docs", - // TODO: set account_id and a real routes/zone entry before deploying. "compatibility_date": "2026-07-15", + // Serve on the account's workers.dev subdomain and enable per-version preview URLs, so + // Workers Builds gives every non-production branch/PR build its own preview URL. + "workers_dev": true, + "preview_urls": true, + // TODO: once a production domain is assigned, add a custom-domain route here and set + // `site` in astro.config.mjs to match (so the sitemap emits absolute URLs). Mirror + // packages/propel/wrangler.jsonc's storybook route, e.g.: + // "routes": [{ "pattern": "propel.plane.so", "custom_domain": true }] + // Keep `workers_dev`/`preview_urls` enabled even then: the PR preview URLs live on the + // workers.dev subdomain, so disabling them would break previews. "assets": { "directory": "./dist", + // Multi-page static site: serve the generated 404.html (built from src/pages/404.astro) + // for unmatched paths. Do NOT use "single-page-application" here — that returns + // index.html with a 200 for every bad path, which is wrong for a multi-page site. + "not_found_handling": "404-page", }, "observability": { "enabled": true,