mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-25 06:22:05 +00:00
chore: generate
This commit is contained in:
parent
d9b81d2233
commit
aca42423d3
12 changed files with 3311 additions and 31029 deletions
|
|
@ -461,7 +461,9 @@ function effectType(schema: Schema.Top, references: ReturnType<typeof effectType
|
|||
imports.add(direct.import)
|
||||
return direct.name
|
||||
}
|
||||
const document = SchemaRepresentation.toCodeDocument(SchemaRepresentation.toRepresentations([codegenAst(projected.ast)]))
|
||||
const document = SchemaRepresentation.toCodeDocument(
|
||||
SchemaRepresentation.toRepresentations([codegenAst(projected.ast)]),
|
||||
)
|
||||
const source = new Map(document.references.nonRecursives.map((reference) => [reference.$ref, reference.code.Type]))
|
||||
const expand = (type: string, seen = new Set<string>()): string => {
|
||||
for (const [name, value] of source) {
|
||||
|
|
@ -1844,10 +1846,9 @@ function renderSchemas(slots: ReadonlyArray<Slot>) {
|
|||
]
|
||||
const [first, ...rest] = expanded
|
||||
const document = SchemaRepresentation.toCodeDocument(
|
||||
SchemaRepresentation.toRepresentations(codegenAsts(expanded.map((slot) => slot.schema.ast)) as [
|
||||
SchemaAST.AST,
|
||||
...Array<SchemaAST.AST>,
|
||||
]),
|
||||
SchemaRepresentation.toRepresentations(
|
||||
codegenAsts(expanded.map((slot) => slot.schema.ast)) as [SchemaAST.AST, ...Array<SchemaAST.AST>],
|
||||
),
|
||||
)
|
||||
const artifacts = document.artifacts.flatMap((artifact) => {
|
||||
if (artifact._tag === "Import") return [artifact.importDeclaration]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue