zombie-mermaid 2.2.6 → 3.1.0
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/README.md +24 -5
- package/dist/cli.js +336 -862
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -83
- package/dist/index.d.ts +10 -83
- package/dist/index.js +132 -238
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
- package/src/__tests__/ascii-package-boundary.test.ts +9 -5
- package/src/__tests__/integration.test.ts +27 -0
- package/src/__tests__/interactivity-config.test.ts +8 -5
- package/src/__tests__/nested-subgraph-edge-container-offset.test.ts +151 -0
- package/src/__tests__/workspace-package-boundaries.test.ts +28 -6
- package/src/index.ts +12 -215
- package/src/diagram-registry.ts +0 -340
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Ultra-fast, fully themeable, zero DOM dependencies. A maintained fork of [`beaut
|
|
|
18
18
|
[](https://github.com/dfadler/zombie-mermaid/actions/workflows/ci.yml)
|
|
19
19
|
[](https://codecov.io/gh/dfadler/zombie-mermaid)
|
|
20
20
|
[](#bundle-size)
|
|
21
|
-
[](https://socket.dev/npm/package/zombie-mermaid)
|
|
22
22
|
[](LICENSE)
|
|
23
23
|
|
|
24
24
|
</div>
|
|
@@ -47,9 +47,12 @@ Diagrams are essential for AI-assisted programming. When you're working with an
|
|
|
47
47
|
### Bundle Size
|
|
48
48
|
|
|
49
49
|
The **Bundle Size** badge above tracks the gzipped size of `zombie-mermaid`'s
|
|
50
|
-
main entry point (`dist/index.js`)
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
main entry point (`dist/index.js`) together with the `@zombie-mermaid/*`
|
|
51
|
+
workspace packages it imports (third-party dependencies such as ELK.js are not
|
|
52
|
+
counted), and updates automatically with every release — the same
|
|
53
|
+
badge/CI-tracked pattern already backing the coverage and CI status badges.
|
|
54
|
+
The standalone renderer packages under [Packages](#packages) get the same
|
|
55
|
+
measurement for their own dependency closure. Need ASCII rendering only? `import { renderMermaidASCII }
|
|
53
56
|
from 'zombie-mermaid/ascii'` skips [ELK.js](https://github.com/kieler/elkjs),
|
|
54
57
|
the layout engine the SVG renderer depends on, for a substantially smaller
|
|
55
58
|
bundle.
|
|
@@ -77,6 +80,8 @@ bun add zombie-mermaid
|
|
|
77
80
|
pnpm add zombie-mermaid
|
|
78
81
|
```
|
|
79
82
|
|
|
83
|
+
Only need one output format? `@zombie-mermaid/ascii-renderer` and `@zombie-mermaid/svg-renderer` are published standalone — see [Packages](#packages) below.
|
|
84
|
+
|
|
80
85
|
## Quick Start
|
|
81
86
|
|
|
82
87
|
### SVG Output
|
|
@@ -163,7 +168,7 @@ hyperlinks — off by default, since terminal and pager support varies (see
|
|
|
163
168
|
|
|
164
169
|
> 🧪 **Experimental — shipped to gauge interest, not a finished or best-effort implementation.** This is a first cut covering the common case; the tool surface may change based on feedback. Try it and [open an issue](https://github.com/dfadler/zombie-mermaid/issues/new) with what you'd want from it.
|
|
165
170
|
|
|
166
|
-
`zombie-mermaid mcp` starts a [Model Context Protocol](https://modelcontextprotocol.io/) server on stdio, exposing the library's rendering as
|
|
171
|
+
`zombie-mermaid mcp` starts a [Model Context Protocol](https://modelcontextprotocol.io/) server on stdio, exposing the library's rendering as six tools: `render_mermaid_svg`, `render_mermaid_ascii`, `check_mermaid_sequence_activations`, `fix_mermaid_sequence_activations`, `list_themes`, and `list_diagram_types`. `render_mermaid_svg` also takes optional `bg`/`fg` hex color overrides (applied on top of `theme`) and an optional `outputPath` that writes the SVG to disk and returns `{ saved, size }` instead of the SVG text. `outputPath` must end in `.svg` and resolve inside the server's working directory (the directory your MCP client launched it from); its parent directory must already exist, symlinks and non-regular files are refused, and an existing `.svg` file at that path is overwritten. Point an MCP client (Claude Desktop, Claude Code, or anything else that speaks MCP) at it to render Mermaid diagrams directly in a conversation, without shelling out to the CLI or importing the library.
|
|
167
172
|
|
|
168
173
|
Example Claude Desktop / Claude Code MCP server config:
|
|
169
174
|
|
|
@@ -212,6 +217,20 @@ the package.
|
|
|
212
217
|
|
|
213
218
|
---
|
|
214
219
|
|
|
220
|
+
## Packages
|
|
221
|
+
|
|
222
|
+
This repo is a pnpm-workspace monorepo. Most consumers only need the umbrella `zombie-mermaid` package above; internally it's built from workspace packages under `packages/`, all published under the `@zombie-mermaid` npm scope and version-locked with it:
|
|
223
|
+
|
|
224
|
+
- **[`@zombie-mermaid/ascii-renderer`](packages/ascii-renderer)** — the ASCII/Unicode renderer, published standalone for anyone who wants terminal output without `svg-renderer`'s `elkjs` dependency. The exact code `zombie-mermaid/ascii` re-exports.
|
|
225
|
+
[](https://www.npmjs.com/package/@zombie-mermaid/ascii-renderer) [](#bundle-size)
|
|
226
|
+
- **[`@zombie-mermaid/svg-renderer`](packages/svg-renderer)** — the ELK.js-backed SVG layout and rendering engine, also published standalone.
|
|
227
|
+
[](https://www.npmjs.com/package/@zombie-mermaid/svg-renderer) [](#bundle-size)
|
|
228
|
+
- `@zombie-mermaid/core`, `@zombie-mermaid/mermaid-parser`, `@zombie-mermaid/mcp` — shared types/theming, the diagram parsers, and the MCP server implementation, respectively. Published under the scope (so the names can't be squatted) and version-locked with the rest, but internal-only: no standalone support commitment beyond backing the umbrella and the two renderer packages above.
|
|
229
|
+
|
|
230
|
+
See [docs/decisions/monorepo-conversion.md](docs/decisions/monorepo-conversion.md) for the full package-split and publish-strategy history.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
215
234
|
## Docs
|
|
216
235
|
|
|
217
236
|
- [Guides](docs/guides/) — task-oriented walkthroughs: [browsing the samples](docs/guides/samples.md), [choosing a theme](docs/guides/theming.md), [using the HTML viewer](docs/guides/html-viewer.md)
|