Skip to content

Commit

Permalink
Merge branch 'main' into feat/editor-select
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Nov 26, 2024
2 parents 38da129 + f8d65c4 commit 6df6ae1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/www/src/app/api/registry/[name]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@ import { z } from 'zod';

import { highlightFiles } from '@/lib/highlight-code';
import { getRegistryItem } from '@/lib/registry';
import { registry } from '@/registry/registry';

export const dynamic = 'force-static';

const ParamsSchema = z.object({
name: z.string().min(1, 'Name parameter is required'),
});

export function generateStaticParams() {
return registry.map(({ name }) => ({
name,
}));
}

export async function GET(_: Request, { params }: any) {
try {
const { name } = ParamsSchema.parse({ name: params.name });
const { name } = ParamsSchema.parse({ name: (await params).name });

const item = await getRegistryItem(name);

Expand Down
1 change: 1 addition & 0 deletions config/eslint/bases/unicorn.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-document-cookie': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-null': 'off',
Expand Down

0 comments on commit 6df6ae1

Please sign in to comment.