(acc: Acc, file: string)
| 147 | }) |
| 148 | |
| 149 | const mergeFile = (acc: Acc, file: string) => |
| 150 | Effect.gen(function* () { |
| 151 | const data = yield* loadFile(file) |
| 152 | if (Object.keys(data).length) { |
| 153 | appliedOrder += 1 |
| 154 | yield* Effect.logInfo("applying tui config", { path: file, order: appliedOrder }) |
| 155 | } |
| 156 | acc.result = mergeDeep(acc.result, data) |
| 157 | if (!data.plugin?.length) return |
| 158 | |
| 159 | const scope = pluginScope(file, ctx) |
| 160 | const plugins = ConfigPlugin.deduplicatePluginOrigins([ |
| 161 | ...acc.plugin_origins, |
| 162 | ...data.plugin.map((spec) => ({ spec: spec as ConfigPlugin.Origin["spec"], scope, source: file })), |
| 163 | ]) |
| 164 | acc.result = { |
| 165 | ...acc.result, |
| 166 | plugin: plugins.map((item) => item.spec), |
| 167 | } |
| 168 | acc.plugin_origins = plugins |
| 169 | }) |
| 170 | |
| 171 | // Every config dir we may read from: global config dir, any `.opencode` |
| 172 | // folders between cwd and home, and OPENCODE_CONFIG_DIR. |
no test coverage detected