|
| 1 | +import { NextResponse } from "next/server" |
| 2 | +import registry from "@/registry.json" |
| 3 | + |
| 4 | +export const dynamic = "force-static" |
| 5 | + |
| 6 | +export function GET() { |
| 7 | + const items = registry.items |
| 8 | + |
| 9 | + const componentLines = items |
| 10 | + .map((item) => { |
| 11 | + const url = `https://ui.justinlevine.me/docs/components/${item.name}` |
| 12 | + return `- [${item.title}](${url}): ${item.description}` |
| 13 | + }) |
| 14 | + .join("\n") |
| 15 | + |
| 16 | + const registryLines = items |
| 17 | + .map((item) => { |
| 18 | + return `- [${item.name}.json](https://ui.justinlevine.me/r/${item.name}.json): Registry JSON for ${item.title}` |
| 19 | + }) |
| 20 | + .join("\n") |
| 21 | + |
| 22 | + const body = `# jal-co/ui |
| 23 | +
|
| 24 | +> jalco ui is a React component library by Justin Levine. It ships polished, composable components for React and Next.js projects, distributed via a shadcn-compatible registry. Install any component with a single command or copy the source directly. |
| 25 | +
|
| 26 | +## Install |
| 27 | +
|
| 28 | +Components are installed using the shadcn CLI. No npm package to install — each component is copied into your project as source code. |
| 29 | +
|
| 30 | +\`\`\` |
| 31 | +npx shadcn@latest add https://ui.justinlevine.me/r/<component-name>.json |
| 32 | +\`\`\` |
| 33 | +
|
| 34 | +Replace \`<component-name>\` with any component name listed below. |
| 35 | +
|
| 36 | +## Key details |
| 37 | +
|
| 38 | +- Built with React 19, Next.js 15, Tailwind CSS v4, and Radix UI primitives |
| 39 | +- All components are server-component-first where possible |
| 40 | +- No wrapper package — components are copied as source into your project |
| 41 | +- Uses class-variance-authority for variant systems |
| 42 | +- Designed for accessibility, composability, and copy-paste ergonomics |
| 43 | +- Source: https://github.com/jal-co/ui |
| 44 | +
|
| 45 | +## Components |
| 46 | +
|
| 47 | +${componentLines} |
| 48 | +
|
| 49 | +## Registry JSON |
| 50 | +
|
| 51 | +${registryLines} |
| 52 | +
|
| 53 | +## Optional |
| 54 | +
|
| 55 | +- [Installation guide](https://ui.justinlevine.me/docs/installation): How to set up jalco ui in a new or existing project |
| 56 | +- [Color Themes](https://ui.justinlevine.me/docs/themes): Available color themes and how to customize them |
| 57 | +- [GitHub](https://github.com/jal-co/ui): Source code repository |
| 58 | +` |
| 59 | + |
| 60 | + return new NextResponse(body, { |
| 61 | + headers: { |
| 62 | + "Content-Type": "text/plain; charset=utf-8", |
| 63 | + "Cache-Control": "public, max-age=3600", |
| 64 | + }, |
| 65 | + }) |
| 66 | +} |
0 commit comments