Commit Graph

146 Commits

Author SHA1 Message Date
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
Sidharth Vinod 77a326dedf
Merge Master 2022-11-14 14:51:23 +05:30
Sidharth Vinod 2d9bdedaf5
Merge branch 'develop' into sidv/mergeMaster
* 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
2022-11-14 13:57:09 +05:30
renovate[bot] a1e2df8466
chore(deps): update all non-major dependencies 2022-11-14 05:28:23 +00:00
renovate[bot] 20613beb8a fix(deps): update all non-major dependencies 2022-11-14 05:25:07 +00:00
Sidharth Vinod 88d3fdfb8f
fix: `use-inline-specifiers-lockfile-format` to pnpm 2022-11-11 13:29:59 +05:30
Sidharth Vinod 1f68ea4058
Hacky fix for pnpm issue 2022-11-11 02:41:03 +05:30
Sidharth Vinod ab92b5c100
chore: Cleanup pakage.json, fix jisonLint 2022-11-11 01:54:29 +05:30
Sidharth Vinod a83f88bdf1
chore: Merge master to develop 2022-11-10 13:51:53 +05:30
Sidharth Vinod c6287b640d
Merge remote-tracking branch 'origin/develop' into sidv/docsDev
* origin/develop:
  chore(deps): update all non-major dependencies
  chore(deps): update all non-major dependencies
  docs: Fix relative links to documentation files
  docs: Update references to default config in directives page
  Fixing applitools batches
  chore: Sync docs
  Fix link to CSS classes
2022-11-07 14:11:06 +05:30
renovate[bot] 603b537ee1 chore(deps): update all non-major dependencies 2022-11-07 07:48:40 +00:00
renovate[bot] 2a45d71efd chore(deps): update all non-major dependencies 2022-11-07 05:36:39 +00:00
Sidharth Vinod 015e22acf8
feat: Add live updates to docs. 2022-11-01 12:04:34 +05:30
Sidharth Vinod 24198ed63e
Merge remote-tracking branch 'origin/develop' into pr/emersonbottero/3678
* origin/develop:
  chore(deps): update all non-major dependencies
  chore(deps): update all non-major dependencies
  chore: Update bug report template
2022-10-31 19:43:53 +05:30
renovate[bot] 77782fdbc7 chore(deps): update all non-major dependencies 2022-10-31 12:56:18 +00:00
renovate[bot] a15b228d3f chore(deps): update all non-major dependencies 2022-10-31 06:48:56 +00:00
Emerson Bottero f87d1630d1 chore: fix most of aloisklink reviews 2022-10-30 21:22:38 -03:00
Emerson Bottero ec5568b943 chore: more revision fixes 2022-10-27 19:58:39 -03:00
Emerson Bottero b62873a195 sync last changes 2022-10-25 17:54:07 -03:00
renovate[bot] 728d022f52 chore(deps): update all non-major dependencies 2022-10-24 07:36:58 +00:00
renovate[bot] 663edabb14 chore(deps): pin dependencies 2022-10-24 04:32:21 +00:00
Alois Klink e6f19ff461 style: lint typescript with eslint-plugin-tsdoc 2022-10-20 20:23:28 +01:00
Sidharth Vinod d17aa6ecdd
Merge branch 'release_9.2.0_buggfixes' into release/9.2.0
* release_9.2.0_buggfixes:
  fix: Add default arg to options
  fix: Build types
  chore: Update creation date
  fix: getElementById type issue.
