import { InstanceBootstrap } from "../project/bootstrap" import { Instance } from "../project/instance" export async function bootstrap(directory: string, cb: () => Promise) { return Instance.provide({ directory, init: InstanceBootstrap, fn: async () => { try { const result = await cb() return result } finally { await Instance.dispose() } }, }) }