Skip to content

Repository files navigation

liveschema

Build a typed, branching schema from any Standard Schema validators (Zod, Valibot, ArkType, …). The inferred value type is a discriminated union over reachable branches; at runtime, get the ordered list of currently-reachable fields.

Works for conditional forms (single-page or multi-step), backend payload validation, and anywhere branching data lives.

Packages

This monorepo publishes three packages. See each package's README for usage:

Package npm Purpose
@liveschema/core @liveschema/core defineSchema() builder + walker (reachableFields, declaredFields, validateSchema, toStandardSchema).
@liveschema/react @liveschema/react useLiveSchema(schema, values) hook returning fields, reachableFields, isReachableField.
@liveschema/vue @liveschema/vue Same shape as the React hook, but as a Vue composable returning computed refs.

Runnable examples live under examples/.

Releasing

Releases are driven by Changesets and an automated GitHub Actions workflow using NPM Trusted Publishing (.github/workflows/release.yml):

  1. After landing a PR with a changeset, the workflow opens (or updates) a "Version Packages" PR that bumps versions and updates changelogs.
  2. Merging that PR publishes the affected @liveschema/* packages to npm and tags the commit.

About

Typed schema builder for conditional forms and data

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages