core: make InstanceBootstrap into an effect (#22274)

Co-authored-by: Kit Langton <kit.langton@gmail.com>
This commit is contained in:
Brendan Allan
2026-04-13 22:16:40 +08:00
committed by GitHub
parent 3eb6508a64
commit 94f71f59a3
10 changed files with 52 additions and 28 deletions

View File

@@ -1,10 +1,11 @@
import { AppRuntime } from "@/effect/app-runtime"
import { InstanceBootstrap } from "../project/bootstrap"
import { Instance } from "../project/instance"
export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
return Instance.provide({
directory,
init: InstanceBootstrap,
init: () => AppRuntime.runPromise(InstanceBootstrap),
fn: async () => {
try {
const result = await cb()