opencode_offline/packages/opencode/src/cli/bootstrap.ts

22 lines
492 B
TypeScript
Raw Normal View History

2025-06-27 23:29:20 +08:00
import { App } from "../app/app"
import { ConfigHooks } from "../config/hooks"
2025-07-02 01:44:52 +08:00
import { FileWatcher } from "../file/watch"
2025-06-27 23:29:20 +08:00
import { Format } from "../format"
2025-07-01 04:45:13 +08:00
import { LSP } from "../lsp"
2025-06-27 23:29:20 +08:00
import { Share } from "../share/share"
export async function bootstrap<T>(
input: App.Input,
cb: (app: App.Info) => Promise<T>,
) {
return App.provide(input, async (app) => {
Share.init()
Format.init()
ConfigHooks.init()
2025-07-01 04:45:13 +08:00
LSP.init()
2025-07-02 01:44:52 +08:00
FileWatcher.init()
2025-06-27 23:29:20 +08:00
return cb(app)
})
}