* develop: (43 commits)
rename plugin variable into info in infoDetector.ts
remove cypress/platform/index.html
update pnpm-lock.yaml
indent info.html files
update pnpm-lock.yaml
remove empty options in cypress info.spec.ts
format and add theme to cypress info.html
convert the cypress info.spec.js into ts
add messing timeline and info demoes links
change infoDb db export
remove default export in info files
resolve db import in info.spec.ts
remove assigned variables to their variables and export db without default
use object destructuring for getConfig in infoRenderer
move default_info_db into infoDbOF
remove id and diagram assigning in info loader
assign returned variables to their variables
remove handled `ts-ignore` in info diagram
handle optional `.styles`
add info fields interface
...
* develop: (22 commits)
Update docs
Added CKEditor and GitHub Writer to available integrations.
chore(deps): update all patch dependencies
build(deps): fix broken pnpm-lock.yaml file
Mermaid version 10.2.0
Mermaid Version 10.2.0-rc.4
Label background fix
Test commit
Fix for regression error in sequenceDiagrams
Fix visibility issue for fields
fix parsing issue with class diagrams
fix: Use unicode arrows in quadrant chart axis
fix: Use unicode arrows in quadrant chart axis
fix lint command
Bump version
Back to JS with jsdoc types
Add unsupported text
Reduce changes in test
Fix deps
Fix lockfile
...
Looks like a bad merge conflict resolution broke this file,
and for some reason, the `packages/mermaid/src/vitepress` bit got
removed when releasing v10.2.0-rc.4.
Fixes: bd1343648e
Fixes: 9c12c42a26
* develop: (66 commits)
Update docs
Update docs
Improve the wording of security level values
Added quadrantChart to the side bar
Added e2e test cases with some fixes
Added documentation for the quadrantChart
Restructured the build function and addressed more review comment
Fixed some parser issue and added test cases for the parser
Fixed review comment
Update docs
Converted files to typescript and added proper types
Fix blog linting
Debug fetch-contributors
Fix lockfile
Revert "Replace esno & ts-node with tsx"
[draft] Added support for quadrant chart
Fix lockfile
Fix build
Update pnpm-lock
Replace esno & ts-node with tsx
...
Merge conflicts:
- pnpm-lock.yaml
* develop: (66 commits)
Update docs
Update docs
Improve the wording of security level values
Added quadrantChart to the side bar
Added e2e test cases with some fixes
Added documentation for the quadrantChart
Restructured the build function and addressed more review comment
Fixed some parser issue and added test cases for the parser
Fixed review comment
Update docs
Converted files to typescript and added proper types
Fix blog linting
Debug fetch-contributors
Fix lockfile
Revert "Replace esno & ts-node with tsx"
[draft] Added support for quadrant chart
Fix lockfile
Fix build
Update pnpm-lock
Replace esno & ts-node with tsx
...
* develop: (33 commits)
Update version
Fix classParser
Check for conflict when linting jison
Update class grammar test
fix Class diagram grammar
Skip sourcemap
Bump version
Update deps
Fix unit tests
Update vite
Fix applitools cypress
Update packages/mermaid/package.json
chore(deps): update dependency typescript to v5
fix typedoc
fix(deps): update all minor dependencies
chore(deps): update pnpm to v8
chore(deps): update fregante/setup-git-user action to v2
fix(deps): update all minor dependencies
chore(deps): update dependency start-server-and-test to v2
chore(deps): update dependency rimraf to v5
...
* 'renovate/all-minor' of https://github.com/mermaid-js/mermaid:
fix(deps): update all minor dependencies
chore(deps): update pnpm to v8
chore(deps): update fregante/setup-git-user action to v2
Test that `src/diagrams/*/styles.ts` module returns a valid
CSS stylesheet that can be parsed via [stylis][1] and then
becomes a valid CSS that [csstree-validator][2] validates.
We test this for every diagram and for every theme, because
many of the invalid CSS bugs are caused by missing theme vars.
There are some CSS errors that I couldn't easily fix, so I've written
the tests to ignore the following CSS errors:
- 'Unknown property `rx`' (Valid in SVG2 draft and in some browsers)
- 'Unknown property `ry`' (Valid in SVG2 draft and in some browsers)
- 'Unknown property `dy`'
- This doesn't seem to be valid CSS in any SVG version, but maybe
some browsers support it 🤷 I feel like we should probably change
this though.
[1]: https://github.com/thysultan/stylis
[2]: https://github.com/csstree/validator
The `node16` module resolution requires imports to use the `.js` file
extension in type definitions.
`@rollup/plugin-typescript` is needed to make this work with the Vite
setup used by Mermaid.
The module option for Mermaid internally is set to `nodenext`. This is
needed to support `.json` imports. Note that setting `module` to
`node16` or `nodenext` implies a matching `moduleResolution` value.
Replace Mermaid's dependency on `moment` with `dayjs`.
[Moment is now in maintenance mode][1], and they don't recommend
using it.
[Dayjs][2] has almost exactly the same API as moment, and is still
curently being maintained. Unlike moment, dayjs objects are immutable,
which makes our life much easier, but we need to do
`a = a.add(1, "day")` instead of just `a.add(1, "day")`.
We can't use `dayjs.duration`, because unlike `moment.duration`,
[dayjs durations always degrade to ms][3].
This causes issues with daylight savings, since it assumes that each
day is 24 hours, when some days have 23/25 hours with daylight savings.
(it also assumes that each month is 30 days).
However, `dayjs.add(1, "d");` correctly adds 1 days, even when that
day is only 23 hours long, so we can use that instead.
[1]: https://momentjs.com/docs/#/-project-status/
[2]: https://day.js.org/
[3]: https://day.js.org/docs/en/durations/durations
Co-authored-by: Alois Klink <alois@aloisklink.com>
Replace Mermaid's dependency on `moment` with `dayjs`.
[Moment is now in maintenance mode][1], and they don't recommend
using it.
[Dayjs][2] has almost exactly the same API as moment, and is still
curently being maintained. Unlike moment, dayjs objects are immutable,
which makes our life much easier, but we need to do
`a = a.add(1, "day")` instead of just `a.add(1, "day")`.
We can't use `dayjs.duration`, because unlike `moment.duration`,
[dayjs durations always degrade to ms][3].
This causes issues with daylight savings, since it assumes that each
day is 24 hours, when some days have 23/25 hours with daylight savings.
(it also assumes that each month is 30 days).
However, `dayjs.add(1, "d");` correctly adds 1 days, even when that
day is only 23 hours long, so we can use that instead.
[1]: https://momentjs.com/docs/#/-project-status/
[2]: https://day.js.org/
[3]: https://day.js.org/docs/en/durations/durations
* develop:
Add highlight tag info in contributing.md
chore(deps): update dependency cypress to v12
docs: fix links
Fix types
chore(deps): update dependency vite to v4
* develop: (45 commits)
Showcase section to the docs - keepings docs up to date (#4055)
bugfix: add missing d3 curves to flowchart and docs
fix(deps): update dependency dagre-d3-es to v7.0.8
build(pre-commit): cache eslint in pre-commit
build(lint): cache eslint with strategy content
Update cypress/integration/rendering/sequencediagram.spec.js
feat(er): allow leading underscore for attributes name
ci(lint): show nice error on lint failure
chore: add moment to dependencies
Update docs
Update mindmap.md
chore: remove moment-mini
docs(readme-ch): fix twitter link
build(lint): cache prettier on `pnpm run lint`
fix: moment-mini default exporter
docs(readme): update broken twitter badge
test(er): improve tests on multiple key constraints
Fixes Typo, remove console.log
doc(er): add documentation on multiple key constraints
feat(er): allow multiple constraints on attributes
...
Vitepress uses YAML frontmatter to configure Vitepress specific
settings, see https://vitepress.vuejs.org/config/frontmatter-configs
We just need to use `remark-frontmatter` to add support for it.
GitHub also renders the YAML front-matter nicely in a table
automatically, but maybe we should instead strip it, if it's only
used by Vitepress?
* sidv/properlyWaitTests:
feat: Wait for rendering to finish before taking image snapshots
Update docs
chore(deps): update all non-major dependencies
Fix: Too many `primaryBorderColor`
Support using GFM in markdown documentation.
GitHub has some custom features in their Markdown documentation.
For example, they support using tables, footnotes, and task lists.
Vitepress supports tables too.
However, remark sometimes throws an error when parsing tables,
so we should use `remark-gfm` to handle them.
* master: (23 commits)
Update vitepress
fix: Add icon css
fix Top level await
v9.3.0
bump dagre-es 7.0.6
Bump mermaid version
Update dagre-es
Bump mermaid version
fix: Incorrect removal of existing elements
fix: add .js to external imports.
fix: add .js to external imports.
Bump mermaid version
fix: add .js to external imports.
Bump mermaid version
fix: Throw correct errors when parsing diagrams with errors
Update url snapshot test for external diagrams
Update url snapshot test for external diagrams
Updated package number
Updated package number
Updated package number to 9.3.0-rc1
...
`graphlib` has recently been replaced with the ESM version of
graphlib bundled with
[`dagre-d3-es`](https://www.npmjs.com/package/dagre-d3-es), in commit
f687abb1 (chore: Use `graphlib` from `dagre-d3-es`, 2022-11-20)
This means we can safely remove it from our dependencies list.
Fixes: f687abb165
In order to parse the YAML front-matter in a Mermaid diagram, the
YAML seperators **MUST NOT** be indented, e.g.:
````markdown
```mermaid
---
title: This is fine.
---
```
```mermaid
---
title: This is not fine, because the `---` are indented.
---
```
````
However, this makes it very difficult to write nice Mermaid diagrams in
HTML code-blocks.
This commit uses [`ts-dedent`](https://www.npmjs.com/package/ts-dedent)
to automatically remove the indentation from Mermaid diagrams when
parsed from HTML. Mermaid diagrams from mermaidAPI.render() are **NOT**
dedented, as that API is called from JavaScript code, and therefore
users can easily `dedent` their own diagrams.
* develop: (79 commits)
chore: docs:build
chore: docs:build
tiny fix and change: "The/y cannot" -> "Cannot..."
remove 'horz' from cSpell.json
update demos/state.html to includ examples; formatting
add 'horz' to cSpell (in pieDetector.ts commented out barChart work)
refine - what is not done yet
remove 'horz' from cSpell.json
Revert "Added pie"
chore: Fix cSpell in pieRenderer
update demos/state.html to includ examples; formatting
add 'horz' to cSpell (in pieDetector.ts commented out barChart work)
refine - what is not done yet
remove console stmt
#3831 Re-enabling themes for er diagrams
#3835 Adding path to list of elements to be styled
#3882 fix for issues with mindmaps with only a single node
chore(deps): update pnpm to v7.17.0
docs: Remove warning in readme
chore(deps): update lycheeverse/lychee-action action to v1.5.4
...
* develop:
chore(deps): update pnpm to v7.17.0
docs: Remove warning in readme
chore(deps): update lycheeverse/lychee-action action to v1.5.4
chore: Add size shield in readme
Fix example for Git diagrams
Fix TS errors
Add interface for DiagramDb and other minor changes
Disallow leading whitespace before delimiter
Add title support using YAML frontmatter
* sidv/viz:
Fix Lodash import
fix: Viz build
feat: Add package visualization
Ignore stats.html
feat: Add bundle visualization
style(docs): use `github-dark` hightlight theme
refactor(docs): use default vitepress highlighter
fix: Move redirection to router
chore: Add docs to redirect.ts
feat: Redirect old documentation links.
comments in states are skipped now
Remove extra arrow and adjust cross position
Replace the dagre and dagre-d3 libraries with dagre-d3-es.
Both dagre and dagre-d3 are deprecated and unmaintained,
and haven't been updated for more than 3 years.
Since dagre-d3 still requires an old version of d3, this causes
a bunch of security warnings,
e.g. https://github.com/advisories/GHSA-36jr-mh4h-2g58
The [dagre-d3-es](https://github.com/tbo47/dagre-es) package is a fork
that contains support for `"d3": "^7.6.1"`. Also, it's ESM, so we will
hopefully get smaller bundle sizes too. The only issue is that this
fork isn't very well used (only has 3000 weekly downloads),
compared to `dagre-d3`'s 250,000 weekly downloads.
(although to be fair, a large proportion of dagre-d3's downloads
probably come from mermaid)
Since it's is a less popular package,
**I've pinned `dagre-d3-es` to `"7.0.2"` instead of `"^7.0.2"`**.
This does mean if there is a bug in `dagre-d3-es`, we will have to
manually bump it ourselves, but it also means we won't accidentally
be sending a buggy version of `dagre-d3-es` out to users in cases
something changes (it might be worth disabling renovate for this
if we're feeling paranoid!)
Use the default vitepress highlighter instead of making our own
highlighter using shiki.
The benefits are:
- We don't need to directly depend on shiki
- `mermaid-example` code-blocks will use the same highlighting
as other languages (e.g. `html`/`js`).
- We can control the theme from the global `vitepress` config.
- Darkmode/lightmode themes are supported
- Escaping is already handled by the default highlight function
* develop:
chore(deps): update all non-major dependencies
fix(deps): update all non-major dependencies
fix: `sourceLinkTemplate` in typedoc
only call getClasses if the diagram renderer supports it
fix typo
merge fix: get classDefs only if diagram is in CLASSDEF_DIAGRAMS
use lodash isEmpty instead of method defined in utils
chore: Fix cspell
fix: Type of DiagramStyleClassDef, general cleanup
change spec descriptions to active voice (= shorter b/c 'should' isn't needed)
functions and specs: removeExistingElements
functions and specs: createUserstyles; minor changes
functions and specs: createCssStyles, appendDivSvgG,cleanUpSvgCode, putIntoIFrame [for render]
add MockedD3.ts
const isSandboxed, isLooseSecurityLevel, fontFamily; a few more CONSTs
more meaningful var names; move related lines together; const idSelector
comment the main steps (prepare to break into functions that can be tested)
render: define const iFrameId, enclosingDivID and _selector to use in function
specs: encodeEntities, decodeEntities
render: constants
* develop:
Fix for broken test
fix: build npm-script
Fix for issue in classdiagram-v2 from the typescript updates
fix: build npm-script
chore: Cleanup
chore: cleanup
fix: dynamic import
fix: module import in pie chart demo
fix: use async in render-after-error
Removes vitest from all subpackages so that vitest/`pnpm run test`
are only in the root mono-repo.
This is required, because otherwise the root vitest and the subpackage
vitest versions can otherwise be slightly different, which causes
issues when running unit tests:
```Snapshot cannot be used outside of test```
In the future, we may want to consider moving package specific
tests into `packages/*/test`, and instead running these tests
with `pnpm run --recursive`, so that tests are run in each package by
their own version of vitest. This is the way that most projects
do things (e.g. https://github.com/vitest-dev/vitest).
* sidv/viteVitest:
ts conversion
cleanup
remove esbuild
fix: tests
chore: Add recommended extensions
Fix user-journey leaking css
Add "Debug Current Test File" configuration for VSCode
Fix unit test coverage
Use vite for build
Fix docs
vite
vite Server
Cleanup
Merge vitest & esbuild
Merge vitest
fix jison generation
Vite
Vite