feat: Add zod schemas for CI validation (#479)

* Add zod schemas for CI validation

* Stricter Zod validation
This commit is contained in:
Lachlan Collins
2023-11-12 22:57:01 +11:00
committed by GitHub
parent f87d57eebe
commit 71d1b2e4d6
4 changed files with 90 additions and 2 deletions

15
scripts/validateData.js Normal file
View File

@@ -0,0 +1,15 @@
// @ts-check
import { componentsSchema, templatesSchema, toolsSchema } from '../src/lib/schemas.js';
import components from '../src/routes/components/components.json' assert { type: 'json' };
import templates from '../src/routes/templates/templates.json' assert { type: 'json' };
import tools from '../src/routes/tools/tools.json' assert { type: 'json' };
componentsSchema.parse(components);
console.log('Validated components.json');
templatesSchema.parse(templates);
console.log('Validated templates.json');
toolsSchema.parse(tools);
console.log('Validated tools.json');