Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
lint:
name: Lint
check:
name: Build, lint, and other checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Expand All @@ -21,6 +21,9 @@ jobs:
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn format-check
- run: yarn build
- run: yarn generate-json-schema-local
- run: git --no-pager diff --exit-code

test:
name: Test
Expand All @@ -34,18 +37,6 @@ jobs:
- run: yarn install --frozen-lockfile
- run: yarn test:src

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn build

integration-python:
name: Integration tests (Python)
runs-on: ubuntu-latest
Expand All @@ -67,7 +58,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"
cache: poetry
cache-dependency-path: tests/integration/python/poetry.lock

Expand Down
8 changes: 1 addition & 7 deletions docs/cli/generate-zod.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ import OutFileOption from '/snippets/cli-option-out-file.mdx';
import TargetOption from '/snippets/cli-option-target.mdx';
import TSTargetsList from '/snippets/ts-targets-list.mdx';

Generates [Zod](https://zod.dev) schemas for the specified Typesync schema and writes them to the specified file. The
generated schemas mirror the same mapping rules used internally by `typesync validate-data`, so the structure and
constraints stay in lockstep across runtime validation and code generation.

Documentation captured in your schema definition is preserved in the output: model-level docs are emitted as JSDoc
comments and as `.describe(...)` calls on the schema, and field-level docs are emitted as `.describe(...)` calls on the
field's value schema.
Generates [Zod](https://zod.dev) schemas for the specified Typesync schema and writes them to the specified file. The generator can produce code for either Zod v3 or v4, and can optionally emit inferred TypeScript types alongside the schemas.

## Usage

Expand Down
5 changes: 5 additions & 0 deletions schema.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
"type": "string",
"const": "timestamp",
"description": "A timestamp type."
},
{
"type": "string",
"const": "bytes",
"description": "A bytes type."
}
],
"description": "A primitive type"
Expand Down
Loading