mirror of
https://github.com/LukeHagar/sveltesociety.dev.git
synced 2025-12-06 20:57:45 +00:00
feat: Stricter JSON validation (#534)
* Max length on title and description * Fix repo link * Update @casual-ui/svelte reference * Update @perfectthings/ui reference * Merge form-related tags * More tags tweaks * Remove "component sets" tag * Maximum of 5 tags
This commit is contained in:
@@ -3,11 +3,11 @@ import { packageNameRegex } from 'package-name-regex';
|
||||
|
||||
export const packagesSchema = z.array(
|
||||
z.object({
|
||||
title: z.string(),
|
||||
title: z.string().max(50),
|
||||
npm: z.string().regex(packageNameRegex),
|
||||
url: z.string().url().optional(),
|
||||
repository: z.string().url(),
|
||||
description: z.string(),
|
||||
description: z.string().max(250),
|
||||
category: z.enum([
|
||||
'Bundler Plugins',
|
||||
'CSS and Layout',
|
||||
@@ -30,17 +30,17 @@ export const packagesSchema = z.array(
|
||||
'Testing',
|
||||
'User Interaction'
|
||||
]),
|
||||
tags: z.array(z.string()).optional()
|
||||
tags: z.array(z.string()).max(5).optional()
|
||||
})
|
||||
);
|
||||
|
||||
export const templatesSchema = z.array(
|
||||
z.object({
|
||||
title: z.string(),
|
||||
title: z.string().max(50),
|
||||
url: z.string().url().optional(),
|
||||
repository: z.string().url(),
|
||||
description: z.string(),
|
||||
description: z.string().max(250),
|
||||
category: z.enum(['Svelte Add', 'SvelteKit', 'Svelte']),
|
||||
tags: z.array(z.string()).optional()
|
||||
tags: z.array(z.string()).max(5).optional()
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user