Attempt at ergonomic effect/Schema compiler
bun add @amar4enko/effect-schema-compilerconst compiler = Compiler.make<Result, Context>()
.rule(hasReference, ({ referenceId, propertySignatures }, go, context) => {
//...
})
.rule(isUnionWithUndefined, ({ type }, go, context) => {
//...
})
const result = yield* compiler.compile(MySchema.ast, initialContext)Working with effect/Schema AST is non-trivial to say the least.
I've put this library together after spending some time on writing code compiling schemas to Confluence docs, other language types etc.
It doesn't automagically weave the need to understand AST, yet provides some nice-to-haves when working with it.