fix(opencode): decode legacy reference config
This commit is contained in:
parent
00b3212b82
commit
c5175b6cc1
2 changed files with 3 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ import { ProjectReference } from "@opencode-ai/core/project-reference"
|
|||
import { ConfigReference } from "@opencode-ai/core/config/reference"
|
||||
import { RepositoryCache } from "@opencode-ai/core/repository-cache"
|
||||
import { AbsolutePath } from "@opencode-ai/core/schema"
|
||||
import { Context, Effect, Layer, Scope } from "effect"
|
||||
import { Context, Effect, Layer, Schema, Scope } from "effect"
|
||||
|
||||
export type Resolved = ProjectReference.Resolved
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ export const layer = Layer.effect(
|
|||
Effect.succeed([
|
||||
new ConfigV2.Loaded({
|
||||
source: { type: "memory" },
|
||||
info: new ConfigV2.Info({ references: cfg.reference }),
|
||||
info: Schema.decodeUnknownSync(ConfigV2.Info)({ references: cfg.reference }),
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ describe("reference", () => {
|
|||
references.live("reads references from legacy config content", () =>
|
||||
withReferences(
|
||||
withConfigContent(
|
||||
JSON.stringify({ reference: { docs: "./docs" } }),
|
||||
JSON.stringify({ reference: { docs: { path: "./docs" } } }),
|
||||
provideTmpdirInstance((dir) =>
|
||||
Effect.gen(function* () {
|
||||
expect(yield* (yield* Reference.Service).get("docs")).toMatchObject({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue