| 1 | import * as Alchemy from "alchemy"; |
| 2 | import * as Cloudflare from "alchemy/Cloudflare"; |
| 3 | import * as Prisma from "alchemy/Prisma"; |
| 4 | import * as Effect from "effect/Effect"; |
| 5 | import Api from "./src/Api.ts"; |
| 6 | import { Connection, Postgres, Project } from "./src/Database.ts"; |
| 7 | |
| 8 | export default Alchemy.Stack( |
| 9 | "PrismaComputeEffect", |
| 10 | { |
| 11 | providers: Prisma.providers(), |
| 12 | state: Cloudflare.state(), |
| 13 | }, |
| 14 | Effect.gen(function* () { |
| 15 | const project = yield* Project; |
| 16 | const postgres = yield* Postgres; |
| 17 | const connection = yield* Connection; |
| 18 | const api = yield* Api; |
| 19 | |
| 20 | return { |
| 21 | projectId: project.projectId, |
| 22 | branchId: postgres.branchId, |
| 23 | databaseId: postgres.databaseId, |
| 24 | connectionId: connection.connectionId, |
| 25 | appId: api.appId, |
| 26 | deploymentId: api.deploymentId, |
| 27 | url: api.url, |
| 28 | }; |
| 29 | }), |
| 30 | ); |