mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: Add semver format validation for version field
- Add regex validation to ensure version field follows semver format - Fixes schema validation test for invalid version format - Supports major.minor.patch format with optional pre-release and build metadata
This commit is contained in:
parent
56cded1742
commit
fdd911a126
1 changed files with 3 additions and 1 deletions
|
|
@ -7,7 +7,9 @@ export const baseMetadataSchema = z.object({
|
|||
id: z.string().optional(),
|
||||
name: z.string().min(1, "Name is required"),
|
||||
description: z.string(),
|
||||
version: z.string(),
|
||||
version: z
|
||||
.string()
|
||||
.refine((v) => /^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(v), "Version must be in semver format"),
|
||||
binaryUrl: z.string().url("Binary URL must be a valid URL").optional(),
|
||||
binaryHash: z.string().optional(),
|
||||
tags: z.array(z.string()).optional(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue