| 1 | import * as Options from "@alchemy.run/cloudflare-test-tools/e2e/Options"; |
| 2 | |
| 3 | /** |
| 4 | * The Vite project root is `app/`, NOT the fixture root. That is the point of |
| 5 | * this fixture: `app/src/server.ts` imports `../../lib/src/greeting.ts`, a |
| 6 | * module that lives OUTSIDE the project root in a sibling directory with its |
| 7 | * own `package.json` — the shape of a monorepo workspace member importing a |
| 8 | * sibling package by path. The build-output collector must classify `lib/` as |
| 9 | * an external workspace (`dist/build.json` → `externalWorkspaces`). |
| 10 | * |
| 11 | * `root` is the harness's first-class project-root option: the CLI/Server |
| 12 | * thread it into `Framework.build`/`Framework.dev`, while the harness's own |
| 13 | * persistence (`dist/build.json`) stays anchored at the fixture root. This |
| 14 | * fixture deliberately uses the built-in Vite framework path (no framework |
| 15 | * package) to isolate the workspace machinery from framework churn. |
| 16 | */ |
| 17 | export default Options.make({ |
| 18 | root: "./app", |
| 19 | target: { |
| 20 | cloudflare: { |
| 21 | worker: { |
| 22 | // Worker entry, relative to the Vite root (app/). |
| 23 | main: "./src/server.ts", |
| 24 | compatibilityDate: "2026-03-10", |
| 25 | compatibilityFlags: ["nodejs_compat"], |
| 26 | worker: { |
| 27 | name: "fixtures-monorepo-workspace", |
| 28 | bindings: [], |
| 29 | }, |
| 30 | }, |
| 31 | preview: { |
| 32 | compatibilityDate: "2026-03-10", |
| 33 | compatibilityFlags: ["nodejs_compat"], |
| 34 | }, |
| 35 | }, |
| 36 | }, |
| 37 | }); |