Commit Graph

303 Commits

Author SHA1 Message Date
Sidharth Vinod 17c798a1b3
Merge branch 'develop' into release/10.2.0
* develop: (49 commits)
  Debug fetch-contributors
  Fix lockfile
  Revert "Replace esno & ts-node with tsx"
  Fix lockfile
  Fix build
  Update pnpm-lock
  Replace esno & ts-node with tsx
  chore(deps): update all minor dependencies
  chore(deps): update all patch dependencies
  Fix missing `await` in usage document
  Add integrations
  test: fix classDiagramGrammer unit test
  restore path calculation for grammar test
  Allow overlapping notes
  remove spellcheck warnings
  Fix path in test
  fix import issue
  requested update
  Reject ridiculous years in Gantt charts.
  Remove unnecessary dependencies
  ...
2023-05-09 10:13:15 +05:30
Sidharth Vinod 45139470a3
Fix lockfile 2023-05-08 22:08:47 +05:30
Sidharth Vinod 3677d44a58
Revert "Replace esno & ts-node with tsx"
This reverts commit 75337287ea.
2023-05-08 22:08:11 +05:30
Sidharth Vinod b27d018c09
Fix lockfile 2023-05-08 19:04:21 +05:30
Sidharth Vinod 1b48c19897
Merge branch 'develop' into sidv/contributors
* develop:
  chore(deps): update all minor dependencies
  requested update
  Update packages/mermaid/src/docs/syntax/flowchart.md
  Update docs
  Docs: Flowchart - minor verbiage update
2023-05-08 18:51:10 +05:30
Sidharth Vinod 500efda8d6
Update pnpm-lock 2023-05-08 18:47:22 +05:30
Sidharth Vinod 8e9d1bfc35
Merge branch 'develop' into sidv/contributors
* develop:
  chore(deps): update all patch dependencies
2023-05-08 18:46:39 +05:30
Sidharth Vinod 75337287ea
Replace esno & ts-node with tsx 2023-05-08 18:46:14 +05:30
renovate[bot] b04155178a
chore(deps): update all minor dependencies 2023-05-08 10:09:26 +00:00
renovate[bot] d7e140a829 chore(deps): update all patch dependencies 2023-05-08 10:08:10 +00:00
Sidharth Vinod cb3982de7e
Remove unnecessary dependencies
Co-authored-by: Alois Klink <alois.klink@gmail.com>
2023-05-02 14:16:35 +05:30
Sidharth Vinod 110cd61c64
Fix lockfile 2023-04-29 10:17:51 +05:30
Sidharth Vinod 99abd4c31b
Fix avatar fetching 2023-04-29 10:12:47 +05:30
Sidharth Vinod a01343bf1b
Fix lockfile 2023-04-27 10:37:35 +05:30
Sidharth Vinod 395a794758
Fix deps 2023-04-26 10:37:03 +05:30
Sidharth Vinod 1f2af83a0c
Fix lockfile 2023-04-26 10:35:24 +05:30
Sidharth Vinod 4d3e5e42e1
Use mdast-util-from-markdown instead of simple-markdown 2023-04-26 10:30:13 +05:30
Sidharth Vinod ec62c2bf5b
Merge branch 'develop' into sidv/zenuml
* 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
  ...
