Skip to content

Development Workflow

Follow these steps when working inside the repository to regenerate schema assets or contribute generator changes.

Install dependencies

bash
pnpm install
pnpm run dev:check           # verifies Node.js 23.6+ for development tasks

Regenerate schema data and dist/

The npm generate:schema script downloads (or reuses) the Schema.org JSON-LD snapshot, splits it into src/schema/data/, and rebuilds the generated classes, creators, validators, and presets under dist/.

bash
pnpm run generate:schema

Run the command whenever upstream Schema.org data changes or after touching generator code.

Check if upstream data changed with:

bash
pnpm run schema:check

In case the data changed, delete src/schema/schema.json and then run the generate:schema script afterwards.

Test before committing

bash
pnpm test -- --run

The Vitest suites mirror the published API surface (validators, presets, creators) and guard against regressions.

  1. Modify schema data or generator code under src/schema/ or src/generator/.
  2. Execute pnpm run generate:schema to refresh all outputs.
  3. Run pnpm test -- --run.

Never hand-edit files inside dist/; regenerate them through the command above.

Built with VitePress – Released under the MIT License.