2025-06-27 23:29:20 +08:00
|
|
|
import { App } from "../app/app"
|
|
|
|
|
import { ConfigHooks } from "../config/hooks"
|
|
|
|
|
import { Format } from "../format"
|
2025-07-01 04:45:13 +08:00
|
|
|
import { LSP } from "../lsp"
|
2025-08-03 06:50:19 +08:00
|
|
|
import { Plugin } from "../plugin"
|
2025-06-27 23:29:20 +08:00
|
|
|
import { Share } from "../share/share"
|
2025-07-24 08:30:46 +08:00
|
|
|
import { Snapshot } from "../snapshot"
|
2025-06-27 23:29:20 +08:00
|
|
|
|
2025-07-08 03:53:43 +08:00
|
|
|
export async function bootstrap<T>(input: App.Input, cb: (app: App.Info) => Promise<T>) {
|
2025-06-27 23:29:20 +08:00
|
|
|
return App.provide(input, async (app) => {
|
2025-08-21 23:22:13 +08:00
|
|
|
await Plugin.init()
|
2025-06-27 23:29:20 +08:00
|
|
|
Share.init()
|
|
|
|
|
Format.init()
|
|
|
|
|
ConfigHooks.init()
|
2025-07-01 04:45:13 +08:00
|
|
|
LSP.init()
|
2025-07-24 08:30:46 +08:00
|
|
|
Snapshot.init()
|
2025-06-27 23:29:20 +08:00
|
|
|
|
|
|
|
|
return cb(app)
|
|
|
|
|
})
|
|
|
|
|
}
|