From bfdeec550f4ab02bed4558bf24748bdc312bcbf5 Mon Sep 17 00:00:00 2001 From: Will King Date: Wed, 30 Aug 2023 09:50:13 -0500 Subject: [PATCH] Fixing version --- app/lib/docs/versions.server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/docs/versions.server.ts b/app/lib/docs/versions.server.ts index 93a27e1..2f29d7c 100644 --- a/app/lib/docs/versions.server.ts +++ b/app/lib/docs/versions.server.ts @@ -50,7 +50,7 @@ export async function getProductVersions({ return versionsCache.fetch(`${isPrivate ? 'private' : 'public'}:${product}`) } -const versionValidator = z.array(z.string().regex(/\d\.\d\.\d/)).nonempty() +const versionValidator = z.array(z.string().regex(/\d(\.\d){0,2}/)).nonempty() async function getAllVersions({ product, @@ -68,7 +68,7 @@ export function versionsToMenu( ref: string, versions: string[], ): NonEmptyZipperObj | null { - const sorted = semver.rsort(versions).map((v, i) => ({ + const sorted = versions.map((v, i) => ({ label: i === 0 ? `${v} (latest)` : v, to: `/${product}/${i === 0 ? 'latest' : v}`, }))