feat(viewer): deploy to Cloudflare Workers; add graphs companion site#246
Merged
Conversation
Deploying topology with
|
| Latest commit: |
b823278
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1cc369a6.topology.pages.dev |
| Branch Preview URL: | https://feat-cloudflare-workers.topology.pages.dev |
Migrate the viewer from Cloudflare Pages to Cloudflare Workers (Static Assets) and add a second build flavor for a graphs.pi-base.org companion, selected at build time via VITE_SITE. - Bump @sveltejs/adapter-cloudflare 3 -> 7 (one adapter handles both Pages and Workers; adapter-cloudflare-workers is deprecated); add wrangler 4 - Add packages/viewer/wrangler.jsonc with topology/graphs named envs - Add src/site.ts (VITE_SITE flavor) and render the nav brand from it - Update bin/build to read WORKERS_CI_* (CF_PAGES_*/git fallback) - Add cf:deploy:* / cf:preview:* scripts for Workers Builds - Document the Workers Builds CI setup in doc/deployment.md The existing Pages deploy is unaffected: Pages sets CF_PAGES=1, which the adapter checks first to keep emitting Pages output.
4420d85 to
20aa9e4
Compare
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
pi-base-graphs | b823278 | Commit Preview URL Branch Preview URL |
Jun 28 2026, 12:31 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
pi-base-topology | b823278 | Commit Preview URL Branch Preview URL |
Jun 28 2026, 12:31 AM |
…opology - bin/build: only `npm install -g pnpm` when pnpm is missing. Workers Builds already provides pnpm (via .tool-versions), so the unconditional global install errored with EEXIST and reinstalled deps redundantly. - wrangler.jsonc: enable observability for the topology env so the production site's Worker Logs persist (queryable in the dashboard / API).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates the viewer deployment from Cloudflare Pages → Cloudflare Workers
(Static Assets), and adds a second build flavor for a
graphs.pi-base.orgcompanion site. Both Workers are built from this one repo, selected at build
time by a
VITE_SITEflag.Already deployed and verified on
*.workers.dev:pi-base-topology→ https://pi-base-topology.fragrant-boat-7068.workers.devpi-base-graphs→ https://pi-base-graphs.fragrant-boat-7068.workers.dev (brand label "π-Base (graphs)")Changes
@sveltejs/adapter-cloudflare3 → 7 (one adapter now handles both Pagesand Workers;
adapter-cloudflare-workersis deprecated), addwrangler4.packages/viewer/wrangler.jsonc: Workers Static Assets config withtopology/graphsnamed environments (→pi-base-topology/pi-base-graphs).src/site.ts:VITE_SITEflavor;Nav.svelterenders the brand from it.bin/build: readWORKERS_CI_*(Workers Builds) withCF_PAGES_*/git fallback.cf:deploy:*/cf:preview:*npm scripts for Workers Builds.doc/deployment.md: document the Workers Builds CI setup.Safe alongside the existing Pages site
The legacy Pages deploy keeps working with this branch merged. Cloudflare sets
CF_PAGES=1during Pages builds, and@sveltejs/adapter-cloudflarechecks thatfirst (
is_building_for_cloudflare_pages), so a Pages build still emits Pagesoutput (
_routes.json, no.assetsignore) even withwrangler.jsoncpresent —verified locally by building both ways. v7 is the officially supported Pages
adapter, so the 3 → 7 bump is supported on the Pages path too.
Pre-merge check: pushing this branch generates a Pages preview deployment
— confirm that preview renders before merging to validate the v7 Pages output on
the real project.
Out of scope (follow-up)
Custom domains (
graphs.pi-base.org; cuttingtopology.pi-base.orgover fromPages), full branding parametrization, the real graphs data bundle, and
cypress/e2e preview-URL updates. Pages can be decommissioned after the cutover.
Test plan
pnpm --filter core buildthenVITE_SITE=topology|graphs pnpm --filter viewer buildpnpm --filter viewer exec wrangler dev→/200, assets served, brand differspnpm --filter viewer run test(61 pass)