The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import { Assets, Text } from "@alchemy.run/cloudflare-runtime/core/bindings"; |
| 2 | import * as Options from "@alchemy.run/cloudflare-test-tools/e2e/Options"; |
| 3 | import * as Astro from "@alchemy.run/frontend-frameworks/astro"; |
| 4 | import cloudflare from "@alchemy.run/frontend-frameworks/astro/cloudflare"; |
| 5 | |
| 6 | export const FIXTURE_VALUE = "hello-from-astro-ssr-binding"; |
| 7 | |
| 8 | export default Options.make({ |
| 9 | // Target-scoped config carriage: `target.cloudflare` carries the worker |
| 10 | // config (dev/build) and the miniflare preview config. |
| 11 | target: { |
| 12 | cloudflare: { |
| 13 | worker: { |
| 14 | compatibilityDate: "2026-03-10", |
| 15 | compatibilityFlags: ["nodejs_compat"], |
| 16 | worker: { |
| 17 | name: "fixtures-astro-ssr", |
| 18 | bindings: [Assets.local("ASSETS"), Text.local("FIXTURE_VALUE", FIXTURE_VALUE)], |
| 19 | assets: { |
| 20 | htmlHandling: "auto-trailing-slash", |
| 21 | notFoundHandling: "none", |
| 22 | }, |
| 23 | }, |
| 24 | }, |
| 25 | preview: { |
| 26 | compatibilityDate: "2026-03-10", |
| 27 | compatibilityFlags: ["nodejs_compat"], |
| 28 | bindings: { FIXTURE_VALUE }, |
| 29 | // Zero-config sessions: the built app reads the SESSION KV binding. |
| 30 | kvNamespaces: ["SESSION"], |
| 31 | assets: { |
| 32 | binding: "ASSETS", |
| 33 | routerConfig: { |
| 34 | has_user_worker: true, |
| 35 | invoke_user_worker_ahead_of_assets: false, |
| 36 | }, |
| 37 | assetConfig: { |
| 38 | html_handling: "auto-trailing-slash", |
| 39 | not_found_handling: "none", |
| 40 | }, |
| 41 | }, |
| 42 | }, |
| 43 | }, |
| 44 | }, |
| 45 | // Deliberately NO `astro:` overrides here — unlike packages/frontend-frameworks/fixtures/astro, this |
| 46 | // fixture's Astro configuration lives in its real `astro.config.mjs`, |
| 47 | // which the integration must load and honor (the user-config principle). |
| 48 | framework: (options) => |
| 49 | Astro.layer({ |
| 50 | target: cloudflare({ |
| 51 | worker: Options.resolveCloudflareOptions(options).worker, |
| 52 | }), |
| 53 | }), |
| 54 | }); |