Skip to content

Commit 8d9b971

Browse files
authored
Drop unused small ID Zod statics (#26908)
1 parent c7e084c commit 8d9b971

6 files changed

Lines changed: 1 addition & 13 deletions

File tree

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Schema } from "effect"
22

33
import { Identifier } from "@/id/id"
4-
import { zod } from "@opencode-ai/core/effect-zod"
54
import { Newtype } from "@opencode-ai/core/schema"
65

76
export class PermissionID extends Newtype<PermissionID>()(
@@ -11,6 +10,4 @@ export class PermissionID extends Newtype<PermissionID>()(
1110
static ascending(id?: string): PermissionID {
1211
return this.make(Identifier.ascending("permission", id))
1312
}
14-
15-
static readonly zod = zod(this)
1613
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Schema } from "effect"
22

3-
import { zod } from "@opencode-ai/core/effect-zod"
43
import { withStatics } from "@opencode-ai/core/schema"
54

65
const projectIdSchema = Schema.String.pipe(Schema.brand("ProjectID"))
@@ -10,6 +9,5 @@ export type ProjectID = typeof projectIdSchema.Type
109
export const ProjectID = projectIdSchema.pipe(
1110
withStatics((schema: typeof projectIdSchema) => ({
1211
global: schema.make("global"),
13-
zod: zod(schema),
1412
})),
1513
)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Schema } from "effect"
22

33
import { Identifier } from "@/id/id"
4-
import { zod } from "@opencode-ai/core/effect-zod"
54
import { withStatics } from "@opencode-ai/core/schema"
65

76
const ptyIdSchema = Schema.String.check(Schema.isStartsWith("pty")).pipe(Schema.brand("PtyID"))
@@ -11,6 +10,5 @@ export type PtyID = typeof ptyIdSchema.Type
1110
export const PtyID = ptyIdSchema.pipe(
1211
withStatics((schema: typeof ptyIdSchema) => ({
1312
ascending: (id?: string) => schema.make(Identifier.ascending("pty", id)),
14-
zod: zod(schema),
1513
})),
1614
)
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import { Schema } from "effect"
22

33
import { Identifier } from "@/id/id"
4-
import { zod } from "@opencode-ai/core/effect-zod"
54
import { Newtype } from "@opencode-ai/core/schema"
65

76
export class QuestionID extends Newtype<QuestionID>()("QuestionID", Schema.String.check(Schema.isStartsWith("que"))) {
87
static ascending(id?: string): QuestionID {
98
return this.make(Identifier.ascending("question", id))
109
}
11-
12-
static readonly zod = zod(this)
1310
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { Schema } from "effect"
22

33
import { Identifier } from "@/id/id"
4-
import { zod } from "@opencode-ai/core/effect-zod"
54
import { withStatics } from "@opencode-ai/core/schema"
65

76
export const EventID = Schema.String.check(Schema.isStartsWith("evt")).pipe(
87
Schema.brand("EventID"),
98
withStatics((s) => ({
109
ascending: (id?: string) => s.make(Identifier.ascending("event", id)),
11-
zod: zod(s),
1210
})),
1311
)

packages/opencode/test/session/schema-decoding.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const sessionID = Schema.decodeUnknownSync(SessionID)("ses_01J5Y5H0AH4Q4NXJ6P4C3
2727
const sessionIDChild = Schema.decodeUnknownSync(SessionID)("ses_01J5Y5H0AH4Q4NXJ6P4C3P5V2L")
2828
const messageID = Schema.decodeUnknownSync(MessageID)("msg_01J5Y5H0AH4Q4NXJ6P4C3P5V2M")
2929
const partID = Schema.decodeUnknownSync(PartID)("prt_01J5Y5H0AH4Q4NXJ6P4C3P5V2N")
30-
const projectID = ProjectID.zod.parse("proj-alpha")
30+
const projectID = ProjectID.make("proj-alpha")
3131
const workspaceID = Schema.decodeUnknownSync(WorkspaceID)("wrk-primary")
3232

3333
function decodeUnknown<S extends Schema.Top>(schema: S) {

0 commit comments

Comments
 (0)