1import {
2 KvNamespace,
3 Text,
4} from "@alchemy.run/cloudflare-runtime/core/bindings";
5import * as Options from "@alchemy.run/cloudflare-test-tools/e2e/Options";
6import { make } from "@alchemy.run/frontend-frameworks/nextjs";
7import { kCurrentWorker } from "miniflare";
8
9export default Options.make({
10 // Exercise explicit OpenNext configuration for direct framework consumers.
11 framework: (options) =>
12 make({ ...options, nextjs: { configPath: "open-next.config.ts" } }),
13 vite: {
14 compatibilityDate: "2026-05-12",
15 compatibilityFlags: ["nodejs_compat", "global_fetch_strictly_public"],
16 worker: {
17 name: "fixtures-nextjs",
18 bindings: [
19 Text.local("TEST_TEXT", "hello-from-binding"),
20 KvNamespace.local({ binding: "FIXTURE_KV" }),
21 ],
22 },
23 },
24 miniflare: {
25 name: "fixtures-nextjs",
26 compatibilityDate: "2026-05-12",
27 compatibilityFlags: ["nodejs_compat", "global_fetch_strictly_public"],
28 bindings: { TEST_TEXT: "hello-from-binding" },
29 kvNamespaces: ["FIXTURE_KV"],
30 serviceBindings: { WORKER_SELF_REFERENCE: kCurrentWorker },
31 durableObjects: {
32 NEXT_CACHE_DO_QUEUE: { className: "DOQueueHandler", useSQLite: true },
33 },
34 assets: {
35 binding: "ASSETS",
36 routerConfig: {
37 has_user_worker: true,
38 invoke_user_worker_ahead_of_assets: true,
39 },
40 assetConfig: {
41 html_handling: "none",
42 not_found_handling: "none",
43 },
44 },
45 },
46});