Skip to content

feat: handle mermaid in documentation#61

Merged
this-is-tobi merged 1 commit intomainfrom
develop
Mar 16, 2026
Merged

feat: handle mermaid in documentation#61
this-is-tobi merged 1 commit intomainfrom
develop

Conversation

@this-is-tobi
Copy link
Copy Markdown
Owner

Description

Add support for Mermaid diagrams in built documentation by integrating vitepress-plugin-mermaid.

The withMermaid() wrapper was previously applied during config generation, causing its Vite plugin and markdown-it extensions (which are functions) to be silently dropped by JSON.stringify. The fix moves the withMermaid() call into the generated .vitepress/config.ts so it is evaluated at VitePress runtime, making Mermaid diagrams fully functional in built docs.

Additionally, pre-existing type errors in the test suite were fixed: readdirSync mocks were casting to Dirent<Buffer<ArrayBufferLike>>[], which is incompatible with newer @types/node where the type is Dirent<NonSharedBuffer>[]. All casts were replaced with as any.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

The full test suite (214 tests across 14 files) passes locally. TypeScript compilation (tsc) and Vite build both succeed without errors or warnings.

Test Configuration:

  • Node.js: >=20
  • Package manager: pnpm@10.32.0
  • Toolchain: vitest@4.0.18, typescript@5.9.3, vite@7.3.1

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hey !

The security scan report for the current pull request is available here.

@this-is-tobi this-is-tobi merged commit 981c0e4 into main Mar 16, 2026
16 checks passed
@this-is-tobi this-is-tobi deleted the develop branch March 16, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant