| 1 | import { Text } from "@alchemy.run/cloudflare-runtime/core/bindings"; |
| 2 | import * as Options from "@alchemy.run/cloudflare-test-tools/e2e/Options"; |
| 3 | import wakuFramework from "@alchemy.run/frontend-frameworks/waku"; |
| 4 | |
| 5 | // Target-scoped config carriage: `target.cloudflare.worker` is the cloudflare |
| 6 | // deploy target's configuration (read by @alchemy.run/frontend-frameworks/waku via |
| 7 | // `options.target?.cloudflare?.worker ?? options.vite`) and |
| 8 | // `target.cloudflare.preview` configures the miniflare preview server. |
| 9 | export default Options.make({ |
| 10 | target: { |
| 11 | cloudflare: { |
| 12 | worker: { |
| 13 | // `main` and `viteEnvironments` are pinned by @alchemy.run/frontend-frameworks/waku's |
| 14 | // cloudflare target (waku's rsc entry + the rsc/ssr topology) — only |
| 15 | // worker config here. |
| 16 | compatibilityDate: "2026-03-10", |
| 17 | compatibilityFlags: ["nodejs_als"], |
| 18 | worker: { |
| 19 | name: "fixtures-waku", |
| 20 | bindings: [Text.local("MESSAGE", "hello-from-binding")], |
| 21 | assets: { |
| 22 | htmlHandling: "drop-trailing-slash", |
| 23 | notFoundHandling: "none", |
| 24 | }, |
| 25 | }, |
| 26 | }, |
| 27 | preview: { |
| 28 | compatibilityDate: "2026-03-10", |
| 29 | compatibilityFlags: ["nodejs_als"], |
| 30 | bindings: { MESSAGE: "hello-from-binding" }, |
| 31 | assets: { |
| 32 | routerConfig: { |
| 33 | has_user_worker: true, |
| 34 | invoke_user_worker_ahead_of_assets: false, |
| 35 | debug: true, |
| 36 | }, |
| 37 | assetConfig: { |
| 38 | html_handling: "drop-trailing-slash", |
| 39 | not_found_handling: "none", |
| 40 | debug: true, |
| 41 | has_static_routing: false, |
| 42 | }, |
| 43 | }, |
| 44 | }, |
| 45 | }, |
| 46 | }, |
| 47 | // The typed factory form so the fixture can pin its assigned dev port; the |
| 48 | // string form (`framework: "@alchemy.run/frontend-frameworks/waku"`) is equivalent minus |
| 49 | // the extra option. |
| 50 | framework: (options) => wakuFramework({ ...options, port: 3101 }), |
| 51 | }); |