mirror of
https://github.com/LukeHagar/sveltesociety.dev.git
synced 2025-12-06 12:47:44 +00:00
Stricter npm field validation (#484)
* Add zod schemas for CI validation * Require npm field for components.json * Remove svelte-layout-resizable * Stricter Zod validation * Stricter repository field validation * Implement requested changes * Add back accidentally removed field * Move SvelteStore to templates.json * Update category and tags
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { z } from 'zod';
|
||||
import packageNameRegex from 'package-name-regex';
|
||||
|
||||
export const componentsSchema = z.array(
|
||||
z.object({
|
||||
title: z.string(),
|
||||
npm: z
|
||||
.string()
|
||||
.regex(/(@[\w-]+\/)?[\w-]+/)
|
||||
.optional(),
|
||||
npm: z.string().regex(packageNameRegex),
|
||||
url: z.string().url().optional(),
|
||||
repository: z.string().url(),
|
||||
description: z.string(),
|
||||
@@ -46,10 +44,7 @@ export const templatesSchema = z.array(
|
||||
export const toolsSchema = z.array(
|
||||
z.object({
|
||||
title: z.string(),
|
||||
npm: z
|
||||
.string()
|
||||
.regex(/(@[\w-]+\/)?[\w-]+/)
|
||||
.optional(),
|
||||
npm: z.string().regex(packageNameRegex).optional(),
|
||||
url: z.string().url().optional(),
|
||||
repository: z.string().url(),
|
||||
description: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user