Skip to content

Commit 09f22cf

Browse files
committed
Fix mdx-components.tsx generation in --add mode
- Remove fumadocs-ui/mdx import (not in dependencies) - Use getMDXComponents() from template's mdx/index.tsx - Fixes build errors when deploying to Vercel
1 parent 6901714 commit 09f22cf

2 files changed

Lines changed: 3 additions & 24 deletions

File tree

packages/create-unmint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-unmint",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Create a new Unmint documentation project",
55
"type": "module",
66
"bin": {

packages/create-unmint/src/utils/merge.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -298,33 +298,12 @@ export async function createMdxComponents(targetDir: string, appDir: string): Pr
298298
const componentsPath = appDir.includes('src') ? '@/app/components/docs/mdx' : '@/app/components/docs/mdx'
299299

300300
const content = `import type { MDXComponents } from 'mdx/types'
301-
import defaultComponents from 'fumadocs-ui/mdx'
302-
import { Accordion } from '${componentsPath}/accordion'
303-
import { Callout, Note, Tip, Warning, Info } from '${componentsPath}/callout'
304-
import { Card, CardGroup } from '${componentsPath}/card'
305-
import { CodeBlock } from '${componentsPath}/code-block'
306-
import { Frame } from '${componentsPath}/frame'
307-
import { Steps, Step } from '${componentsPath}/steps'
308-
import { Tab, Tabs } from '${componentsPath}/tabs'
301+
import { getMDXComponents } from '${componentsPath}'
309302
310303
export function useMDXComponents(components: MDXComponents): MDXComponents {
311304
return {
312-
...defaultComponents,
305+
...getMDXComponents(),
313306
...components,
314-
Accordion,
315-
Callout,
316-
Note,
317-
Tip,
318-
Warning,
319-
Info,
320-
Card,
321-
CardGroup,
322-
CodeBlock,
323-
Frame,
324-
Steps,
325-
Step,
326-
Tab,
327-
Tabs,
328307
}
329308
}
330309
`

0 commit comments

Comments
 (0)