Skip to content

Commit 6df6ae1

Browse files
committed
Merge branch 'main' into feat/editor-select
2 parents 38da129 + f8d65c4 commit 6df6ae1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

apps/www/src/app/api/registry/[name]/route.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,23 @@ import { z } from 'zod';
33

44
import { highlightFiles } from '@/lib/highlight-code';
55
import { getRegistryItem } from '@/lib/registry';
6+
import { registry } from '@/registry/registry';
7+
8+
export const dynamic = 'force-static';
69

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

14+
export function generateStaticParams() {
15+
return registry.map(({ name }) => ({
16+
name,
17+
}));
18+
}
19+
1120
export async function GET(_: Request, { params }: any) {
1221
try {
13-
const { name } = ParamsSchema.parse({ name: params.name });
22+
const { name } = ParamsSchema.parse({ name: (await params).name });
1423

1524
const item = await getRegistryItem(name);
1625

config/eslint/bases/unicorn.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = {
2727
'unicorn/no-array-callback-reference': 'off',
2828
'unicorn/no-array-for-each': 'off',
2929
'unicorn/no-array-reduce': 'off',
30+
'unicorn/no-await-expression-member': 'off',
3031
'unicorn/no-document-cookie': 'off',
3132
'unicorn/no-for-loop': 'off',
3233
'unicorn/no-null': 'off',

0 commit comments

Comments
 (0)