Skip to content

Commit bd2d465

Browse files
branchseerclaude
andcommitted
docs: add mermaid diagram support
Add vitepress-plugin-mermaid for rendering mermaid diagrams in docs. Alias dayjs to its ESM build to fix CJS default export errors with VitePress 2.0. Replace ASCII diagram in run.md with a mermaid graph. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 708734d commit bd2d465

5 files changed

Lines changed: 978 additions & 67 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { resolve } from 'node:path';
33
import type { VoidZeroThemeConfig } from '@voidzero-dev/vitepress-theme';
44
import { extendConfig } from '@voidzero-dev/vitepress-theme/config';
55
import { defineConfig, type HeadConfig } from 'vitepress';
6+
import { withMermaid } from 'vitepress-plugin-mermaid';
67

78
const taskRunnerGuideItems = [
89
{
@@ -76,7 +77,7 @@ const guideSidebar = [
7677
];
7778

7879
export default extendConfig(
79-
defineConfig({
80+
withMermaid(defineConfig({
8081
title: 'Vite+',
8182
titleTemplate: ':title | The Unified Toolchain for the Web',
8283
description: 'The Unified Toolchain for the Web',
@@ -109,10 +110,13 @@ export default extendConfig(
109110
vite: {
110111
resolve: {
111112
tsconfigPaths: true,
112-
alias: {
113-
'@local-assets': resolve(__dirname, 'theme/assets'),
114-
'@layouts': resolve(__dirname, 'theme/layouts'),
115-
},
113+
alias: [
114+
{ find: '@local-assets', replacement: resolve(__dirname, 'theme/assets') },
115+
{ find: '@layouts', replacement: resolve(__dirname, 'theme/layouts') },
116+
// dayjs ships CJS by default; redirect to its ESM build so
117+
// mermaid (imported via vitepress-plugin-mermaid) works in dev
118+
{ find: /^dayjs$/, replacement: 'dayjs/esm' },
119+
],
116120
},
117121
},
118122
themeConfig: {
@@ -207,5 +211,5 @@ export default extendConfig(
207211

208212
return [...ogInfo, canonicalUrlEntry];
209213
},
210-
}),
214+
})),
211215
);

docs/guide/run.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,9 @@ When a command contains `vp run`, Vite Task inlines it as separate tasks instead
225225

226226
Running `vp run ci` expands into three tasks:
227227

228-
```
229-
┌────────┐ ┌────────┐ ┌────────┐
230-
│ lint │──▶│ test │──▶│ build │
231-
└────────┘ └────────┘ └────────┘
228+
```mermaid
229+
graph LR
230+
lint --> test --> build
232231
```
233232

234233
Flags also work inside nested scripts. For example, `vp run -r build` inside a script expands into individual build tasks for every package.

docs/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
},
1010
"dependencies": {
1111
"@iconify/vue": "^5.0.0",
12+
"mermaid": "^11.13.0",
1213
"reka-ui": "^2.7.0",
1314
"typewriter-effect": "^2.22.0",
15+
"vitepress-plugin-mermaid": "^2.0.17",
1416
"vue": "^3.5.27",
1517
"vue3-carousel": "^0.16.0"
1618
},

0 commit comments

Comments
 (0)