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 tasksRegenerate 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:schemaRun the command whenever upstream Schema.org data changes or after touching generator code.
Check if upstream data changed with:
bash
pnpm run schema:checkIn case the data changed, delete src/schema/schema.json and then run the generate:schema script afterwards.
Test before committing
bash
pnpm test -- --runThe Vitest suites mirror the published API surface (validators, presets, creators) and guard against regressions.
Recommended loop
- Modify schema data or generator code under
src/schema/orsrc/generator/. - Execute
pnpm run generate:schemato refresh all outputs. - Run
pnpm test -- --run.
Never hand-edit files inside dist/; regenerate them through the command above.