@mermanjs/node-wasm 0.10.0-alpha.1 → 0.10.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/CHANGELOG.md +54 -2
- package/README.md +28 -15
- package/THIRD_PARTY_LICENSES/d3-path/LICENSE +13 -0
- package/THIRD_PARTY_LICENSES/eclipse-elk/LICENSE.md +1 -2
- package/THIRD_PARTY_LICENSES/elkjs/LICENSE.md +1 -2
- package/THIRD_PARTY_LICENSES/rust-cargo-dependencies.json +91 -162
- package/THIRD_PARTY_NOTICES.md +57 -39
- package/artifact/merman_node.cjs +53 -44
- package/artifact/merman_node_bg.wasm +0 -0
- package/dist/engine.mjs +50 -137
- package/dist/errors.mjs +52 -20
- package/dist/generated/binding-contract.mjs +8 -1
- package/dist/index.d.ts +127 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the `@mermanjs/node` package group will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.10.0] - 2026-11-12
|
|
6
|
+
|
|
7
|
+
Cumulative changes since the latest stable Node package group, `0.9.3`. The package remains experimental; see the [stable upgrade guide](../../docs/release/V093_TO_V0100_UPGRADE_GUIDE.md) for the complete migration.
|
|
8
|
+
|
|
9
|
+
| Upgrading from | Next step |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `0.9.3` | Apply the breaking changes below and refresh SVG snapshots. |
|
|
12
|
+
| `0.10.0-alpha.1` or `alpha.2` | Review the guide's remaining contract and theme-catalog changes. |
|
|
13
|
+
|
|
14
|
+
### Breaking changes
|
|
15
|
+
|
|
16
|
+
- Keep the nine-package group on one exact release: `@mermanjs/node`, its seven native platform packages, and explicit `@mermanjs/node-wasm`. Custom facades and native/WASM artifacts must come from the same source revision. Node binding API remains `1`; browser Web packages are a separate product.
|
|
17
|
+
- Migrate Options JSON from schema `2` to `3`: replace `presentation` styling with top-level `theme` and remove retired presentation-profile and host-owned CSS/security fields. Replace `metadataJson("presentation-catalog")` with `metadataJson("theme-catalog")`.
|
|
18
|
+
- Update custom render-metadata decoders for `theme_execution_evidence.version: 2` and required nullable `materialized_theme`. Keep unknown evidence versions opaque and inspect output-target admission separately from theme application. [#277](https://github.com/Latias94/merman/pull/277)
|
|
19
|
+
- Handle formula rejection under `constrained`, or choose `interactive` or an appropriate trusted policy with host execution and memory limits. Installing a math-capable transport does not relax resource admission.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Apply optional themes from 11 design groups with 14 concrete presets, including `paper-cut`, `carbon-copy`, and `pop-art`, or import editable JSON. Core colors and fonts reach all 34 diagram families, respecting source-owned styles and the typography used to measure labels. Presets retain alpha maturity; effects and output support depend on the family, shape, look, and target. See the [theme guide](../../docs/rendering/custom-diagram-themes.md) and [coverage limits](../../docs/rendering/diagram-theme-coverage.md). [#178](https://github.com/Latias94/merman/pull/178), [#277](https://github.com/Latias94/merman/pull/277), [#299](https://github.com/Latias94/merman/pull/299)
|
|
24
|
+
- Keep light and dark appearances in one schema-1 recipe. Editor, Gruvbox, and Ayu are paired designs; catalog consumers read `appearances` and each `concrete_preset_id`. Export the complete recipe with `export-theme-preset-json`, inspect or materialize it with `materialize-theme-json`, and resolve Follow-app policy to a declared appearance in the host. Whole-recipe validation includes inactive appearances. [#284](https://github.com/Latias94/merman/pull/284)
|
|
25
|
+
- Use native GNU or musl Linux ARM64 alongside the existing targets; GNU Linux requires glibc `2.31+`. Both native Node and explicit Node-WASM include SVG math, Cytoscape, and ELK. Binary export, analysis, ASCII, and text-measurement callbacks remain outside this SVG product. See the [package guide](README.md). [#265](https://github.com/Latias94/merman/pull/265), [#266](https://github.com/Latias94/merman/pull/266)
|
|
26
|
+
|
|
27
|
+
### Changed and fixed
|
|
28
|
+
|
|
29
|
+
- Refine Cyberpunk with clear neutral text and restrained neon contours, and Ghibli with warm paper, sage surfaces and independent chart inks. Both add dedicated Flowchart, Sequence and XY Chart styling while retaining editable recipe export. [#302](https://github.com/Latias94/merman/pull/302)
|
|
30
|
+
- Advance from Mermaid `12.1.0` to `12.3.0`, including timed Flowchart Step edges, numbered badges, nine `bpmn-*` shapes, and updated Swimlane and Usecase behavior. Static SVG retains Step edges and badges without browser animation. Review snapshots for ELK `0.12.1` routing, label clearance, containers, and packing; see the [Mermaid migration](../../docs/migrations/mermaid-12-3.md). [#277](https://github.com/Latias94/merman/pull/277)
|
|
31
|
+
- Correct Class, Sequence, and State source handling and label geometry, including rich Class relationship labels and Sequence frames. Review affected SVG snapshots. [#282](https://github.com/Latias94/merman/pull/282), [#286](https://github.com/Latias94/merman/pull/286), [#294](https://github.com/Latias94/merman/pull/294), [#297](https://github.com/Latias94/merman/pull/297)
|
|
32
|
+
- Enforce JSON byte, member, token, and string limits consistently in native and Node-WASM engine construction, including defaults and shared values, without mutating caller input or invoking getters or `toJSON`. [#277](https://github.com/Latias94/merman/pull/277)
|
|
33
|
+
|
|
34
|
+
## [0.10.0-alpha.2] - 2026-11-06
|
|
35
|
+
|
|
36
|
+
Changes since `0.10.0-alpha.1`. See the [host installation guide](../../docs/release/PREBUILT_PRODUCTS.md) for independently verified package availability.
|
|
37
|
+
|
|
38
|
+
### Breaking changes
|
|
39
|
+
|
|
40
|
+
- Upgrade the loader and selected native or Node-targeted WASM package together to the same exact version. Custom builds must pair their JavaScript facade and native/WASM artifact from the same source revision; browser `@mermanjs/web` packages are not Node transport substitutes.
|
|
41
|
+
- Custom render-metadata decoders must handle `theme_execution_evidence.version: 2` and its required nullable `materialized_theme`, which records the Mermaid palette actually used by the render. Keep unknown evidence versions opaque and inspect target admission separately from successful theme application. Options JSON remains schema `3`; see the [contract migration](../../docs/release/UNRELEASED_CONTRACT_VERSIONS.md#source-appearance-and-render-evidence-follow-up). [#277](https://github.com/Latias94/merman/pull/277)
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- Advance Mermaid compatibility from `12.2.0` to `12.3.0`, adding timed Flowchart Step edges and numbered badges, nine `bpmn-*` Flowchart shapes, updated Swimlane behavior and Usecase Include/Extend labels. Step animation is browser-only; static output keeps ordinary edges and badges. ELK follows the selected `0.12.1` behavior for label clearance, compound containers, self-loops and packing, so review SVG/layout snapshots after upgrading. See the [Mermaid migration guide](../../docs/migrations/mermaid-12-3.md). [#277](https://github.com/Latias94/merman/pull/277)
|
|
46
|
+
- Core theme colors and typography reach all 34 diagram families in the complete SVG product, including supported paint on BPMN event rings and annotation brackets. Shadows, glows and other effects retain their family, shape and look restrictions; successful rendering does not certify output portability. See the [theme coverage guide](../../docs/rendering/diagram-theme-coverage.md). [#277](https://github.com/Latias94/merman/pull/277), [#278](https://github.com/Latias94/merman/pull/278)
|
|
47
|
+
- Reuse 15 editable designs from the [theme design gallery](../../CHANGELOG.md#theme-design-gallery), with dedicated Flowchart, Sequence, Class, XY Chart and Pie examples. These are independent JSON recipes, not additions to the 11 built-in presets. Pass a downloaded recipe as the `theme` value in [Options JSON](../../docs/bindings/OPTIONS_JSON.md#diagram-theme); fonts and other diagram/output combinations need their own review. [#279](https://github.com/Latias94/merman/pull/279)
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- Apply JSON byte, member, token and string limits consistently when constructing native and Node WASM engines, including inserted defaults and repeated shared values, without mutating caller input or executing getters and `toJSON` hooks. [#277](https://github.com/Latias94/merman/pull/277)
|
|
52
|
+
- Preserve Flowchart source-class precedence over theme colors and fonts, and use supported source font sizes during label measurement. [#278](https://github.com/Latias94/merman/pull/278)
|
|
53
|
+
- Avoid false strict-theme rejections when resetting supported Pie text styles or Architecture group colors to their defaults. [#278](https://github.com/Latias94/merman/pull/278)
|
|
54
|
+
- Preserve supported inline font sizes, weights and code fonts during HTML-to-SVG conversion; retain Railroad, Cynefin and Wardley label text, and emit valid SVG for State labels with HTML line breaks. [#277](https://github.com/Latias94/merman/pull/277), [#278](https://github.com/Latias94/merman/pull/278)
|
|
55
|
+
- Render Brutalist shadows on supported Classic and Neo Flowchart shapes and match Usecase arrowheads to connector colors. Explicit Sequence theme backgrounds now contain the full lifeline when bottom participants are hidden. [#278](https://github.com/Latias94/merman/pull/278), [#279](https://github.com/Latias94/merman/pull/279)
|
|
56
|
+
|
|
5
57
|
## [0.10.0-alpha.1] - 2026-11-02
|
|
6
58
|
|
|
7
|
-
|
|
59
|
+
Changes below are relative to `0.9.3`. Install the exact prerelease with `npm install --save-exact @mermanjs/node@0.10.0-alpha.1`, or explicitly select `@mermanjs/node-wasm@0.10.0-alpha.1`; see the [host installation guide](../../docs/release/PREBUILT_PRODUCTS.md).
|
|
8
60
|
|
|
9
61
|
### Breaking changes
|
|
10
62
|
|
|
@@ -21,7 +73,7 @@ For users upgrading from the published `0.9.2` package group, this release also
|
|
|
21
73
|
|
|
22
74
|
## [0.9.3] - 2026-10-30
|
|
23
75
|
|
|
24
|
-
These
|
|
76
|
+
These fixes are included in the published `0.9.3` npm package group.
|
|
25
77
|
|
|
26
78
|
- Use loaded Iconify packs with `createNodeEngine({ iconPacks })`; icons are scoped to that engine. [#247](https://github.com/Latias94/merman/pull/247)
|
|
27
79
|
- Fix clipped labels, font sizing, literal text, and HTML/entity handling, including wrapped Swimlane edge labels and valid Class-note XML. [#245](https://github.com/Latias94/merman/pull/245), [#247](https://github.com/Latias94/merman/pull/247), [#250](https://github.com/Latias94/merman/pull/250)
|
package/README.md
CHANGED
|
@@ -4,15 +4,14 @@ Explicit Node-targeted WebAssembly rendering for Node.js 22+ and static-site bui
|
|
|
4
4
|
This is a separate opt-in package; `@mermanjs/node` remains the native N-API package and never
|
|
5
5
|
silently falls back to browser or Node WASM.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
and [
|
|
10
|
-
for verified public availability.
|
|
7
|
+
Version `0.10.0` targets Mermaid `12.3.0` and uses Node binding API `1`, Options JSON schema `3`, and theme execution evidence schema `2`. Keep the facade, generated glue, and WASM at the same exact version and source revision. Check the [host installation guide](https://github.com/Latias94/merman/blob/main/docs/release/PREBUILT_PRODUCTS.md#published-versions) for verified versions and channel availability, and the [stable upgrade guide](https://github.com/Latias94/merman/blob/main/docs/release/V093_TO_V0100_UPGRADE_GUIDE.md) for migration. The package remains experimental.
|
|
8
|
+
|
|
9
|
+
Version `0.10.0-alpha.1` retains Mermaid `12.2.0` and theme execution evidence schema `1`; Node binding API `1` and Options JSON schema `3` are unchanged. Upgrade all package assets together and update evidence consumers for the [render-evidence changes](https://github.com/Latias94/merman/blob/main/docs/release/UNRELEASED_CONTRACT_VERSIONS.md#source-appearance-and-render-evidence-follow-up).
|
|
11
10
|
|
|
12
11
|
## Quick start
|
|
13
12
|
|
|
14
13
|
```sh
|
|
15
|
-
npm install --save-exact @mermanjs/node-wasm@0.10.0
|
|
14
|
+
npm install --save-exact @mermanjs/node-wasm@0.10.0
|
|
16
15
|
```
|
|
17
16
|
|
|
18
17
|
```js
|
|
@@ -63,27 +62,41 @@ Node.js 22.0.0 is the minimum runtime.
|
|
|
63
62
|
|
|
64
63
|
## Compiled themes
|
|
65
64
|
|
|
65
|
+
The catalog groups 11 designs with 14 concrete presets, including `paper-cut`, `carbon-copy`, and
|
|
66
|
+
`pop-art`. Editor, Gruvbox, and Ayu provide both Light and Dark; other designs declare their own modes.
|
|
67
|
+
|
|
66
68
|
Select a preset through the top-level `theme` group in Options JSON schema `3`. Discover preset
|
|
67
69
|
IDs through the initialized engine's theme catalog:
|
|
68
70
|
|
|
69
71
|
```js
|
|
70
72
|
const catalog = JSON.parse(engine.metadataJson("theme-catalog"));
|
|
71
73
|
const themedSvg = await engine.renderSvg("flowchart LR\nA --> B", {
|
|
72
|
-
optionsJson: JSON.stringify({ version: 3, theme: { preset: "
|
|
74
|
+
optionsJson: JSON.stringify({ version: 3, theme: { preset: "editor", appearance: "dark" } }),
|
|
73
75
|
});
|
|
74
76
|
```
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
The catalog groups one design's `supported_appearances`, `default_appearance`, and appearance-specific
|
|
79
|
+
discovery details. `available` means that every declared appearance can compile under the current
|
|
80
|
+
resource policy. All built-in presets remain `alpha` with empty appearance-specific `qualified_cells`; availability and unknown
|
|
81
|
+
profile/admission IDs never establish portable output. Flowchart glow and shadow effects support
|
|
82
|
+
documented shapes in Classic and Neo; other families retain their own look and output restrictions.
|
|
83
|
+
SVG fonts resolve on the viewing host; exported recipes
|
|
80
84
|
do not embed them.
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
`
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`
|
|
86
|
+
`engine.exportThemePreset("editor")` returns a complete editable V1 recipe with
|
|
87
|
+
`design.appearances` and `design.default_appearance`. Serialize it with `JSON.stringify(recipe, null, 2)`,
|
|
88
|
+
save and edit the JSON, then reload it with `JSON.parse(...)`, retaining `schema_version`, `kind`,
|
|
89
|
+
and the complete `design`. Pass that recipe with a concrete appearance
|
|
90
|
+
through `theme: { recipe, appearance: "dark" }`; omitted appearance uses its declared default.
|
|
91
|
+
`engine.materializeTheme({ schema_version: 1, action: "inspect", recipe })` validates all modes,
|
|
92
|
+
while `action: "materialize"` with an optional `appearance` returns a concrete specification.
|
|
93
|
+
Keep the authored recipe when saving or sharing a theme. Resolve Follow-app/editor in the host.
|
|
94
|
+
|
|
95
|
+
Both transports share the same async authoring helpers, generic `executeOperation()` and synchronous
|
|
96
|
+
`executeOperationSync()` routes. The original `materialize-theme-json`,
|
|
97
|
+
`describe-theme-support-json`, and `export-theme-preset-json` operation IDs remain unchanged.
|
|
98
|
+
See the [native package examples](https://github.com/Latias94/merman/blob/main/platforms/node/packages/node/README.md#compiled-themes)
|
|
99
|
+
and the
|
|
87
100
|
[theme guide](https://github.com/Latias94/merman/blob/main/docs/rendering/custom-diagram-themes.md)
|
|
88
101
|
for authoring and portability, and the
|
|
89
102
|
[current Node changelog](https://github.com/Latias94/merman/blob/main/platforms/node/CHANGELOG.md)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2015-2026 Mike Bostock
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
4
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
5
|
+
and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
9
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
11
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
12
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
13
|
+
THIS SOFTWARE.
|
|
@@ -250,8 +250,7 @@ No third-party beneficiary rights are created under this Agreement.
|
|
|
250
250
|
|
|
251
251
|
“This Source Code may also be made available under the following
|
|
252
252
|
Secondary Licenses when the conditions for such availability set forth
|
|
253
|
-
in the Eclipse Public License, v. 2.0 are satisfied:
|
|
254
|
-
version(s), and exceptions or additional permissions here}.”
|
|
253
|
+
in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License v3.0 or later.”
|
|
255
254
|
|
|
256
255
|
> Simply including a copy of this Agreement, including this Exhibit A is
|
|
257
256
|
> not sufficient to license the Source Code under Secondary Licenses.
|
|
@@ -250,8 +250,7 @@ No third-party beneficiary rights are created under this Agreement.
|
|
|
250
250
|
|
|
251
251
|
“This Source Code may also be made available under the following
|
|
252
252
|
Secondary Licenses when the conditions for such availability set forth
|
|
253
|
-
in the Eclipse Public License, v. 2.0 are satisfied:
|
|
254
|
-
version(s), and exceptions or additional permissions here}.”
|
|
253
|
+
in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License v3.0 or later”
|
|
255
254
|
|
|
256
255
|
> Simply including a copy of this Agreement, including this Exhibit A is
|
|
257
256
|
> not sufficient to license the Source Code under Secondary Licenses.
|