1// Deep imports keep the Compute bundle lean: the `@/Prisma` barrel pulls in
2// the local dev-database machinery (@prisma/dev -> pglite), which balloons
3// the bundle and has no business inside a deployed app.
4import { Bucket } from "@/Prisma/Bucket.ts";
5import { Project } from "@/Prisma/Project.ts";
6import * as Effect from "effect/Effect";
7
8/**
9 * Project owning the shared bucket. No default database is created — the
10 * binding suite only needs Object Store.
11 */
12export const TestProject = Project("PrismaBucketBindingProject", {
13 name: "alchemy-bucket-binding",
14 createDatabase: false,
15});
16
17/**
18 * Shared Prisma Object Store bucket bound by all three binding-test Compute
19 * apps (read / write / read-write). Because every app binds this same bucket,
20 * a value written through the Write app is observable by the Read app — which
21 * is what the test asserts.
22 */
23export const TestBucket = Effect.gen(function* () {
24 const project = yield* TestProject;
25 return yield* Bucket("PrismaBucketBindingTestBucket", { project });
26});