iterate.com / cloud

git clone https://git.iterate.com/repos/cloud

cloud / scripts / zone-enrollment / fixture.run.tsmain at aacbc74

// fixture.run.ts — AN ALCHEMY STACK OF ONE ZONE'S RESOURCES, for the offline proof alone
// (zone-enrollment.test.ts). Alchemy's own CLI runs it, as it runs core/alchemy/alchemy.run.ts:
// `alchemy plan fixture.run.ts --stage <stage>`. Its state is a folder of the working directory,
// and its Cloudflare is whatever CLOUDFLARE_API_BASE_URL names: the test's fake. It reaches no
// account: the one input, ZONE_ENROLLMENT_FIXTURE, names made-up ids of the fake.
import * as Cloudflare from "@alchemy.run/cloudflare";
import * as Alchemy from "alchemy";
import * as Effect from "effect/Effect";
import { type ZoneInput, zoneResources } from "./zone-resources.ts";

const zones: ZoneInput[] = JSON.parse(process.env.ZONE_ENROLLMENT_FIXTURE || "[]");

export default Alchemy.Stack(
  "mind",
  { providers: Cloudflare.providers(), state: Alchemy.localState() },
  Effect.gen(function* () {
    for (const zone of zones) yield* zoneResources(zone);
  }),
);