Files
supabase/apps/ui-library/package.json
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

114 lines
3.8 KiB
JSON

{
"name": "library",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev:content": "velite dev",
"dev:next": "next dev --port 3004",
"dev": "run-p build:content build:registry build:markdown && run-p --race dev:*",
"build:content": "velite build --strict",
"build:registry": "rimraf -G public/r/* && tsx ./scripts/build-registry.mts && shadcn build public/r/registry.json && tsx scripts/clean-registry.ts",
"build:markdown": "tsx ./scripts/build-markdown.ts",
"build:llms": "tsx ./scripts/build-llms-txt.ts",
"build:next": "next build --turbopack",
"build": "run-p build:content build:registry build:llms build:markdown && pnpm build:next",
"test:markdown": "tsx --test scripts/library-mdx-to-markdown.test.ts",
"test:middleware": "pnpm run build:markdown && tsx --test middleware.test.ts",
"start": "next start",
"lint": "eslint .",
"lint:mdx": "supa-mdx-lint content --config ../../supa-mdx-lint.config.toml",
"clean": "rimraf .next .turbo tsconfig.tsbuildinfo .contentlayer .velite",
"typecheck": "pnpm build:content && tsc --noEmit -p tsconfig.json"
},
"dependencies": {
"@hookform/resolvers": "^3.1.1",
"@monaco-editor/react": "catalog:",
"@react-router/fs-routes": "^7.4.0",
"@supabase-labs/y-supabase": "0.1.0",
"@supabase/postgrest-js": "catalog:",
"@supabase/supa-mdx-lint": "0.2.6-alpha",
"@supabase/vue-blocks": "workspace:*",
"@tanstack/react-query": "~5.83.0",
"@xyflow/react": "^12.10.1",
"api-types": "workspace:*",
"axios": "^1.12.0",
"class-variance-authority": "^0.7.1",
"cmdk": "^1.1.1",
"common": "workspace:*",
"common-tags": "^1.8.2",
"eslint-config-supabase": "workspace:*",
"framer-motion": "^11.18.2",
"icons": "workspace:*",
"jotai": "^2.8.0",
"lucide-react": "*",
"monaco-editor": "catalog:",
"next": "catalog:",
"next-themes": "catalog:",
"openai": "^5.9.0",
"openapi-fetch": "0.12.4",
"radix-ui": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
"react-hook-form": "^7.71.2",
"react-markdown": "^10.1.0",
"react-wrap-balancer": "^1.1.0",
"recharts": "catalog:",
"rehype-autolink-headings": "^7.1.0",
"rehype-pretty-code": "^0.9.0",
"rehype-slug": "^6.0.0",
"remark": "^14.0.3",
"remark-code-import": "^1.2.0",
"remark-gfm": "^4.0.0",
"sonner": "^1.5.0",
"ui": "workspace:*",
"ui-patterns": "workspace:*",
"unist-util-visit": "^5.0.0",
"vaul": "^1.1.2",
"velite": "catalog:",
"y-monaco": "^0.1.6",
"y-protocols": "^1.0.7",
"yjs": "^13.6.29",
"zod": "catalog:"
},
"devDependencies": {
"@babel/core": "*",
"@react-router/dev": "^7.9.0",
"@shikijs/compat": "^1.1.7",
"@supabase/ssr": "catalog:",
"@supabase/supabase-js": "catalog:",
"@tanstack/react-router": "catalog:",
"@tanstack/react-start": "catalog:",
"@types/common-tags": "^1.8.4",
"@types/lodash": "^4.17.16",
"@types/mdast": "^3.0.15",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@typescript/native": "catalog:",
"config": "workspace:^",
"gray-matter": "^4.0.3",
"lodash": "catalog:",
"mdast-util-from-markdown": "^1.3.1",
"mdast-util-gfm": "^2.0.2",
"mdast-util-mdx": "^2.0.1",
"mdast-util-mdx-jsx": "^2.1.4",
"mdast-util-to-markdown": "^1.5.0",
"mdast-util-toc": "^6.1.1",
"micromark-extension-gfm": "^2.0.3",
"micromark-extension-mdxjs": "^1.0.1",
"npm-run-all": "^4.1.5",
"postcss": "catalog:",
"react-dropzone": "^14.3.8",
"react-router": "^7.13.2",
"rimraf": "^4.1.3",
"shadcn": "^3.0.0",
"shiki": "^1.1.7",
"tailwindcss": "catalog:",
"tsconfig": "workspace:*",
"tsx": "catalog:",
"typescript": "catalog:",
"vite": "catalog:"
}
}