2023-04-26 00:15:52 +05:30
Sidharth Vinod b9e7ba023f
Update ZenUML 2023-04-26 00:12:39 +05:30
Sidharth Vinod b0c58a9764
Update deps 2023-04-23 23:15:26 +05:30
Sidharth Vinod bbe3909627
Update vite 2023-04-23 22:34:19 +05:30
renovate[bot] 9e58f7bd99
chore(deps): update dependency typescript to v5 2023-04-22 20:51:24 +00:00
Sidharth Vinod 5c6773a47c
Merge branch 'renovate/all-minor' of https://github.com/mermaid-js/mermaid into renovate/all-minor
* '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
2023-04-23 02:04:28 +05:30
Sidharth Vinod 5634c6ca1a
fix typedoc 2023-04-23 02:03:28 +05:30
renovate[bot] 1c17f4c770
fix(deps): update all minor dependencies 2023-04-22 20:30:38 +00:00
renovate[bot] bed9e8daab
chore(deps): update pnpm to v8 2023-04-22 20:04:11 +00:00
renovate[bot] e4bc3e2269
fix(deps): update all minor dependencies 2023-04-22 20:01:25 +00:00
renovate[bot] e6d11b9443
chore(deps): update dependency start-server-and-test to v2 2023-04-22 19:26:13 +00:00
Sidharth Vinod c624cbb910
Merge pull request #4325 from mermaid-js/renovate/eslint-plugin-unicorn-46.x
chore(deps): update dependency eslint-plugin-unicorn to v46
2023-04-23 00:51:33 +05:30
Sidharth Vinod 12ed81855a
Add zenuml 2023-04-23 00:34:59 +05:30
renovate[bot] f597f15f82
chore(deps): update dependency rimraf to v5 2023-04-22 18:53:56 +00:00
renovate[bot] 909c063a67
chore(deps): update dependency eslint-plugin-unicorn to v46 2023-04-22 18:51:50 +00:00
renovate[bot] 8cb3318d94 chore(deps): update dependency eslint-plugin-jsdoc to v43 2023-04-22 18:46:44 +00:00
renovate[bot] ddde451915
fix(deps): update dependency dompurify to v3 2023-04-22 08:28:31 +00:00
renovate[bot] 93eb72248a
chore(deps): update dependency concurrently to v8 2023-04-20 04:15:28 +00:00
Sidharth Vinod 2fe0a1360f
Upgrade vitepress 2023-04-20 09:35:28 +05:30
Remco Haszing aa5c1a5f78
Merge branch 'develop' into fix-node16-module-resolution 2023-04-13 14:58:17 +02:00
Alois Klink b4164b6ab5 test: test that styles and themes return valid CSS
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
2023-04-13 08:27:32 +01:00
Sidharth Vinod d1e369e68d
revert pnpm changes 2023-04-05 16:32:48 +05:30
chriskim-au1 3b861ab91f doc update 2023-04-05 13:11:22 +10:00
Knut Sveidqvist 89193d7360 Simple markdown in lock file 2023-03-29 09:35:42 +02:00
Knut Sveidqvist 89eec225ce Merge branch 'develop' into 4220-string-synax-and-features 2023-03-29 09:34:49 +02:00
Knut Sveidqvist a1c50b8079 #4220 Parsing the text as markdown and rendering accordingly 2023-03-20 14:15:26 +01:00
renovate[bot] 8b37ceffe1 chore(deps): update pnpm to v7.30.0 2023-03-20 04:21:23 +00:00
Remco Haszing f3bebf25ea
Merge branch 'develop' into fix-node16-module-resolution 2023-03-17 20:52:50 +01:00
Remco Haszing 8c69ecd5ac
Update @types/lodash-es
This adds support for the TypeScript `"moduleResolution": "node16"`.
2023-03-17 12:26:41 +01:00
renovate[bot] f3a9f81bfb fix(deps): update all non-major dependencies 2023-03-13 09:45:30 +00:00
renovate[bot] 4b462d717c chore(deps): update node.js to v18.15.0 2023-03-13 04:42:20 +00:00
Remco Haszing b7d31adda4
Support node16 module resolution
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.
2023-03-11 14:54:21 +01:00
Sidharth Vinod 4e4f2fcfc5
Merge branch 'master' into develop
* master:
  Updated import of cytoscape for consistent behavior
  v9.4.3
  fix: dayjs import extension
  9.4.2
  Fix mindmap demo
  9.4.2-rc.2
  chore: Rename diagram-definitions with specific names
  Use cytoscape esm
  Revert "chore: Defer elk loading"
  Revert "Split cytoscape"
  test(gantt): test daylight savings in ganttdb
  refactor(deps): replace `moment` with `dayjs`
  fix(E2E): Add cors package
  fix Server
  Fix lockfile
  Remove Readme
