From 928dc3068a6c0484103f73c42ec7570f4b6c6234 Mon Sep 17 00:00:00 2001 From: Eric Luce <37158449+eluce2@users.noreply.github.com> Date: Sun, 24 Aug 2025 22:02:45 -0500 Subject: [PATCH] static params for the components --- apps/docs/src/app/r/[[...name]]/route.ts | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apps/docs/src/app/r/[[...name]]/route.ts b/apps/docs/src/app/r/[[...name]]/route.ts index e7326ad4..29586f6a 100644 --- a/apps/docs/src/app/r/[[...name]]/route.ts +++ b/apps/docs/src/app/r/[[...name]]/route.ts @@ -1,5 +1,6 @@ import { handle } from "hono/vercel"; import app from "./registry"; +import { getRegistryIndex } from "@proofkit/registry"; const handler = handle(app); export { @@ -11,3 +12,29 @@ export { handler as OPTIONS, handler as HEAD, }; + +// Generate static params for all registry routes +export async function generateStaticParams() { + try { + const index = await getRegistryIndex(); + + const params = [ + // Root registry route + { name: [] }, + // Individual component routes + ...index.map((item) => ({ + name: item.name.split('/'), + })), + // Meta routes for each component + ...index.map((item) => ({ + name: ['meta', ...item.name.split('/')], + })), + ]; + + console.log('Generated static params for registry:', params); + return params; + } catch (error) { + console.error('Failed to generate static params for registry:', error); + return [{ name: [] }]; + } +}