| 1 | import * as Cloudflare from "@/Cloudflare"; |
| 2 | import * as Alchemy from "@/index.ts"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import LocalRemoteContainerWorker from "./local-worker.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Same worker/DO/container arrangement as `stack.ts`, but under a distinct |
| 8 | * stack name AND a distinct fixture identity (`local-worker.ts` / |
| 9 | * `local-object.ts` — LocalRemoteContainer* logical ids) so the local-dev |
| 10 | * test (`LocalContainer.test.ts`) never shares state, a container |
| 11 | * application, or a workers.dev worker with the live `Container.test.ts` |
| 12 | * deployment when the two files run concurrently. |
| 13 | */ |
| 14 | export const state = Alchemy.inMemoryState(); |
| 15 | |
| 16 | export default Alchemy.Stack( |
| 17 | "LocalRemoteContainerStack", |
| 18 | { providers: Cloudflare.providers(), state }, |
| 19 | Effect.gen(function* () { |
| 20 | const worker = yield* LocalRemoteContainerWorker; |
| 21 | return { url: worker.url.as<string>() }; |
| 22 | }), |
| 23 | ); |