2023-03-08 00:13:54 +05:30
renovate[bot] e9d49e6b98
fix(deps): update all non-major dependencies 2023-03-06 06:25:39 +00:00
renovate[bot] 6c2c28940b chore(deps): update all non-major dependencies 2023-03-06 06:22:18 +00:00
Alois Klink 704506835f
refactor(deps): replace `moment` with `dayjs`
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>
2023-02-28 19:54:27 +05:30
Alois Klink a5db04b01c refactor(deps): replace `moment` with `dayjs`
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
2023-02-26 22:31:12 +00:00
Sidharth Vinod fa8a887ae1
chore: dagre-d3-es@7.0.9 2023-02-25 08:56:18 +05:30
Sidharth Vinod 00a14ee811
WIP: Contributors 2023-02-24 23:03:51 +05:30
Sidharth Vinod d688f1fe94
fix lockfile 2023-02-24 21:16:09 +05:30
Sidharth Vinod 8c2dbafdb5
Merge branch 'develop' into sidv/contributors
* develop: (309 commits)
  Update docs
  fix Lint
  Update CHANGELOG.md
  Update CHANGELOG.md
  fix: fix exports
  Doc (typo): remove duplicate "be"
  Fix readme link
  Regenerate mermaid docs
  Add deepdwn to cspell
  Add Deepdwn to native integrations list
  docs: Fix changelog
  docs: v10 breaking changes
  Remove `null` from diagrams before render
  fix docs diagram
  Updated version
  Minor cleanup to trigger build.
  Fix spellings
  Wrap option working in test case
  Fix typos
  Minor cleanup
  ...
