Skip to content

feat(deploy): add Cloudflare Workers no-login demo build - #2

Merged
ahpxex merged 1 commit into
mainfrom
cf-workers-demo
Jun 22, 2026
Merged

feat(deploy): add Cloudflare Workers no-login demo build#2
ahpxex merged 1 commit into
mainfrom
cf-workers-demo

Conversation

@ahpxex

@ahpxex ahpxex commented Jun 22, 2026

Copy link
Copy Markdown
Owner

A gated demo-deploy path builds the app for the Cloudflare Workers runtime as a public, no-login showcase, without touching the default Node build.

  • VITE_SKIP_AUTH bypasses the auth guard / requireUser / user menu, running as a fixed demo user (src/lib/demo-mode.ts); the better-auth/pg chain is then never loaded at runtime (dynamic imports + short-circuits), keeping the Workers bundle clean.
  • DEPLOY_TARGET=cloudflare swaps in @cloudflare/vite-plugin (the official TanStack Start path; provides AsyncLocalStorage for server fns during SSR) instead of the Nitro node-server preset, fixing the 'No Start context found in AsyncLocalStorage' 500.
  • Adds wrangler.jsonc, build:cf/preview:cf/deploy:cf scripts, a pg-native stub, and docs/deploy-cloudflare.md.
  • build-base strips all of this from the scaffold base (5 clean/ overrides + removals + dep/script pruning) so scaffolded products stay deploy-agnostic with no auth bypass.

Default 'bun run build' / 'start' (Node server, full login) unchanged.

A gated demo-deploy path builds the app for the Cloudflare Workers runtime as a public, no-login showcase, without touching the default Node build.

- VITE_SKIP_AUTH bypasses the auth guard / requireUser / user menu, running as a fixed demo user (src/lib/demo-mode.ts); the better-auth/pg chain is then never loaded at runtime (dynamic imports + short-circuits), keeping the Workers bundle clean.
- DEPLOY_TARGET=cloudflare swaps in @cloudflare/vite-plugin (the official TanStack Start path; provides AsyncLocalStorage for server fns during SSR) instead of the Nitro node-server preset, fixing the 'No Start context found in AsyncLocalStorage' 500.
- Adds wrangler.jsonc, build:cf/preview:cf/deploy:cf scripts, a pg-native stub, and docs/deploy-cloudflare.md.
- build-base strips all of this from the scaffold base (5 clean/ overrides + removals + dep/script pruning) so scaffolded products stay deploy-agnostic with no auth bypass.

Default 'bun run build' / 'start' (Node server, full login) unchanged.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
open-dashboard 82ca86e Jun 22 2026, 09:13 AM

@ahpxex
ahpxex merged commit 5dcbac0 into main Jun 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant