Commit Graph

88 Commits

Author SHA1 Message Date
renovate[bot] ac6d325a00 chore(deps): update all non-major dependencies 2023-01-13 10:02:07 +00:00
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 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
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 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
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 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
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 49a931f712
feat: Add bundle visualization 2022-11-20 12:13:00 +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
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 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