2023-02-24 21:14:55 +05:30
Sidharth Vinod 067b6adc20
fix(E2E): Add cors package 2023-02-20 21:23:06 +05:30
Sidharth Vinod 6ded32880d
Fix lockfile 2023-02-20 18:24:24 +05:30
Sidharth Vinod 638362baea
Merge branch 'release/10.0.0' into sidv/splitDiagrams
* release/10.0.0: (333 commits)
  10.0.0-rc.3
  Export more types
  no side effects
  10.0.0-rc.2
  skip failing elk test
  Cleanup
  Update docs
  fix(#3406, #3394): Remove init & initThrowsErrors
  chore: Rename lazy loaded diagram definitions
  Skip flowchart-elk failing test
  Fix docs
  fix Server
  Fix lint
  Remove Readme
  Fix E2E Tests
  Fix tests
  feat: Break render and parse types
  chore: Remove all non async render/parse/init
  Remove CJS builds from docs
  chore: Remove cjs from build
  ...
2023-02-19 20:18:26 +05:30
Sidharth Vinod 735aceb37a
Fix E2E Tests 2023-02-19 14:03:11 +05:30
Sidharth Vinod c1aad5975c
Merge branch 'release/9.4.2' into release/10.0.0
* release/9.4.2:
  RC version
  Revert #4034
  Revert #4034
  fix: Vite, D3, Vitest Types
  fix(api): tree shaking package.json import
2023-02-19 00:55:23 +05:30
Sidharth Vinod 2c062d648a
Merge branch 'develop' into release/9.4.2
* 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
2023-02-19 00:04:44 +05:30
Sidharth Vinod 0f36bbf3e1
Revert #4034 2023-02-18 23:45:45 +05:30
Sidharth Vinod 3c4a6a19bb
fix: Vite, D3, Vitest Types 2023-02-18 22:35:14 +05:30
renovate[bot] ccaa99937f
chore(deps): update dependency cypress to v12 2023-02-16 12:27:04 +00:00
Sidharth Vinod 17238c0326
Merge branch 'master' into develop
* master: (24 commits)
  docs: fix links
  Skip precommit hooks on CI
  Fix release-publish
  Fix timeline and mindmap
  Updating integration instructions for timeline and mindmap
  Remove node heap
  Revert "chore: Set node heap size"
  Revert "Remove text hint"
  Split cytoscape
  Linear build
  Remove text hint
  Fix elk import
  Dynamic elk import
  Remove heap option
  elk web-worker
  Test publish docs
  chore: Add file extension for dynamic import
  chore: Defer elk loading
  Update vitepress
  Fix links to integrations.md
  ...
2023-02-16 17:52:07 +05:30
Sidharth Vinod ac231949f0
Merge pull request #4071 from mermaid-js/renovate/vite-4.x
chore(deps): update dependency vite to v4
2023-02-16 17:50:08 +05:30
Sidharth Vinod 83797eef38
elk web-worker 2023-02-16 14:21:33 +05:30
Sidharth Vinod a1a252cc29
Merge branch 'master' into release/9.4.1
* master:
  Update vitepress
  Fix links to integrations.md
  chore: Set node heap size
2023-02-16 13:01:10 +05:30
Sidharth Vinod 62f7fb082e
Update vitepress 2023-02-16 12:47:00 +05:30
Knut Sveidqvist 25da0c6c8e Merge branch 'master' into develop 2023-02-15 16:31:44 +01:00
Per Brolin a956be7bbf Release candidate 2023-02-10 11:03:25 +01:00
renovate[bot] 08ac41113f
chore(deps): update dependency vite to v4 2023-02-09 05:54:04 +00:00
Sidharth Vinod 07764348eb
Merge pull request #4069 from mermaid-js/renovate/jsdom-21.x
chore(deps): update dependency jsdom to v21
2023-02-09 11:13:03 +05:30
renovate[bot] 72e8b7fb38
chore(deps): update dependency rimraf to v4 2023-02-09 00:49:20 +00:00
renovate[bot] 3a89cc7993
chore(deps): update dependency jsdom to v21 2023-02-09 00:47:08 +00:00
renovate[bot] d45eda1c60 chore(deps): update dependency @types/uuid to v9 2023-02-09 00:41:24 +00:00
Sidharth Vinod f83f09d8b0
Fix vitest type 2023-02-09 01:29:41 +05:30
renovate[bot] c4eb1608b0
chore(deps): update all non-major dependencies 2023-02-08 19:30:57 +00:00
Knut Sveidqvist 74df4a7a68 Mind map coming in from the cold. A lazy loaded diagram in the same way as timeline. 2023-02-08 17:42:58 +01:00
Knut Sveidqvist 82f7e1b754 Version updates 2023-02-08 13:50:58 +01:00
Knut Sveidqvist 580903051f Fixing broken test 2023-02-08 13:40:41 +01:00
Knut Sveidqvist ce037a84ca Fixing build after last batch of changes 2023-02-08 13:16:33 +01:00
Sidharth Vinod d562a81019
Merge branch 'develop' into timeline
* 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
  ...
2023-02-08 15:57:09 +05:30
renovate[bot] ac67794fb2 fix(deps): update dependency dagre-d3-es to v7.0.8 2023-02-06 01:07:08 +00:00
Emerson Bottero df10d64989 chore: add moment to dependencies 2023-01-29 11:24:48 -03:00
Emerson Bottero 7179f1bcba chore: remove moment-mini 2023-01-26 20:55:57 -03:00
Sidharth Vinod 0aa7da261f
Merge pull request #3962 from aloisklink/build/add-autogenerated-header-after-yaml-codeblocks
Add support for YAML frontmatter in Markdown docs (used for Vitepress config)
2023-01-25 22:50:20 +05:30
Alois Klink b26cdb3e46 build(docs): support YAML frontmatter in markdown
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?
2023-01-22 19:21:18 +00:00
ashishj ca22e85e55 Merge branch 'release/9.4.0' into timeline 2023-01-19 19:20:29 +01:00
Sidharth Vinod afe3f593e1
fix(#4003): Remove unhandled promises
Add eslint rules to check for unhandled promises
Fix all existing unhandled promise issues
2023-01-18 00:47:49 +05:30
Sidharth Vinod fba3f8481e
Merge branch 'develop' into sidv/internalFCV3
* develop:
  chore(deps): update all non-major dependencies
  fix(deps): update dependency dagre-d3-es to v7.0.6
2023-01-16 13:27:09 +05:30
renovate[bot] 376d1a583c
chore(deps): update all non-major dependencies 2023-01-16 05:22:19 +00:00
renovate[bot] ea3d7bc594 fix(deps): update dependency dagre-d3-es to v7.0.6 2023-01-16 05:18:31 +00:00
Sidharth Vinod 1c8c69f8db
Merge branch 'sidv/properlyWaitTests' into sidv/internalFCV3
* 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`
2023-01-16 02:11:59 +05:30
renovate[bot] ac6d325a00 chore(deps): update all non-major dependencies 2023-01-13 10:02:07 +00:00
Sidharth Vinod 05d1fc44e8
Merge branch 'develop' into sidv/internalFCV3
* develop:
  test(sequenceDiagram): mock more d3 curve* types
  test(docs): fix test failure due to bad merge
  chore(dev-deps): update vitest to `^0.27.1`
2023-01-13 10:23:59 +05:30
Alois Klink 6c862565aa chore(dev-deps): update vitest to `^0.27.1`
Updates vitest to `^0.27.1`.

We want to add `importOriginal` feature added in Vitest [v0.26.3][1],
see commit
853eeddba8

[1]: https://github.com/vitest-dev/vitest/releases/tag/v0.26.3
2023-01-12 23:52:16 +00:00
Sidharth Vinod 242a508d50
feat: Flowchart-elk integration 2023-01-12 18:26:08 +05:30
Sidharth Vinod 9acd562b9e
Merge pull request #3954 from aloisklink/build/support-GFM-in-markdown-documentation
Support GitHub Flavored Markdown in markdown documentation
2023-01-12 12:47:07 +05:30
Knut Sveidqvist e28a766e7d Cleanup, updating the module name and description for flowchart in package.json 2023-01-11 19:56:04 +01:00
ashishj 68609fd8d0 Merge develop in timeline branch 2023-01-11 18:13:26 +01:00
Knut Sveidqvist 094b97de12 Merge branch 'develop' into layout-v3-continued 2023-01-11 18:03:09 +01:00
renovate[bot] a56d0bc36b fix(deps): update dependency dompurify to v2.4.3 2023-01-09 02:52:02 +00:00
Alois Klink ef51111b86 build(docs): support GFM in markdown docs
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.
2023-01-01 21:28:03 +00:00
Alois Klink a58b41a38e Merge branch 'develop' into fix/3706_support-indented-yaml-only-in-html 2022-12-22 19:24:33 +00:00
Sidharth Vinod 1495ae623a
WIP Adding contributors page from vitest 2022-12-21 10:54:23 +05:30
Sidharth Vinod 33f78a5429
Merge branch 'master' into develop
* master:
  Fix book link
  Add book landing page back
2022-12-16 01:28:42 +05:30
Sidharth Vinod 2743b72a87
Add book landing page back 2022-12-16 01:12:50 +05:30
Sidharth Vinod 7b13b489c2
Merge branch 'master' into develop
* 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
  ...
2022-12-16 00:51:16 +05:30
ashishj fefcc43dd4 Merged Develop in timeline branch 2022-12-15 17:10:56 +01:00
Sidharth Vinod d841ad8f3e
Update vitepress 2022-12-15 17:09:24 +05:30
Sidharth Vinod 152994047e
bump dagre-es 7.0.6 2022-12-15 09:12:08 +05:30
Sidharth Vinod 16b51800d0
Update dagre-es 2022-12-14 09:45:18 +05:30
renovate[bot] a975c8c9cd chore(deps): update all non-major dependencies 2022-12-12 04:57:37 +00:00
Knut Sveidqvist 4863d0d29d Adding new flowchart renderer using elk 2022-12-03 09:47:01 +01:00
Knut Sveidqvist 4f1b26fd76 Adding new flowchart renderer using cytoscape 2022-12-02 08:06:16 +01:00
Alois Klink f884b745dc Merge branch 'develop' into fix/3706_support-indented-yaml-only-in-html
Conflicts:
 - pnpm-lock.yaml
2022-11-30 21:11:48 +00:00
Sidharth Vinod 15cfa5d40d
Merge branch 'develop' into sidv/splitDiagrams
* develop: (79 commits)
  Minor change
  feat: Add @include support to docs
  feat: Add @include example to docs
  feat: Add @include support to docs
  cleanup
  fix lines
  fix Async rendering
  Revert "sync"
  chore(deps): update pnpm to v7.17.1
  chore(deps): remove dependency on `graphlib`
  test(e2e): make gitgraph snapshots consistent
  chore: Fix lint
  test: Update vitest
  Add official vim plugin to list in integrations
  chore: Cleanup package.json
  chore: Cleanup package.json
  chore: Cleanup package.json
  fix lock
  Docs
  Fix: array concat
  ...
2022-11-30 19:15:21 +05:30
Sidharth Vinod 1f147b6b63
Merge branch 'develop' into sidv/mermaidDocs
* develop:
  chore(deps): update pnpm to v7.17.1
  chore(deps): remove dependency on `graphlib`
  test(e2e): make gitgraph snapshots consistent
2022-11-28 16:13:27 +05:30
Alois Klink 05b25db5eb chore(deps): remove dependency on `graphlib`
`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
2022-11-27 19:13:53 +00:00
Alois Klink 5cfa919672 fix: support parsing indented mmd YAML from HTML
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.
2022-11-27 18:19:13 +00:00
Sidharth Vinod f425a02cf9
Merge branch 'develop' into sidv/mermaidDocs
* develop:
  chore: Fix lint
  test: Update vitest
  Add official vim plugin to list in integrations
  chore: Add lodash-eslint rule
  chore: Add lodash-eslint rule
  feat: Spellcheck docs when building
  fix: Enable extending lintstagedrc.
  fix: lintstagedrc `lint:jison`
  Fix lodash import
  Formatting
  Update .vite/build.ts
  fix Lint
  Add docs back
  fix: Core build externals
  chore: Update dagre-d3-es
  chore: Use `graphlib` from `dagre-d3-es`
  fix: Add types to memoized functions
  chore: Replace lodash with lodash-es
  Cleanup
2022-11-25 16:21:05 +05:30
Sidharth Vinod 5e330a6d78
test: Update vitest 2022-11-24 16:33:42 +05:30
ashishj 0d5246fbc7 initial commit 2022-11-23 19:28:26 +01:00
Knut Sveidqvist 50aab56177
Merge pull request #3844 from mermaid-js/sidv/fixLintStaged
fix: LintStaged
2022-11-23 13:52:40 +01:00
Sidharth Vinod 7201c014e3
chore: Cleanup package.json 2022-11-23 16:10:36 +05:30
Sidharth Vinod 6faf54cf6f
fix lock 2022-11-23 16:04:38 +05:30
Sidharth Vinod ab81b508ce
Merge branch 'develop' into sidv/mermaidDocs
* 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
  ...
2022-11-23 15:57:06 +05:30
Sidharth Vinod 2cefb0fb8f
chore: Add lodash-eslint rule 2022-11-23 03:03:19 +05:30
Sidharth Vinod 183dee89c2
feat: Spellcheck docs when building
docs.yml is removed as `docs:verify` will cover spellchecks now.
2022-11-22 23:06:12 +05:30
Sidharth Vinod a686255d9e
Merge branch 'develop' into sidv/optimizeSize
* 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
2022-11-21 18:06:30 +05:30
Knut Sveidqvist ffb95b4fa9
Merge pull request #3823 from mermaid-js/sidv/viz
Add package visualizations
2022-11-21 13:32:19 +01:00
Knut Sveidqvist 29a02d1ab5
Merge pull request #3809 from aloisklink/use-dagre-d3-es
Replace `dagre`/`dagre-d3` with `dagre-d3-es`
2022-11-21 13:31:35 +01:00
Sidharth Vinod 13ef403921
chore: Update dagre-d3-es 2022-11-21 08:16:15 +05:30
Sidharth Vinod 7d3a0577d2
chore: Replace lodash with lodash-es 2022-11-21 08:13:44 +05:30
Sidharth Vinod 4890999206
Merge branch 'sidv/viz' into sidv/dagre-es-viz
* 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
2022-11-21 08:13:43 +05:30
Sidharth Vinod bf53a03c9d
fix: Use `lodash` instead of `lodash-es`
lodash with specific imports use lesser space than lodash-es
2022-11-20 18:30:01 +05:30
Sidharth Vinod 3b32f44a60
Merge branch 'sidv/viz' into sidv/splitDiagrams
* sidv/viz:
  feat: Add package visualization
  Ignore stats.html
  feat: Add bundle visualization
2022-11-20 14:25:40 +05:30
Sidharth Vinod 49a931f712
feat: Add bundle visualization 2022-11-20 12:13:00 +05:30
Sidharth Vinod bc269a966d
Merge branch 'sidv/sizeCheck' into sidv/splitDiagrams
* sidv/sizeCheck:
  feat: Add size inspection plugin
2022-11-20 12:09:42 +05:30
Mason Malone 70f024735b Add title support using YAML frontmatter 2022-11-18 20:42:54 -08:00
Alois Klink fd76e0e270 chore: replace dagre/dagre-d3 with dagre-d3-es
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!)
2022-11-18 18:33:05 +00:00
Sidharth Vinod 7306b5ac45
feat: Add size inspection plugin 2022-11-18 17:52:55 +05:30
Alois Klink 6da6edfc01
refactor(docs): use default vitepress highlighter
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
2022-11-17 19:05:38 +00:00
Alois Klink 476917bda9 Revert "chore(deps): pin dependencies"
This reverts commit 17b72d565d.
2022-11-16 20:00:16 +00:00
Sidharth Vinod beab2278d8
feat: Async mermaid docs 2022-11-14 22:06:26 +05:30
Sidharth Vinod eae88c51d2
Cleanup 2022-11-14 16:42:08 +05:30