2022-10-19 19:21:19 +05:30
Santosh Viswanatham c71b6e31f7
Merge branch 'develop' into feat/3601-cspell-configuration 2022-10-18 21:02:38 +05:30
Sidharth Vinod f2571e9930
fix: Live editor links 2022-10-18 12:28:48 +05:30
Dima Kurilo 20751a6496 fix cypress tests for erDiagram, add eslint-plugin-no-only-tests plugin because of this comment: https://github.com/mermaid-js/mermaid/pull/3647#issuecomment-1281163858 2022-10-17 13:20:17 -04:00
devcer aad53f9e61 merged with master 2022-10-17 09:27:42 +05:30
renovate[bot] 17b72d565d chore(deps): pin dependencies 2022-10-17 03:12:28 +00:00
renovate[bot] 541de12690
chore(deps): update all non-major dependencies (#3671)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-16 22:58:11 +02:00
Sidharth Vinod a4af3704ba
fix: getElementById type issue.
Converts mindmapDB to TS
2022-10-16 10:06:44 +05:30
Emerson Bottero cbcf7f8a11 docs: new Documentation 2022-10-15 00:50:11 -03:00
renovate[bot] 9ac3992fd2
chore(deps): update all non-major dependencies (minor) (#3632)
* chore(deps): update all non-major dependencies

* chore: add `auto-install-peers` to `.npmrc`

* chore: Update lockfile

* Update docs/index.html

Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update packages/mermaid/src/docs/index.html

Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Define integrity, crossorigin and referrerpolicy

* Define integrity, crossorigin and referrerpolicy

* chore: format

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2022-10-14 13:18:19 +02:00
Sidharth Vinod 24605784f2
chore: Update lockfile 2022-10-12 12:01:54 +05:30
Sidharth Vinod 3240f8ae56
feat: loadExternalDiagramsAtStartup 2022-10-12 11:56:39 +05:30
devcer 4d0da7fba0 Added and configured cspell plugin to eslint 2022-10-08 14:38:41 +05:30
Sidharth Vinod 6029bdeee9
Merge branch 'develop' into sidv/fixImportDoc
* 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
2022-10-08 09:41:11 +08:00
Knut Sveidqvist 646f76d343 Fix for broken test 2022-10-07 14:36:25 +02:00
Sidharth Vinod 5865c890b5
docs: Add mermaid version to script URL 2022-10-07 15:52:32 +08:00
Sidharth Vinod 803ea863fd
fix: pnpm not found 2022-10-06 22:58:54 +08:00
Alois Klink 1f39fde230 build(test): remove vitest from subpackages
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).
2022-10-06 00:56:54 +01:00
Knut Sveidqvist 1528c03f85 Updated lockfile 2022-10-04 08:51:12 +02:00
Knut Sveidqvist ef91b4fa0e
Merge pull request #3559 from mermaid-js/minmaps
Mindmaps replacing rendering algoritm with cose-bilkent
2022-10-04 08:26:11 +02:00
Knut Sveidqvist 9468bffcbb Merge branch 'develop' of github.com:emersonbottero/mermaid into emersonbottero-develop 2022-10-04 08:23:36 +02:00
Knut Sveidqvist 5079fa93b4 Using cose-bilkent layout algorithm for mindmaps 2022-10-03 10:05:12 +02:00
Knut Sveidqvist 56add0756f Lazy loading fix for example-diagram and mindmaps 2022-10-03 07:01:56 +02:00
Knut Sveidqvist 96cde8a15a updated pnpm-lock file 2022-09-29 19:35:54 +02:00
Knut Sveidqvist f46f8752ca Adding example diagram as a template for a new diagram 2022-09-28 17:49:47 +02:00
Knut Sveidqvist be34e6145f Fix for tests 2022-09-28 14:53:16 +02:00
Knut Sveidqvist ebdec77c88 #3061 Fixing unit tests 2022-09-26 08:47:41 +02:00
Alois Klink 29c52ec4d4 chore: update pnpm-lock.yaml lockfile 2022-09-25 20:02:23 +01:00
Sidharth Vinod 53bbf444e5
fix build 2022-09-23 17:39:08 +05:30
Sidharth Vinod ad49564ab5
vite build 2022-09-23 12:31:24 +05:30
Sidharth Vinod bf25be7cf0
Merge branch 'sidv/viteVitest' into sidv/3061_monorepo
* 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
2022-09-23 11:31:15 +05:30
Knut Sveidqvist db31f61368 Use of pnpm for the monorepo 2022-09-22 11:12:57 +02:00