Ecosystem
Use litetype with tRPC, Hono, and forms
There is no litetype adapter matrix. Keep your schema bare, then call standard(schema) at an integration boundary.
tRPC
import { initTRPC } from '@trpc/server'
import { standard, string } from 'litetype'
const t = initTRPC.create()
const User = standard({ name: string.min(1) })
export const router = t.router({
user: t.procedure.input(User).query(({ input }) => input),
})
Hono
import { sValidator } from '@hono/standard-validator'
import { Hono } from 'hono'
import { standard, string } from 'litetype'
const app = new Hono()
const User = standard({ name: string.min(1) })
app.post('/users', sValidator('json', User), c =>
c.json(c.req.valid('json')))
React Hook Form
import { standardSchemaResolver } from '@hookform/resolvers/standard-schema'
import { useForm } from 'react-hook-form'
import { standard, string } from 'litetype'
const User = { name: string.min(1), 'email?': string.email() }
useForm({ resolver: standardSchemaResolver(standard(User)) })
Any Standard Schema consumer
The wrapper exposes the Standard Schema V1 contract, including inferred input/output types and structured issues. If a tool accepts Standard Schema, it accepts litetype.