mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-21 13:21:17 +08:00
Config is now loaded eagerly during project bootstrap so users can see config loading in traces during startup. This helps diagnose configuration issues earlier in the initialization flow. NPM installation logic has been refactored with a unified reify function and improved InstallFailedError that includes both the packages being installed and the target directory. This provides users with complete context when package installations fail, making it easier to identify which dependency or project directory caused the issue.
30 lines
877 B
TypeScript
30 lines
877 B
TypeScript
import { Layer, ManagedRuntime } from "effect"
|
|
import { memoMap } from "./run-service"
|
|
|
|
import { Plugin } from "@/plugin"
|
|
import { LSP } from "@/lsp"
|
|
import { FileWatcher } from "@/file/watcher"
|
|
import { Format } from "@/format"
|
|
import { ShareNext } from "@/share"
|
|
import { File } from "@/file"
|
|
import { Vcs } from "@/project"
|
|
import { Snapshot } from "@/snapshot"
|
|
import { Bus } from "@/bus"
|
|
import { Config } from "@/config"
|
|
import * as Observability from "./observability"
|
|
|
|
export const BootstrapLayer = Layer.mergeAll(
|
|
Config.defaultLayer,
|
|
Plugin.defaultLayer,
|
|
ShareNext.defaultLayer,
|
|
Format.defaultLayer,
|
|
LSP.defaultLayer,
|
|
File.defaultLayer,
|
|
FileWatcher.defaultLayer,
|
|
Vcs.defaultLayer,
|
|
Snapshot.defaultLayer,
|
|
Bus.defaultLayer,
|
|
).pipe(Layer.provide(Observability.layer))
|
|
|
|
export const BootstrapRuntime = ManagedRuntime.make(BootstrapLayer, { memoMap })
|