diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4239fc..cd458a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/docs/cli/generate-zod.mdx b/docs/cli/generate-zod.mdx index 0db7b01..d390004 100644 --- a/docs/cli/generate-zod.mdx +++ b/docs/cli/generate-zod.mdx @@ -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 diff --git a/schema.local.json b/schema.local.json index cc6ed59..cdeb898 100644 --- a/schema.local.json +++ b/schema.local.json @@ -72,6 +72,11 @@ "type": "string", "const": "timestamp", "description": "A timestamp type." + }, + { + "type": "string", + "const": "bytes", + "description": "A bytes type." } ], "description": "A primitive type"