@vercel/geistdocs 1.2.3 → 1.3.0-canary.88e35b7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +6 -0
- package/dist/components/callout.d.ts +12 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +7 -0
- package/dist/components/code-block-tabs.d.ts +7 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -0
- package/dist/components/code-block-tabs.js +7 -0
- package/dist/components/code-block.d.ts +14 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +41 -0
- package/dist/components/mermaid.d.ts +4 -0
- package/dist/components/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid.js +44 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/video.d.ts +6 -0
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components/video.js +3 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/controls.d.ts +15 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +52 -0
- package/dist/internal/chat/context.d.ts +19 -0
- package/dist/internal/chat/context.d.ts.map +1 -0
- package/dist/internal/chat/context.js +36 -0
- package/dist/internal/chat/conversation.d.ts +10 -0
- package/dist/internal/chat/conversation.d.ts.map +1 -0
- package/dist/internal/chat/conversation.js +16 -0
- package/dist/internal/chat/copy-chat.d.ts +5 -0
- package/dist/internal/chat/copy-chat.d.ts.map +1 -0
- package/dist/internal/chat/copy-chat.js +35 -0
- package/dist/internal/chat/db.d.ts +13 -0
- package/dist/internal/chat/db.d.ts.map +1 -0
- package/dist/internal/chat/db.js +19 -0
- package/dist/internal/chat/message-metadata.d.ts +8 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -0
- package/dist/internal/chat/message-metadata.js +29 -0
- package/dist/internal/chat/message.d.ts +11 -0
- package/dist/internal/chat/message.d.ts.map +1 -0
- package/dist/internal/chat/message.js +11 -0
- package/dist/internal/chat/prompt-input.d.ts +13 -0
- package/dist/internal/chat/prompt-input.d.ts.map +1 -0
- package/dist/internal/chat/prompt-input.js +39 -0
- package/dist/internal/chat/shell.d.ts +2 -0
- package/dist/internal/chat/shell.d.ts.map +1 -0
- package/dist/internal/chat/shell.js +194 -0
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +18 -0
- package/dist/internal/chat/sources.d.ts +13 -0
- package/dist/internal/chat/sources.d.ts.map +1 -0
- package/dist/internal/chat/sources.js +9 -0
- package/dist/internal/chat/suggestion.d.ts +11 -0
- package/dist/internal/chat/suggestion.d.ts.map +1 -0
- package/dist/internal/chat/suggestion.js +12 -0
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +3 -0
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -0
- package/dist/internal/feedback-action.js +34 -0
- package/dist/internal/i18n.d.ts +6 -0
- package/dist/internal/i18n.d.ts.map +1 -0
- package/dist/internal/i18n.js +18 -0
- package/dist/internal/languages.d.ts +7 -0
- package/dist/internal/languages.d.ts.map +1 -0
- package/dist/internal/languages.js +18 -0
- package/dist/internal/not-implemented.d.ts +2 -0
- package/dist/internal/not-implemented.d.ts.map +1 -0
- package/dist/internal/not-implemented.js +4 -0
- package/dist/internal/page-actions-client.d.ts +14 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -0
- package/dist/internal/page-actions-client.js +154 -0
- package/dist/internal/page-actions.d.ts +18 -0
- package/dist/internal/page-actions.d.ts.map +1 -0
- package/dist/internal/page-actions.js +4 -0
- package/dist/internal/search.d.ts +5 -0
- package/dist/internal/search.d.ts.map +1 -0
- package/dist/internal/search.js +14 -0
- package/dist/internal/sidebar.d.ts +6 -0
- package/dist/internal/sidebar.d.ts.map +1 -0
- package/dist/internal/sidebar.js +37 -0
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/collapsible.d.ts +6 -0
- package/dist/internal/ui/collapsible.d.ts.map +1 -0
- package/dist/internal/ui/collapsible.js +12 -0
- package/dist/internal/ui/drawer.d.ts +6 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +13 -0
- package/dist/internal/ui/dropdown-menu.d.ts +22 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/internal/ui/dropdown-menu.js +41 -0
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/popover.d.ts +6 -0
- package/dist/internal/ui/popover.d.ts.map +1 -0
- package/dist/internal/ui/popover.js +13 -0
- package/dist/internal/ui/scroll-area.d.ts +5 -0
- package/dist/internal/ui/scroll-area.d.ts.map +1 -0
- package/dist/internal/ui/scroll-area.js +12 -0
- package/dist/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +10 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/use-mobile.d.ts +2 -0
- package/dist/internal/use-mobile.d.ts.map +1 -0
- package/dist/internal/use-mobile.js +16 -0
- package/dist/layout.d.ts +18 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +49 -0
- package/dist/mdx.d.ts +36 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +72 -0
- package/dist/pages/docs.d.ts +55 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +63 -0
- package/dist/proxy.d.ts +21 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +109 -0
- package/dist/routes/chat.d.ts +13 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +229 -0
- package/dist/routes/llms.d.ts +33 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +39 -0
- package/dist/routes/search.d.ts +10 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +33 -0
- package/dist/routes/sitemap.d.ts +35 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +150 -0
- package/dist/source.d.ts +30 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +72 -0
- package/package.json +129 -9
- package/styles.css +193 -0
- package/template/_gitignore +29 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +26 -0
- package/template/app/[lang]/(home)/components/cta.tsx +19 -0
- package/template/app/[lang]/(home)/components/hero.tsx +27 -0
- package/template/app/[lang]/(home)/components/one-two-section.tsx +25 -0
- package/template/app/[lang]/(home)/components/templates.tsx +50 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
- package/template/app/[lang]/(home)/layout.tsx +14 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -0
- package/template/app/[lang]/docs/layout.tsx +14 -0
- package/template/app/[lang]/layout.tsx +29 -0
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
- package/template/app/[lang]/llms.txt/route.ts +6 -0
- package/template/app/[lang]/og/[...slug]/background.png +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
- package/template/app/[lang]/rss.xml/route.ts +52 -0
- package/template/app/[lang]/sitemap.md/route.ts +9 -0
- package/template/app/actions/feedback/emotions.ts +18 -0
- package/template/app/actions/feedback/index.ts +45 -0
- package/template/app/api/chat/route.ts +8 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/global.css +2 -0
- package/template/app/robots.ts +14 -0
- package/template/app/sitemap.ts +36 -0
- package/template/app/styles/geistdocs.css +553 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +35 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +30 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +25 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +36 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx +11 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx +14 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +38 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +31 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +24 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +73 -0
- package/template/components/geistdocs/callout.tsx +40 -0
- package/template/components/geistdocs/chat.tsx +24 -0
- package/template/components/geistdocs/code-block-tabs.tsx +61 -0
- package/template/components/geistdocs/code-block.tsx +134 -0
- package/template/components/geistdocs/copy-page.tsx +27 -0
- package/template/components/geistdocs/desktop-menu.tsx +52 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/docs-page.tsx +35 -0
- package/template/components/geistdocs/edit-source.tsx +30 -0
- package/template/components/geistdocs/feedback.tsx +139 -0
- package/template/components/geistdocs/footer.tsx +30 -0
- package/template/components/geistdocs/github-button.tsx +19 -0
- package/template/components/geistdocs/home-layout.tsx +46 -0
- package/template/components/geistdocs/icons.tsx +13 -0
- package/template/components/geistdocs/installer.tsx +58 -0
- package/template/components/geistdocs/language-selector.tsx +3 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/mermaid.tsx +68 -0
- package/template/components/geistdocs/mobile-docs-bar.tsx +81 -0
- package/template/components/geistdocs/mobile-menu.tsx +150 -0
- package/template/components/geistdocs/navbar-logo.tsx +124 -0
- package/template/components/geistdocs/navbar.tsx +22 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/geistdocs/rss-button.tsx +10 -0
- package/template/components/geistdocs/scroll-top.tsx +21 -0
- package/template/components/geistdocs/search.tsx +17 -0
- package/template/components/geistdocs/sidebar.tsx +128 -0
- package/template/components/geistdocs/theme-aware-image.tsx +22 -0
- package/template/components/geistdocs/theme-toggle.tsx +3 -0
- package/template/components/geistdocs/video.tsx +16 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button-group.tsx +83 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/card.tsx +92 -0
- package/template/components/ui/collapsible.tsx +33 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components/ui/command.tsx +184 -0
- package/template/components/ui/dialog.tsx +143 -0
- package/template/components/ui/drawer.tsx +135 -0
- package/template/components/ui/dropdown-menu.tsx +257 -0
- package/template/components/ui/hover-card.tsx +44 -0
- package/template/components/ui/input-group.tsx +170 -0
- package/template/components/ui/input.tsx +21 -0
- package/template/components/ui/kbd.tsx +28 -0
- package/template/components/ui/navigation-menu.tsx +192 -0
- package/template/components/ui/popover.tsx +48 -0
- package/template/components/ui/scroll-area.tsx +58 -0
- package/template/components/ui/select.tsx +187 -0
- package/template/components/ui/separator.tsx +28 -0
- package/template/components/ui/sheet.tsx +139 -0
- package/template/components/ui/sonner.tsx +40 -0
- package/template/components/ui/spinner.tsx +16 -0
- package/template/components/ui/textarea.tsx +18 -0
- package/template/components/ui/tooltip.tsx +61 -0
- package/template/components.json +22 -0
- package/template/content/docs/ask-ai.cn.mdx +85 -0
- package/template/content/docs/ask-ai.mdx +85 -0
- package/template/content/docs/configuration.cn.mdx +115 -0
- package/template/content/docs/configuration.mdx +115 -0
- package/template/content/docs/deployment.cn.mdx +34 -0
- package/template/content/docs/deployment.mdx +34 -0
- package/template/content/docs/edit-on-github.cn.mdx +47 -0
- package/template/content/docs/edit-on-github.mdx +47 -0
- package/template/content/docs/env.cn.mdx +25 -0
- package/template/content/docs/env.mdx +25 -0
- package/template/content/docs/feedback.cn.mdx +85 -0
- package/template/content/docs/feedback.mdx +85 -0
- package/template/content/docs/getting-started.cn.mdx +86 -0
- package/template/content/docs/getting-started.mdx +86 -0
- package/template/content/docs/index.cn.mdx +54 -0
- package/template/content/docs/index.mdx +87 -0
- package/template/content/docs/internationalization.cn.mdx +113 -0
- package/template/content/docs/internationalization.mdx +117 -0
- package/template/content/docs/llms-txt.cn.mdx +50 -0
- package/template/content/docs/llms-txt.mdx +50 -0
- package/template/content/docs/md.cn.mdx +68 -0
- package/template/content/docs/md.mdx +68 -0
- package/template/content/docs/meta.json +21 -0
- package/template/content/docs/open-in-chat.cn.mdx +78 -0
- package/template/content/docs/open-in-chat.mdx +78 -0
- package/template/content/docs/provider.cn.mdx +69 -0
- package/template/content/docs/provider.mdx +69 -0
- package/template/content/docs/rss.cn.mdx +104 -0
- package/template/content/docs/rss.mdx +104 -0
- package/template/content/docs/syntax.cn.mdx +416 -0
- package/template/content/docs/syntax.mdx +407 -0
- package/template/content/docs/theme-aware-image.mdx +53 -0
- package/template/geistdocs.tsx +51 -0
- package/template/hooks/geistdocs/use-sidebar.ts +13 -0
- package/template/hooks/use-mobile.ts +19 -0
- package/template/lib/geistdocs/config.tsx +27 -0
- package/template/lib/geistdocs/fonts.ts +18 -0
- package/template/lib/geistdocs/i18n.ts +13 -0
- package/template/lib/geistdocs/md-tracking.ts +56 -0
- package/template/lib/geistdocs/source.ts +12 -0
- package/template/lib/utils.ts +6 -0
- package/template/next.config.ts +22 -0
- package/template/package.json +63 -0
- package/template/postcss.config.mjs +5 -0
- package/template/proxy.ts +16 -0
- package/template/source.config.ts +62 -0
- package/template/tsconfig.json +37 -0
- package/dist/index.js +0 -2
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template",
|
|
3
|
+
"description": "Template for Geistdocs projects.",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"dev": "next dev",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"postinstall": "fumadocs-mdx",
|
|
11
|
+
"translate": "npx @vercel/geistdocs translate"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@ai-sdk/react": "^2.0.115",
|
|
15
|
+
"@icons-pack/react-simple-icons": "^13.8.0",
|
|
16
|
+
"@orama/tokenizers": "^3.1.16",
|
|
17
|
+
"@vercel/geistdocs": "1.3.0-canary.88e35b7",
|
|
18
|
+
"@streamdown/cjk": "^1.0.1",
|
|
19
|
+
"@streamdown/code": "^1.0.1",
|
|
20
|
+
"@vercel/agent-readability": "^0.2.1",
|
|
21
|
+
"@vercel/analytics": "^1.6.1",
|
|
22
|
+
"@vercel/speed-insights": "^1.3.1",
|
|
23
|
+
"ai": "^5.0.106",
|
|
24
|
+
"class-variance-authority": "^0.7.1",
|
|
25
|
+
"clsx": "^2.1.1",
|
|
26
|
+
"cmdk": "^1.1.1",
|
|
27
|
+
"dexie": "^4.2.1",
|
|
28
|
+
"dexie-react-hooks": "^4.2.0",
|
|
29
|
+
"feed": "^5.1.0",
|
|
30
|
+
"fumadocs-core": "16.2.2",
|
|
31
|
+
"fumadocs-mdx": "14.0.4",
|
|
32
|
+
"fumadocs-ui": "16.2.2",
|
|
33
|
+
"jotai": "^2.15.2",
|
|
34
|
+
"lucide-react": "^0.555.0",
|
|
35
|
+
"mermaid": "^11.12.2",
|
|
36
|
+
"motion": "^12.23.25",
|
|
37
|
+
"nanoid": "^5.1.6",
|
|
38
|
+
"next": "16.0.10",
|
|
39
|
+
"next-themes": "^0.4.6",
|
|
40
|
+
"radix-ui": "latest",
|
|
41
|
+
"react": "^19.2.3",
|
|
42
|
+
"react-dom": "^19.2.3",
|
|
43
|
+
"react-player": "^3.4.0",
|
|
44
|
+
"shiki": "^3.22.0",
|
|
45
|
+
"sonner": "^2.0.7",
|
|
46
|
+
"streamdown": "^2.1.0",
|
|
47
|
+
"tailwind-merge": "^3.4.0",
|
|
48
|
+
"use-stick-to-bottom": "^1.1.1",
|
|
49
|
+
"vaul": "^1.1.2",
|
|
50
|
+
"zod": "^4.1.13"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@tailwindcss/postcss": "^4.1.17",
|
|
54
|
+
"@types/mdx": "^2.0.13",
|
|
55
|
+
"@types/node": "^24.10.1",
|
|
56
|
+
"@types/react": "^19.2.7",
|
|
57
|
+
"@types/react-dom": "^19.2.3",
|
|
58
|
+
"postcss": "^8.5.6",
|
|
59
|
+
"tailwindcss": "^4.1.17",
|
|
60
|
+
"tw-animate-css": "^1.4.0",
|
|
61
|
+
"typescript": "^5.9.3"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createProxy } from "@vercel/geistdocs/proxy";
|
|
2
|
+
import { config as geistdocsConfig } from "@/lib/geistdocs/config";
|
|
3
|
+
import { trackMdRequest } from "@/lib/geistdocs/md-tracking";
|
|
4
|
+
|
|
5
|
+
const proxy = createProxy({
|
|
6
|
+
config: geistdocsConfig,
|
|
7
|
+
trackMarkdownRequest: trackMdRequest,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const config = {
|
|
11
|
+
matcher: [
|
|
12
|
+
"/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)",
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default proxy;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
|
|
2
|
+
import {
|
|
3
|
+
defineConfig,
|
|
4
|
+
defineDocs,
|
|
5
|
+
frontmatterSchema,
|
|
6
|
+
metaSchema,
|
|
7
|
+
} from "fumadocs-mdx/config";
|
|
8
|
+
import lastModified from "fumadocs-mdx/plugins/last-modified";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
|
|
11
|
+
// You can customise Zod schemas for frontmatter and `meta.json` here
|
|
12
|
+
// see https://fumadocs.dev/docs/mdx/collections
|
|
13
|
+
export const docs = defineDocs({
|
|
14
|
+
dir: "content/docs",
|
|
15
|
+
docs: {
|
|
16
|
+
schema: frontmatterSchema.extend({
|
|
17
|
+
product: z.string().optional(),
|
|
18
|
+
url: z
|
|
19
|
+
.string()
|
|
20
|
+
.regex(/^\/.*/, { message: "url must start with a slash" })
|
|
21
|
+
.optional(),
|
|
22
|
+
type: z
|
|
23
|
+
.enum([
|
|
24
|
+
"conceptual", // Explains what something is and why it exists. Architecture, mental models, design decisions.
|
|
25
|
+
"guide", // Walks through how to accomplish a goal. Tutorials, getting started, workflows.
|
|
26
|
+
"reference", // Lookup-oriented, exhaustive details. API docs, config options, function signatures.
|
|
27
|
+
"troubleshooting", // Diagnoses problems and solutions. FAQs, errors, known issues, debugging guides.
|
|
28
|
+
"integration", // Connects multiple systems. 3rd-party setup, plugins, webhooks, migrations.
|
|
29
|
+
"overview", // High-level introductions. Landing pages, changelogs, release notes.
|
|
30
|
+
])
|
|
31
|
+
.optional(),
|
|
32
|
+
prerequisites: z
|
|
33
|
+
.array(
|
|
34
|
+
z.string().regex(/^\/.*/, {
|
|
35
|
+
message: "prerequisites must start with a slash",
|
|
36
|
+
})
|
|
37
|
+
)
|
|
38
|
+
.optional(),
|
|
39
|
+
related: z
|
|
40
|
+
.array(
|
|
41
|
+
z
|
|
42
|
+
.string()
|
|
43
|
+
.regex(/^\/.*/, { message: "related must start with a slash" })
|
|
44
|
+
)
|
|
45
|
+
.optional(),
|
|
46
|
+
summary: z.string().optional(),
|
|
47
|
+
}),
|
|
48
|
+
postprocess: {
|
|
49
|
+
includeProcessedMarkdown: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
meta: {
|
|
53
|
+
schema: metaSchema,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export default defineConfig({
|
|
58
|
+
mdxOptions: {
|
|
59
|
+
remarkPlugins: [remarkMdxMermaid],
|
|
60
|
+
},
|
|
61
|
+
plugins: [lastModified()],
|
|
62
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
"incremental": true,
|
|
18
|
+
"paths": {
|
|
19
|
+
"@/*": ["./*"],
|
|
20
|
+
"@/.source": [".source"]
|
|
21
|
+
},
|
|
22
|
+
"plugins": [
|
|
23
|
+
{
|
|
24
|
+
"name": "next"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"strictNullChecks": true
|
|
28
|
+
},
|
|
29
|
+
"include": [
|
|
30
|
+
"next-env.d.ts",
|
|
31
|
+
"**/*.ts",
|
|
32
|
+
"**/*.tsx",
|
|
33
|
+
".next/types/**/*.ts",
|
|
34
|
+
".next/dev/types/**/*.ts"
|
|
35
|
+
],
|
|
36
|
+
"exclude": ["node_modules"]
|
|
37
|
+
}
|
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{program as P}from"commander";import{copyFile as V,rm as q}from"fs/promises";import{join as R}from"path";import{cancel as W,intro as Y,isCancel as Z,log as Q,outro as tt,spinner as et,text as st}from"@clack/prompts";import{spawn as X}from"child_process";var v="https://github.com/vercel/geistdocs";var h={stdio:"ignore"};var x="geistdocs-update",f=(t,e)=>new Promise((s,r)=>{let[a,...i]=t.split(" "),n=X(a,i,{stdio:["ignore","pipe","pipe"],shell:e?.shell??!0,cwd:e?.cwd}),l="",c="";n.stdout?.on("data",p=>{l+=p.toString()}),n.stderr?.on("data",p=>{c+=p.toString()});let o=()=>{n.kill("SIGTERM"),setTimeout(()=>{n.killed||n.kill("SIGKILL")},1e3)};process.on("SIGINT",o),process.on("SIGTERM",o),n.on("close",p=>{process.removeListener("SIGINT",o),process.removeListener("SIGTERM",o),p===0?s({stdout:l,stderr:c}):r(new Error(`Command failed with code ${p}: ${c}`))}),n.on("error",p=>{process.removeListener("SIGINT",o),process.removeListener("SIGTERM",o),r(p)})});var nt="https://github.com/vercel/geistdocs.git",rt=async t=>{await f(`git clone --depth 1 --filter=blob:none --sparse ${nt} ${t}`,h),await f("git sparse-checkout set apps/template",{...h,cwd:t}),await f("mv apps/template/* apps/template/.[!.]* . 2>/dev/null || true",{...h,cwd:t,shell:"/bin/bash"}),await f("rm -rf apps .git",{...h,cwd:t})},ot=async()=>{await V(".env.example",".env.local")},at=async()=>{await q(R("content","docs"),{recursive:!0,force:!0})},it=async()=>{await f("pnpm install",h)},ct=async()=>{await f("git init",h),await f("git add .",h),await f('git commit -m "\u2728 Initial commit"',h)},lt=async()=>{let t=await st({message:"What is your project named?",placeholder:"my-app",validate(e){if(e.length===0)return"Please enter a project name."}});return Z(t)&&(W("Operation cancelled."),process.exit(0)),t.toString()},j=async t=>{try{Y("Let's start a Geistdocs project!");let e=process.cwd(),s=t.name||await lt(),r=et(),a=R(e,s);r.start("Cloning template..."),await rt(s),r.message("Moving into project..."),process.chdir(a),r.message("Setting up environment variables..."),await ot(),r.message("Deleting demo content..."),await at(),r.message("Installing dependencies..."),await it(),t.disableGit||(r.message("Initializing Git repository..."),await ct()),r.stop("Project initialized successfully!"),tt("Run `pnpm dev` to start the development server.")}catch(e){let s=e instanceof Error?e.message:`Failed to initialize project: ${e}`;Q.error(s),process.exit(1)}};import{createHash as pt}from"crypto";import{existsSync as L}from"fs";import{readFile as F,writeFile as U}from"fs/promises";import{dirname as gt,parse as D,resolve as $}from"path";import{intro as dt,isCancel as ft,log as m,outro as T,spinner as mt,text as ut}from"@clack/prompts";import{glob as ht}from"glob";import{Project as wt,SyntaxKind as S}from"ts-morph";var b=10,yt="content/docs/**/*.mdx",C=".translation-cache.json",Tt=/\.[a-z]{2}\.mdx$/,$t=async t=>(await ht(t,{cwd:process.cwd(),absolute:!0,nodir:!0})).filter(s=>s.endsWith(".mdx")).filter(s=>!Tt.test(s)),Pt=t=>{let e=$(process.cwd(),t),a=new wt({skipAddingFilesFromTsConfig:!0}).addSourceFileAtPath(e).getVariableDeclaration("translations");if(!a)throw new Error("Could not find translations export in config file");let i=a.getInitializer();if(!i||i.getKind()!==S.ObjectLiteralExpression)throw new Error("translations must be an object literal");let n=i.asKind(S.ObjectLiteralExpression);if(!n)throw new Error("Could not parse translations object");let l=n.getProperties().filter(p=>p.getKind()===S.PropertyAssignment).map(p=>p.asKind(S.PropertyAssignment)?.getName()).filter(p=>p!==void 0);if(l.length===0)throw new Error("No locales found in translations object");let[c,...o]=l;return o},xt=t=>pt("sha256").update(t).digest("hex"),St=async()=>{let t=$(process.cwd(),C);if(!L(t))return{};try{let e=await F(t,"utf-8");return JSON.parse(e)}catch{return m.warn("Failed to load translation cache, starting fresh"),{}}},N=async t=>{let e=$(process.cwd(),C);await U(e,JSON.stringify(t,null,2),"utf-8")},vt=(t,e,s,r)=>{let a=t[e];if(!a)return!0;let i=a[s];return i?i.hash!==r:!0},bt=async(t,e,s)=>{let r=await F(t,"utf-8"),a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r,locale:e})}),i=await a.text();if(!a.ok){let n=`Translation failed with status ${a.status}`;try{let l=JSON.parse(i);n=l.error||l.message||n}catch{n=i||n}throw new Error(n)}try{return JSON.parse(i).translation}catch{throw new Error(`Failed to parse response: ${i.slice(0,200)}`)}},Ft=async(t,e,s,r,a)=>{let i=gt(t),{name:n,ext:l}=D(t),c=$(i,`${n}.${e}${l}`);await U(c,s,"utf-8"),r[t]||(r[t]={}),r[t][e]={hash:a,translatedAt:new Date().toISOString()},await N(r)},Ct=t=>{try{let e=Pt(t);return m.info(`Loaded ${e.length} locale(s) from config: ${e.join(", ")}`),e}catch(e){m.error(`Failed to load config: ${e instanceof Error?e.message:String(e)}`),T("Translation cancelled"),process.exit(1)}},Et=async()=>{let t=await ut({message:"Enter target locales (comma-separated):",placeholder:"cn,fr,es",validate:e=>{if(!e)return"At least one locale is required"}});return ft(t)&&(T("Translation cancelled"),process.exit(0)),t.split(",").map(e=>e.trim())},It=async t=>{let e=new Map;for(let s of t){let r=await F(s,"utf-8");e.set(s,xt(r))}return e},Rt=(t,e,s,r,a)=>{let i=[],n=0;for(let l of t)for(let c of e){let o=s.get(c);if(!o)throw new Error(`Hash not found for file: ${c}`);a||vt(r,c,l,o)?i.push({filePath:c,locale:l,hash:o}):n+=1}return{tasks:i,skippedCount:n}},jt=async(t,e,s,r)=>{let a=mt(),i=[];a.start("Starting translation...");let n=0;for(let l=0;l<t.length;l++){let c=t[l];a.message(`Processing batch ${l+1}/${t.length} (${c.length} translations) - ${n}/${e} complete`),await Promise.all(c.map(async o=>{let{name:p,ext:u}=D(o.filePath),g=await bt(o.filePath,o.locale,s);await Ft(o.filePath,o.locale,g,r,o.hash),i.push({name:p,locale:o.locale,ext:u}),n+=1})),l<t.length-1&&(a.message(`Batch ${l+1}/${t.length} complete. Pausing...`),await new Promise(o=>setTimeout(o,1e3)))}return a.stop("Translation complete!"),i},O=async(t,e)=>{dt("Translate MDX content");let s=t??yt,r=e.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ct(e.config??"geistdocs.tsx"),i=await $t(s);i.length===0&&(m.error(`No MDX files found matching pattern: ${s}`),T("Translation cancelled"),process.exit(1)),m.info(`Found ${i.length} MDX file(s) matching pattern`),a.length===0&&(a=await Et());let n=$(process.cwd(),C),l=await St();L(n)||await N(l),m.info(`Using cache: ${n}`);let c=await It(i),{tasks:o,skippedCount:p}=Rt(a,i,c,l,e.force);if(o.length===0){m.success("All translations are up to date!"),T(`Skipped ${p} file(s) (unchanged)`);return}let u=[];for(let g=0;g<o.length;g+=b)u.push(o.slice(g,g+b));m.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${b}`),p>0&&m.info(`Skipped ${p} translation(s) (unchanged)`);try{let g=await jt(u,o.length,r,l);for(let{name:B,locale:K,ext:J}of g)m.success(`Saved: ${B}.${K}${J}`);let y=[`Translated ${g.length} file(s)`];p>0&&y.push(`Skipped ${p} unchanged`),T(y.join(" \u2022 "))}catch(g){let y=g instanceof Error?g.message:String(g);m.error(`Translation failed: ${y}`),T("Exiting"),process.exit(1)}};import{access as Lt,copyFile as Ut,mkdir as z,rm as I}from"fs/promises";import{dirname as Dt,join as w}from"path";import{intro as Nt,log as d,outro as A,spinner as Ot}from"@clack/prompts";import{glob as At}from"glob";var _="apps/template",kt=["**/*"],Gt=["content/docs/**"],Mt=async(t,e)=>{let s=w(t,e);await I(s,{recursive:!0,force:!0}),await z(s,{recursive:!0})},zt=async(t,e)=>{await f(`git clone --depth 1 --filter=blob:none --sparse ${v} ${e}`,{cwd:t}),await f("git sparse-checkout set apps/template",{cwd:w(t,e)})},E=async t=>await I(t,{recursive:!0,force:!0}),k=async(t,e,s)=>(await At(t,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...e]})).sort(),_t=async t=>{try{return await Lt(t),!0}catch{return!1}},Ht=async(t,e,s)=>{let r=w(e,_,t),a=w(s,t);return await _t(r)?(await Ut(r,a),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Bt=async(t,e)=>{let s=w(e,t);return await I(s,{force:!0}),{success:!0}},G=20,M=async(t,e,s)=>{let r=[];for(let a=0;a<t.length;a+=s){let i=t.slice(a,a+s),n=await Promise.all(i.map(e));r.push(...n)}return r},Kt=async(t,e,s,r,a)=>{let i={success:[],deleted:[],failed:[]},n=[...new Set(t.map(c=>Dt(w(r,c))))];a.message(`Creating ${n.length} directories...`),await Promise.all(n.map(c=>z(c,{recursive:!0}))),a.message(`Updating ${t.length} files...`);let l=await M(t,async c=>{let o=await Ht(c,s,r);return{file:c,...o}},G);for(let{file:c,success:o,error:p}of l)o?i.success.push(c):i.failed.push({file:c,error:p??"Unknown error"});if(e.length>0){a.message(`Deleting ${e.length} files...`);let c=await M(e,async o=>{try{return await Bt(o,r),{file:o,success:!0}}catch(p){let u=p instanceof Error?p.message:`${p}`;return{file:o,success:!1,error:u}}},G);for(let o of c)o.success?i.deleted.push(o.file):i.failed.push({file:o.file,error:o.error})}return i},Jt=t=>{if(t.success.length>0){d.success(`Successfully updated ${t.success.length} files:`);for(let e of t.success)d.info(` \u2713 ${e}`)}if(t.deleted.length>0){d.success(`Deleted ${t.deleted.length} files:`);for(let e of t.deleted)d.info(` \u{1F5D1} ${e}`)}if(t.failed.length>0){d.warn(`Failed to update ${t.failed.length} files:`);for(let{file:e,error:s}of t.failed)d.error(` \u2717 ${e}: ${s}`)}},H=async(t,e)=>{let s=process.cwd(),r=w(s,x),a=t&&t.length>0?t:kt,i=t&&t.length>0?[]:Gt;try{Nt("Let's update your Geistdocs project!"),d.info(`Repository: ${v}`),t&&t.length>0&&d.info(`Updating specific files: ${t.join(", ")}`),e?.sync&&d.info("Sync mode enabled: will delete files removed from template");let n=Ot();n.start("Creating temporary directory..."),await Mt(s,x),n.message("Cloning repository..."),await zt(s,x),n.message("Scanning for files...");let l=w(r,_),c=await k(a,i,l),o=[];if(e?.sync){n.message("Comparing with local files...");let u=await k(a,i,s),g=new Set(c);o=u.filter(y=>!g.has(y))}if(n.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){d.warn("No files matched the patterns. Nothing to update."),await E(r),A("Update cancelled.");return}d.info(`Patterns: ${a.length}`),d.info(`Files to update: ${c.length}`),e?.sync&&d.info(`Files to delete: ${o.length}`),n.start("Updating files...");let p=await Kt(c,o,r,s,n);n.message("Cleaning up..."),await E(r),n.stop("Update complete!"),Jt(p),A("Please review and test the changes carefully.")}catch(n){let l=n instanceof Error?n.message:`${n}`;try{await E(r)}catch{}d.error(`Failed to update project: ${l}`),process.exit(1)}};P.name("geistdocs").description("CLI for Geistdocs projects").version("1.1.1","-v, --version","Output the current version");P.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(j);P.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(H);P.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(O);P.parse(process.argv);
|
|
File without changes
|