Files
supabase/apps/design-system/registry/ui.ts
T
Ivan Vasilov c6cdf4bd53 Migrate off contentlayer2 to Velite (design-system, ui-library, learn) (#48546)
## Summary
- `contentlayer2@0.4.6` is unmaintained and drags in a heavy, stale
dependency graph (esbuild pinned to 0.17–0.20, mdx-bundler, old
`@opentelemetry/core`) that was the recurring source of vuln bumps.
- Migrates all three apps that used it — `design-system`, `ui-library`,
`learn` — to [Velite](https://velite.js.org), preserving the generated
typed `allDocs`/`Doc` collection and the `body.code` + `useMDXComponent`
runtime via a small shared local hook.
- Same MDX pipeline (remark-gfm, remark-code-import, rehype-slug,
rehype-pretty-code w/ Shiki compat + local theme,
rehype-autolink-headings, custom
`__rawString__`/`__src__`/`__event__`/`__style__` visitors) ported 1:1
into each app's `velite.config.js`.
- `learn`'s extra frontmatter fields (`chapterNumber`, `explore`,
`courseHero`) are now backed by real Velite/Zod schema types, so the
`(doc as any)` casts in `get-next-page.ts` / `get-current-chapter.ts` /
the doc page could be dropped.
- `next.config.mjs` no longer wraps with `withContentlayer`; since
Velite has no Next.js webpack-plugin equivalent, each app's `dev` script
now runs `velite dev` and `next dev` in parallel via `npm-run-all`.

Ref:
[FE-3861](https://linear.app/supabase/issue/FE-3861/migrate-off-contentlayer2-learn-ui-library-design-system-to-shed)

## Test plan
- [x] `pnpm build:content` (Velite build) succeeds for all three apps
- [x] `pnpm typecheck` passes for all three apps
- [ ] Manual smoke test of `pnpm dev` for each app in a browser (docs
pages render, TOC, copy-button, code highlighting)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Improvements**
* Improved content generation across documentation, learning materials,
and the UI library for more consistent pages.
* Preserved MDX rendering, navigation, table of contents, course
metadata, source previews, and component examples.
* Improved consistency when displaying documentation and interactive
examples.
* Improved application loading by optimizing how interface components
are delivered.
* **Chores**
* Streamlined content compilation and development workflows across the
design system, learning area, and UI library.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-04 15:49:44 +02:00

59 lines
3.9 KiB
TypeScript

import { Registry } from './schema'
// Base shadcn/ui primitives. Unlike `examples`/`fragments`/`charts`, these don't
// live under `registry/default/*` — their source is the real, shared components
// consumed via `import { X } from 'ui'`, at `packages/ui/src/components/shadcn/ui`.
// `getRegistryFiles` in `lib/rehype-component.ts` resolves `components:ui` files
// against that package path instead of the usual `registry/${style}/` prefix.
export const ui: Registry = [
{ name: 'accordion', type: 'components:ui', files: ['accordion.tsx'] },
{ name: 'alert', type: 'components:ui', files: ['alert.tsx'] },
{ name: 'alert-dialog', type: 'components:ui', files: ['alert-dialog.tsx'] },
{ name: 'aspect-ratio', type: 'components:ui', files: ['aspect-ratio.tsx'] },
{ name: 'avatar', type: 'components:ui', files: ['avatar.tsx'] },
{ name: 'badge', type: 'components:ui', files: ['badge.tsx'] },
{ name: 'breadcrumb', type: 'components:ui', files: ['breadcrumb.tsx'] },
{ name: 'button', type: 'components:ui', files: ['button.tsx'] },
{ name: 'button-group', type: 'components:ui', files: ['button-group.tsx'] },
{ name: 'calendar', type: 'components:ui', files: ['calendar.tsx'] },
{ name: 'card', type: 'components:ui', files: ['card.tsx'] },
{ name: 'chart', type: 'components:ui', files: ['chart.tsx'] },
{ name: 'checkbox', type: 'components:ui', files: ['checkbox.tsx'] },
{ name: 'collapsible', type: 'components:ui', files: ['collapsible.tsx'] },
{ name: 'command', type: 'components:ui', files: ['command.tsx'] },
{ name: 'context-menu', type: 'components:ui', files: ['context-menu.tsx'] },
{ name: 'dialog', type: 'components:ui', files: ['dialog.tsx'] },
{ name: 'drawer', type: 'components:ui', files: ['drawer.tsx'] },
{ name: 'dropdown-menu', type: 'components:ui', files: ['dropdown-menu.tsx'] },
{ name: 'field', type: 'components:ui', files: ['field.tsx'] },
{ name: 'form', type: 'components:ui', files: ['form.tsx'] },
{ name: 'hover-card', type: 'components:ui', files: ['hover-card.tsx'] },
{ name: 'input', type: 'components:ui', files: ['input.tsx'] },
{ name: 'input-group', type: 'components:ui', files: ['input-group.tsx'] },
{ name: 'input-otp', type: 'components:ui', files: ['input-otp.tsx'] },
{ name: 'label', type: 'components:ui', files: ['label.tsx'] },
{ name: 'menubar', type: 'components:ui', files: ['menubar.tsx'] },
{ name: 'navigation-menu', type: 'components:ui', files: ['navigation-menu.tsx'] },
{ name: 'popover', type: 'components:ui', files: ['popover.tsx'] },
{ name: 'progress', type: 'components:ui', files: ['progress.tsx'] },
{ name: 'radio-group', type: 'components:ui', files: ['radio-group.tsx'] },
{ name: 'resizable', type: 'components:ui', files: ['resizable.tsx'] },
{ name: 'scroll-area', type: 'components:ui', files: ['scroll-area.tsx'] },
{ name: 'select', type: 'components:ui', files: ['select.tsx'] },
{ name: 'separator', type: 'components:ui', files: ['separator.tsx'] },
{ name: 'sheet', type: 'components:ui', files: ['sheet.tsx'] },
{ name: 'sidebar', type: 'components:ui', files: ['sidebar.tsx'] },
{ name: 'skeleton', type: 'components:ui', files: ['skeleton.tsx'] },
{ name: 'slider', type: 'components:ui', files: ['slider.tsx'] },
{ name: 'sonner', type: 'components:ui', files: ['sonner.tsx'] },
{ name: 'sonner-progress', type: 'components:ui', files: ['sonner-progress.tsx'] },
{ name: 'switch', type: 'components:ui', files: ['switch.tsx'] },
{ name: 'table', type: 'components:ui', files: ['table.tsx'] },
{ name: 'tabs', type: 'components:ui', files: ['tabs.tsx'] },
{ name: 'text-area', type: 'components:ui', files: ['text-area.tsx'] },
{ name: 'textarea', type: 'components:ui', files: ['textarea.tsx'] },
{ name: 'toggle', type: 'components:ui', files: ['toggle.tsx'] },
{ name: 'toggle-group', type: 'components:ui', files: ['toggle-group.tsx'] },
{ name: 'tooltip', type: 'components:ui', files: ['tooltip.tsx'] },
]