Skip to content

Commit

Permalink
chore(www): switch to contentlayer2 (shadcn-ui#4292)
Browse files Browse the repository at this point in the history
* chore(www): switch to contentlayer2

* chore: rebuild registry

* fix: build
  • Loading branch information
shadcn authored and tangtai committed Aug 29, 2024
1 parent fe58345 commit 2bd6880
Show file tree
Hide file tree
Showing 10 changed files with 9,193 additions and 6,397 deletions.
2 changes: 1 addition & 1 deletion apps/www/components/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as React from "react"
import Image from "next/image"
import Link from "next/link"
import { useMDXComponent } from "next-contentlayer/hooks"
import { useMDXComponent } from "next-contentlayer2/hooks"
import { NpmCommands } from "types/unist"

import { Event } from "@/lib/events"
Expand Down
2 changes: 1 addition & 1 deletion apps/www/contentlayer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
defineDocumentType,
defineNestedType,
makeSource,
} from "contentlayer/source-files"
} from "contentlayer2/source-files"
import rehypeAutolinkHeadings from "rehype-autolink-headings"
import rehypePrettyCode from "rehype-pretty-code"
import rehypeSlug from "rehype-slug"
Expand Down
2 changes: 1 addition & 1 deletion apps/www/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContentlayerPlugin } from "next-contentlayer"
import { createContentlayerPlugin } from "next-contentlayer2"

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
18 changes: 9 additions & 9 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"type": "module",
"scripts": {
"dev": "next dev -p 3003",
"build": "contentlayer build && pnpm build:registry && next build",
"build": "contentlayer2 build && pnpm build:registry && next build",
"build:registry": "tsx --tsconfig ./tsconfig.scripts.json ./scripts/build-registry.mts && prettier --loglevel silent --write \"registry/**/*.{ts,tsx,mdx}\" --cache",
"build:docs": "contentlayer build",
"build:docs": "contentlayer2 build",
"seed:tasks": "tsx --tsconfig ./tsconfig.scripts.json ./app/(app)/examples/tasks/data/seed.ts",
"start": "next start -p 3001",
"lint": "next lint",
"lint:fix": "next lint --fix",
"preview": "next build && next start -p 3001",
"typecheck": "contentlayer build && tsc --noEmit",
"typecheck": "contentlayer2 build && tsc --noEmit",
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache"
},
Expand All @@ -28,7 +28,7 @@
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-context-menu": "^2.1.4",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.0.5",
"@radix-ui/react-hover-card": "^1.0.6",
"@radix-ui/react-icons": "^1.3.0",
Expand Down Expand Up @@ -56,7 +56,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^1.2.1",
"cmdk": "^0.2.0",
"contentlayer": "0.3.4",
"contentlayer2": "^0.4.6",
"date-fns": "^2.30.0",
"embla-carousel-autoplay": "8.0.0-rc15",
"embla-carousel-react": "8.0.0-rc15",
Expand All @@ -68,7 +68,7 @@
"lucide-react": "0.359.0",
"markdown-wasm": "^1.2.0",
"next": "14.3.0-canary.43",
"next-contentlayer": "0.3.4",
"next-contentlayer2": "^0.4.6",
"next-themes": "^0.2.1",
"react": "^18.2.0",
"react-day-picker": "^8.7.1",
Expand All @@ -82,7 +82,7 @@
"swr": "2.2.6-beta.3",
"tailwind-merge": "^1.12.0",
"ts-morph": "^22.0.0",
"vaul": "^0.9.1",
"vaul": "0.9.0",
"zod": "^3.21.4"
},
"devDependencies": {
Expand All @@ -102,11 +102,11 @@
"rehype-slug": "^5.1.0",
"remark": "^14.0.3",
"remark-code-import": "^1.2.0",
"remark-gfm": "^3.0.1",
"remark-gfm": "^4.0.0",
"rimraf": "^4.1.3",
"shiki": "^1.10.1",
"tailwindcss": "3.3.7",
"typescript": "^5.4.2",
"typescript": "^5.5.3",
"unist-builder": "3.0.0",
"unist-util-visit": "^4.1.2"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/www/public/registry/styles/default/chart.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/www/public/registry/styles/new-york/chart.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/www/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
".next/types/**/*.ts",
".contentlayer/generated"
],
"exclude": ["node_modules", "./scripts/build-registry.mts"]
"exclude": ["node_modules", "./scripts/build-registry.mts", "__registry__"]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"dev": "turbo run dev --parallel",
"cli:dev": "turbo --filter=shadcn-ui dev",
"cli:start": "pnpm --filter=shadcn-ui start:dev",
"docs:build": "pnpm --filter=www build:docs",
"www:dev": "pnpm --filter=www dev",
"www:build": "pnpm --filter=www build",
"lint": "turbo run lint",
Expand Down Expand Up @@ -70,6 +71,6 @@
"@types/node": "^20.11.27",
"@types/react": "^18.2.65",
"@types/react-dom": "^18.2.22",
"typescript": "^5.4.2"
"typescript": "^5.5.3"
}
}
Loading

0 comments on commit 2bd6880

Please sign in to comment.