mirror of
https://github.com/LukeHagar/sveltesociety.dev.git
synced 2025-12-06 12:47:44 +00:00
* 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
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
import { z } from 'zod';
|
|
import { packageNameRegex } from 'package-name-regex';
|
|
|
|
export const packagesSchema = z.array(
|
|
z.object({
|
|
title: z.string().max(50),
|
|
npm: z.string().regex(packageNameRegex),
|
|
url: z.string().url().optional(),
|
|
repository: z.string().url(),
|
|
description: z.string().max(250),
|
|
category: z.enum([
|
|
'Bundler Plugins',
|
|
'CSS and Layout',
|
|
'Data Visualisation',
|
|
'Debugging',
|
|
'Design Pattern',
|
|
'Design System',
|
|
'Developer Experience',
|
|
'Display Components',
|
|
'Forms & User Input',
|
|
'Icons',
|
|
'Integration',
|
|
'Internationalization',
|
|
'Linting and Formatting',
|
|
'Multimedia',
|
|
'Preprocessors',
|
|
'Routers',
|
|
'Stores',
|
|
'SvelteKit Adapters',
|
|
'Testing',
|
|
'User Interaction'
|
|
]),
|
|
tags: z.array(z.string()).max(5).optional()
|
|
})
|
|
);
|
|
|
|
export const templatesSchema = z.array(
|
|
z.object({
|
|
title: z.string().max(50),
|
|
url: z.string().url().optional(),
|
|
repository: z.string().url(),
|
|
description: z.string().max(250),
|
|
category: z.enum(['Svelte Add', 'SvelteKit', 'Svelte']),
|
|
tags: z.array(z.string()).max(5).optional()
|
|
})
|
|
);
|