t3-code-android-nightly/.repos/alchemy-effect/packages/frontend-frameworks/fixtures/tanstack-start/e2e.config.ts
Julius Marminge e3c85ead63
chore(refs): sync Effect and Alchemy references to rc.115 and beta.78 (#12327)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-17 23:21:25 -07:00

50 lines
1.8 KiB
TypeScript

import { Text } from "@alchemy.run/cloudflare-runtime/core/bindings";
import * as Options from "@alchemy.run/cloudflare-test-tools/e2e/Options";
import * as Config from "effect/Config";
import * as Effect from "effect/Effect";
export default Config.String("TEST_POSTGRES_URL").pipe(
Config.orElse(() => Config.succeed("")),
Effect.map((url) =>
Options.make({
vite: {
compatibilityDate: "2026-03-10",
compatibilityFlags: ["nodejs_compat"],
worker: {
name: "fixtures-tanstack-start",
bindings: [Text.local("TEST_POSTGRES_URL", url)],
assets: {
// Assets are matched ahead of the worker (`runWorkerFirst`
// deliberately unset): the TanStack worker has no ASSETS-binding
// fallback, so `runWorkerFirst: true` would 404 every static
// asset (verified against miniflare with
// `invoke_user_worker_ahead_of_assets: true`). This now matches
// the preview router config below — the two used to disagree.
htmlHandling: "auto-trailing-slash",
notFoundHandling: "none",
},
},
},
miniflare: {
compatibilityDate: "2026-03-10",
compatibilityFlags: ["nodejs_compat"],
bindings: { TEST_POSTGRES_URL: url },
assets: {
routerConfig: {
has_user_worker: true,
// Parity with the worker config above: assets first, worker for
// everything unmatched.
invoke_user_worker_ahead_of_assets: false,
debug: true,
},
assetConfig: {
html_handling: "auto-trailing-slash",
not_found_handling: "none",
debug: true,
has_static_routing: false,
},
},
},
}),
),
);