refactor(schema): normalize module patterns (#33770)

This commit is contained in:
Kit Langton
2026-06-25 15:42:22 +00:00
committed by GitHub
parent 5565a8ee10
commit 7854f5b9f7
50 changed files with 204 additions and 202 deletions
+2 -5
View File
@@ -3,13 +3,12 @@ export * as Pty from "./pty"
import { Schema } from "effect"
import { define, inventory } from "./event"
import { ascending } from "./identifier"
import { NonNegativeInt, PositiveInt } from "./schema"
import { withStatics } from "./schema"
import { NonNegativeInt, PositiveInt, statics } from "./schema"
const IDSchema = Schema.String.check(Schema.isStartsWith("pty")).pipe(Schema.brand("PtyID"))
export const ID = IDSchema.pipe(
withStatics((schema: typeof IDSchema) => ({
statics((schema: typeof IDSchema) => ({
ascending: (id?: string) => schema.make(id ?? "pty_" + ascending()),
})),
)
@@ -25,14 +24,12 @@ export const Info = Schema.Struct({
pid: NonNegativeInt,
exitCode: Schema.optional(NonNegativeInt),
}).annotate({ identifier: "Pty" })
export const PtyInfo = Info
const Created = define({ type: "pty.created", schema: { info: Info } })
const Updated = define({ type: "pty.updated", schema: { info: Info } })
const Exited = define({ type: "pty.exited", schema: { id: ID, exitCode: NonNegativeInt } })
const Deleted = define({ type: "pty.deleted", schema: { id: ID } })
export const Event = { Created, Updated, Exited, Deleted, Definitions: inventory(Created, Updated, Exited, Deleted) }
export const PtyEvent = Event
export const CreateInput = Schema.Struct({
command: Schema.optional(Schema.String),