| 1 | /** @jsxImportSource @alchemy.run/sigil */ |
| 2 | import { Box } from "@alchemy.run/sigil"; |
| 3 | import { makeRuntime } from "../../../src/Cli/components/view/Runtime"; |
| 4 | import { runMain } from "alchemy/Util/PlatformServices"; |
| 5 | import * as Effect from "effect/Effect"; |
| 6 | |
| 7 | Effect.gen(function* () { |
| 8 | const { service } = makeRuntime( |
| 9 | { input: false, captureConsole: false }, |
| 10 | { |
| 11 | input: false, |
| 12 | columns: 80, |
| 13 | rows: 24, |
| 14 | colors: false, |
| 15 | unicode: false, |
| 16 | alternateScreen: false, |
| 17 | }, |
| 18 | ); |
| 19 | const progress = yield* service.live.progress({ |
| 20 | label: "Starting deployment", |
| 21 | }); |
| 22 | yield* progress.succeed("Deployment complete"); |
| 23 | yield* Effect.sync(() => { |
| 24 | const element = <Box />; |
| 25 | if (process.env.NODE_ENV !== "production" || "_store" in element) { |
| 26 | throw new Error("The CLI must use the production JSX runtime"); |
| 27 | } |
| 28 | console.log( |
| 29 | JSON.stringify({ cwd: process.cwd(), args: process.argv.slice(2) }), |
| 30 | ); |
| 31 | }); |
| 32 | }).pipe(Effect.scoped, runMain); |