All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bump required Node.JS version to 18.19
- Updated
@mermaid-js/mermaid-cli
to^11
- Updated
puppeteer
to^23
- Updated
unist-util-visit
to^5
- Updated
vfile
to^6
- Fix missing
"types"
field inpackage.json
. Types should now be correctly exported.
-
Add TypeScript types to
remark-mermaid-dataurl
-
Use Mermaid titles/descriptions for the output markdown image's title/alt-text, e.g. like:
![Mermaid diagram description](data:image/svg+xml;charset=UTF-8,%3Csvg%20id%3D%22mermaid-1654... "Mermaid diagram title")
See https://mermaid.js.org/config/accessibility.html for how to add titles and descriptions to your Mermaid diagrams.
- Add
@types/mdast
andvfile
as dependencies. We only use these for their types. - Updated
@mermaid-js/mermaid-cli
from^10.0.0
to^10.0.2
to use the types added by that release.
- Fix minimum support Node versions to
^14.13 || >=16.0
. This was always the case, due to a transitive dependency viamermaid-cli
onchalk
. See mermaid-js/mermaid-cli@57781f7
.
-
Updated
@mermaid-js/mermaid-cli
from^9.1.6
to^10.0.0
, see mermaid-js/[email protected] release notes and [email protected] release notes.It looks like the main breaking changes are to do with Mermaid's API, but there are no breaking changes to
mermaid-cli
, or this package.
-
Fix undefined SVG
svgjs
namespace error Sometimes, the generated SVGs are invalid due to an unknownsvgjs
prefix error (this happens withmermaid-mindmaps
), see svgdotjs/svg.js#1285.This work-around manually defines the XML
svgjs
namespace by addingxmlns:svgjs
to the<svg ...>
element until the upstream issue/bug is fixed.
- Updated puppeteer from
^18.0.4
to^19.0.0
- Set mermaid config option
useMaxWidth
tofalse
by default. In Mermaid v9.1.7, some graph types default to using all the available horizontal space. On many markdown renderers, this creates very large diagrams, so by defaultremark-mermaid-dataurl
limits them to use a smaller amount of space (e.g. pre-v9.1.7 behaviour). - Fix passing
configFile
as a JS object.
- Share a single puppeteer browser instance for all mermaid images.
9bccb09
- Updated puppeteer from
^16.0.0
to^18.0.4
- Fixed some
mermaidCli
options being ignored in v2.0.2
- Updated
unist-util-visit
from^2.0.3
to^4.0.0
- Fixed support for mermaid-cli
^9.1.6
- Updated
mermaid-cli
version to^9.1.6
- This increases the minimum version of
mermaid
to^9.1.6
, see https://github.com/mermaid-js/mermaid/releases/tag/9.1.6
- This increases the minimum version of
- Removed unneeded dependency on
memfs
- Added dependency on puppeteer
^16.0.0
- puppeteer was previously a transitive dependency from
mermaid-cli
- puppeteer was previously a transitive dependency from
- Fixed error handling for mermaid-cli
^9.1.4
.
- Updated
mermaid-cli
version to^9.1.4
- This increases the minimum version of
mermaid
to^9.1.3
, see https://github.com/mermaid-js/mermaid/releases/tag/9.1.3
- This increases the minimum version of
- NodeJS 14.1 is the minimum supported version
- The minimum version of
mermaid-cli
has been bumped to^9.1.2
. This has caused the following BREAKING CHANGES:mermaid
is now version^9.0.0
- Full CHANGELOG
- BREAKING CHANGE:
gitGraph
's have been reinvented- The main branch is now called
main
, notmaster
. - Plus numerous other `gitgraph changes, please see mermaid release notes.
- The main branch is now called
puppeteer
is now version^14.1.0
- BREAKING CHANGE: NodeJS 14 is the minimum supported version now.
- Updated
mermaid-cli
version to^9.1.2
-
Tries to automatically fix invalid SVGs returned by
mermaid-cli
. Somtimesmermaid-cli
returns an SVG wrapped in a<div>
, which caused a confusing error to occur. -
Allow
@mermaid-js/mermaid-cli
version to be^8.10.1
(fixes `#20)In
v1.10
, we limited@mermaid-js/mermaid-cli
to be <=8.10.1, as 8.10.2 officially dropped Node v10 support. However, this causes breaking changes for people using mermaid 8.10.2+ features.
-
Node v10 support is officially dropped in mermaid-cli 8.10.2, but unofficially, it stills seems to work.
Our
dependencies
contain"@mermaid-js/mermaid-cli": ^8.9.2"
, however v8.10.2 of mermaid-cli updated to puppeteer v10.0.0, which officially dropped Node v10 support. However, it still seems to work with Node v10, it's just unsupported.If you encounter issues while running on Node v10, please pin
remark-mermaid-dataurl
to1.1.0
.
- Allow passing in a mermaid
configFile
as an object tomermaid-cli
. - Allow passing in a puppeteer
puppeteerConfigFile
as an object tomermaid-cli
. This allows increasing puppeteer's timeout, or usingfirefox
instead ofchrome
.
- Fix wide SVGs (e.g. gitgraphs) being cut at 300px.
Automatically replaces SVG
width=100%
to the width in pixels. Most browsers will cut SVGs to 300px. (closes #7) - An error is now thrown if mermaid-cli fails to render an SVG.
Previously, the
Promise
returned byrenderMermaidFile
would stall forever ifmermaid-cli
exited without an error code, and without rendering an SVG.
- Updated
husky
to v6.0.0 (v7.0.0 held back due to Node v10 support) - Limit
mermaid-cli
version to<=8.10.1
. This is because mermaid-cli 8.10.2 upgrades to puppeteer v10.0.0, which drops Node v10 support.
- Remove dependency on the temp directory, by using
memfs
instead #6. This should improve usage on platforms such as Docker/Vercel.
- Support versions of Node above 10 #4