| 1 | import * as Cloudflare from "@/Cloudflare"; |
| 2 | import * as Alchemy from "@/index.ts"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import { EnvBucket, RemoteContainer } from "./object.ts"; |
| 5 | import RemoteContainerWorker from "./worker.ts"; |
| 6 | |
| 7 | export default (state = Cloudflare.state()) => |
| 8 | Alchemy.Stack( |
| 9 | "RemoteContainerStack", |
| 10 | { providers: Cloudflare.providers(), state }, |
| 11 | Effect.gen(function* () { |
| 12 | const bucket = yield* EnvBucket; |
| 13 | const worker = yield* RemoteContainerWorker; |
| 14 | const app = yield* RemoteContainer.Application; |
| 15 | return { |
| 16 | url: worker.url.as<string>(), |
| 17 | bucketName: bucket.bucketName, |
| 18 | app, |
| 19 | }; |
| 20 | }), |
| 21 | ); |