wrangler.jsonc
This file
Path
apps/web/wrangler.jsonc
72 lines · 3.1 KiB
Last changed by
Merge infra/drop-demo into mainoscabrielbefore adoptionc49b6bf
History of this fileTake it
1{2 // The web Worker: TanStack Start's pages, and a same-origin /rpc that3 // forwards to the platform over the PLATFORM service binding. It holds no4 // storage binding of any kind (no Artifacts, D1, KV, R2, Durable Object or5 // Worker Loader), in any stage, so a bug in a public page cannot reach a6 // repo (AGENTS.md principle 7; packages/config/test/web-wiring.test.ts).7 // No secrets either: public values are vars. Deploy only through8 // infra/deploy.ts, to an explicit stage.9 //10 // The top level is stage `local`: `vite dev` and the type generation read11 // it, and it is never deployed. Each stage under `env` repeats the binding12 // and the vars, since wrangler does not inherit them into an environment.13 //14 // Workers Cache is on in each deployed stage, and off at the top, so `vite15 // dev` keeps nothing (ADR 0026). It keys by the Worker's version, so each16 // deploy starts cold and a kept page never names another version's hashed17 // assets: `cross_version_cache` stays off.18 "$schema": "node_modules/wrangler/config-schema.json",19 "name": "web",20 // TanStack Start's own server entry, wrapped so every answer passes21 // through what the edge may keep (src/server/edge-cache.ts; the Cloudflare22 // framework guide's custom entrypoint). The Cloudflare Vite plugin builds it.23 "main": "src/server.ts",24 "compatibility_date": "2026-10-05",25 "compatibility_flags": ["nodejs_compat"],26 "workers_dev": true,27 "preview_urls": false,28 // Every invocation's logs and trace, unsampled, and Issues. Every stage29 // inherits it, as it does the source maps below.30 "observability": {31 "enabled": true,32 "logs": {33 "enabled": true,34 "head_sampling_rate": 1,35 "invocation_logs": true,36 },37 "traces": { "enabled": true, "head_sampling_rate": 1 },38 "issues": { "enabled": true },39 },40 // The server build is minified (vite.config.ts); its source maps let a41 // stack trace in the logs, or an Issue, name the source.42 "upload_source_maps": true,43 "services": [{ "binding": "PLATFORM", "service": "platform" }],44 "vars": {45 // Where a browser reaches the platform itself: its sign-in pages and46 // git remotes. /rpc never needs it; that goes through PLATFORM.47 "PUBLIC_PLATFORM_URL": "http://localhost:8787",48 },49 "env": {50 "dev-oscabriel": {51 "cache": { "enabled": true },52 "services": [53 { "binding": "PLATFORM", "service": "platform-dev-oscabriel" },54 ],55 "vars": {56 "PUBLIC_PLATFORM_URL": "https://platform-dev-oscabriel.oscargabriel.workers.dev",57 },58 },59 // Served on the brand's own domain, never workers.dev: infra/deploy.ts60 // passes its Custom Domains and PUBLIC_PLATFORM_URL, which name the brand,61 // so they live in infra/stages.ts. The URL here is a stand-in the62 // deploy's --var replaces, so the generated Env still types it a string.63 "prod": {64 "workers_dev": false,65 "cache": { "enabled": true },66 "services": [{ "binding": "PLATFORM", "service": "platform-prod" }],67 "vars": {68 "PUBLIC_PLATFORM_URL": "https://from-infra-deploy.invalid",69 },70 },71 },72}