mirror of
https://github.com/LukeHagar/sveltesociety.dev.git
synced 2025-12-07 20:57:45 +00:00
feat: Add zod schemas for CI validation (#479)
* Add zod schemas for CI validation * Stricter Zod validation
This commit is contained in:
15
scripts/validateData.js
Normal file
15
scripts/validateData.js
Normal 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');
|
||||
Reference in New Issue
Block a user