The docmd 0.7.9 release introduces Incremental Rebuilds for near-instant development, the OpenAPI plugin, and major performance optimizations via a Parallel Plugin Architecture. It also resolves critical config file leakage, fixes monorepo git history accuracy, adds contributor avatars, and implements a smart sticky footer.
✨ Highlights
OpenAPI Plugin
The new OpenAPI plugin renders API reference documentation directly from OpenAPI 3.x spec files inside Markdown pages - at build time, with no client-side JavaScript and no third-party UI libraries (no Swagger UI, no Redoc).
Add a spec embed anywhere in your Markdown:
```openapi
./api/openapi.json
```
The plugin reads the spec at build time and outputs static HTML: colour-coded method badges, parameter tables, request/response schema tables, and status code descriptions. It supports both JSON and YAML specs, resolves internal $ref references, and handles oneOf/anyOf union types.
New in 0.7.9: Added a download: true option to provide direct links to the raw spec file in the UI - perfect for AI models (like GPT-4 or Claude) to consume your API documentation programmatically.
docmd add openapi
See the OpenAPI plugin documentation for full details.
Incremental Rebuilds (Instant Dev Mode)
The development server now features a Targeted Rebuild system. Previously, editing a single Markdown file triggered a full site rebuild. For sites with hundreds of pages, this could take 10+ seconds.
In 0.7.9, docmd dev only re-renders the specific file you modified. Page reloads are now instant (<1s), even for massive projects. The system correctly maintains all navigation, versioning, and asset context during these partial updates.
Parallel Plugin Architecture (Multi-Threaded Performance)
The build engine has been overhauled to support parallel plugin execution. Previously, plugin hooks like onBeforeRender ran sequentially for every page. For plugins that perform I/O or spawn child processes (like the Git plugin), this was a significant bottleneck.
In 0.7.9, the engine now processes page rendering in concurrent batches. Combined with the new Asynchronous Git Plugin, which uses non-blocking execFile calls, build times for large sites with hundreds of pages are up to 3x faster.
Key improvements:
- Batched Rendering: Phase 3 of the generator now runs in parallel batches of 64 pages.
- Async Hooks: All plugin hooks can now be
async, and the engine correctly awaits them in parallel. - Git Plugin Overhaul: Replaced synchronous
execSyncwith asynchronous, non-blocking process spawning.
📝 Complete Changelog
Bug Fixes
Git Plugin - Per-file commit history in multi-project builds: Module-level singleton state (
_gitRootPath) was set once from whichever project docmd processed first, and reused for all subsequent projects. This caused pages in project 2+ to query git history against the wrong repository root, returning empty or mismatched results. The fix resolves the git root per file directory using a per-directory cache, so each file always queries its own repository context - safe for monorepos and multi-project setups.Git Plugin - SPA hydration: The git widget was re-hydrating timestamps on
docmd.afterReload()(dev-server only). In SPA mode, navigating between pages left timestamps un-formatted. Fixed to listen ondocmd:page-mountedinstead, which fires after every SPA page swap.
Features
OpenAPI Plugin (
@docmd/plugin-openapi): Build-time OpenAPI 3.x spec renderer. Outputs static HTML endpoint docs from JSON or YAML spec files. No client-side dependencies.Plugin API -
onBeforeRenderhook: New lifecycle hook called before template rendering. Receives fullPageContextincludingsourcePath. Mutations tofrontmatterandhtmlare reflected in the rendered output.Plugin API -
PageContexttype: Formally typed and exported from@docmd/api. IncludessourcePath,frontmatter,html,localeId,versionId, andrelativePathToRoot.Git Plugin - Contributor Avatars: Commit history tooltip now shows Gravatar images (MD5-hashed email,
?d=mpfallback) instead of initials.Git Plugin - Configurable Date Formats: New
dateFormatoption:relative(default),iso, orlocale-aware.plugins: { git: { dateFormat: 'locale-aware' } }Parallel Build Pipeline: The generator now parallelises the template rendering phase. Plugins can now perform expensive operations (like Git calls or OpenAPI parsing) concurrently across multiple CPU cores via child processes.
Asynchronous Git Plugin: The Git plugin is now fully asynchronous. It uses non-blocking child processes and path normalization to ensure high performance and accuracy even in complex monorepo structures.
Incremental Rebuild System: The dev server now performs targeted partial builds. Editing a file re-renders only that file, reducing reload times from 10s+ to under 300ms for large sites.
OpenAPI Plugin - Download Spec: New
downloadoption provides a link to the raw JSON/YAML spec in the page header for AI accessibility.UI - Smart Sticky Footer: Footer is now always pinned to the bottom of the viewport using flex layout, even on pages with minimal content. (Fixed).
Internal
Edit Link Path Resolution: Computed from the git repository root, not
config.srcorprocess.cwd(). Correct in all project layouts.Config Loader - Hardening: Implemented mandatory cleanup for orphaned temporary config files (
docmd.config-*.js) and addedtry-finallysafety to prevent leakage during syntax errors.