915 Commits

Author SHA1 Message Date
Sidharth Vinod
31afd7499b
chore: Linear build 2023-02-16 12:05:41 +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
Per Brolin
e0286be8d2 Corrected typo 2023-02-10 08:58:58 +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
Sidharth Vinod
803c8ca45b
Merge pull request #4070 from mermaid-js/renovate/rimraf-4.x
chore(deps): update dependency rimraf to v4
2023-02-09 11:12:51 +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
Alois Klink
4d12fb0464 build(lint:fix): cache eslint in pnpm run lint:fix
Cache eslint in `pnpm run lint:fix`.

This was added to the `pnpm run lint` script in
b7f9495 (build: add eslint --cache file, 2022-08-27), but we
didn't add it to `pnpm run lint:fix` due to worries about cache
invalidation.

However, we switched to using `--cache-strategy content` in
b3e509b7 (build(lint): cache eslint with strategy content, 2023-02-05),
which should avoid any caching issues.

Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
2023-02-09 00:21:19 +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
Alois Klink
b3e509b7d4 build(lint): cache eslint with strategy content
Cache eslint using `--cache-strategy content` instead of the default
`--cache-strategy metadata`.

By default, `eslint` uses the file metadata (e.g. modification time)
to detect when the cache should be invalidated.

However, this is not efficient with `git`, since git constantly changes
the modification time,
e.g. running `git switch main && git switch original-branch` would not
change the file contents, but would change the file mtimes and force
eslint to re-lint everything.

Using the file contents is slower (~3% for me), but more resilient.

See
https://eslint.org/docs/latest/use/command-line-interface#--cache-strategy
2023-02-05 19:33:30 +00:00
Alois Klink
8b4426aebf build(lint): cache prettier on pnpm run lint
[Prettier 2.7.0](https://prettier.io/blog/2022/06/14/2.7.0.html) added
a `--cache` CLI option to greatly speed up subsequent prettier runs.

By default, the cache is stored in
`./node_modules/.cache/prettier/.prettier-cache` and uses an `md5`
checksum of the contents as the cache-key.

On my PC, running `pnpm run lint` used to take 13.9 seconds, but now
it only takes 6 seconds.

Potential issues
----------------

Although updating Node.JS/Prettier will invalidate the cache,
updating or changing prettier plugins won't invalidate the cache.

Since we do use `prettier-plugin-jsdoc` in Mermaid, this might cause
a minor issue, but CI should catch it.
2023-01-26 16:31:40 +00:00
Sidharth Vinod
c256a6b887
Merge pull request #4024 from mermaid-js/renovate/patch-all-minor-patch
chore(deps): update pnpm to v7.25.1
2023-01-24 17:06:06 +05:30
renovate[bot]
c9833dcd79
chore(deps): update pnpm to v7.25.1 2023-01-24 10:43:54 +00: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
renovate[bot]
376d1a583c
chore(deps): update all non-major dependencies 2023-01-16 05:22:19 +00:00
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
1495ae623a
WIP Adding contributors page from vitest 2022-12-21 10:54:23 +05:30
renovate[bot]
e46e918b23 chore(deps): update pnpm to v7.18.2 2022-12-19 03:46:30 +00:00
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
renovate[bot]
a975c8c9cd chore(deps): update all non-major dependencies 2022-12-12 04:57:37 +00:00
Per Brolin
7656916cef Updated package number to 9.3.0-rc1 2022-12-08 15:03:51 +01: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
renovate[bot]
2984e4fc57 chore(deps): update pnpm to v7.17.1 2022-11-28 07:35:36 +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
Sidharth Vinod
f8b05f7d75
chore: Cleanup package.json 2022-11-23 16:07:58 +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
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
Knut Sveidqvist
050574f60f
Merge pull request #3706 from MasonM/feature/1433_title_support
feat: Title support via front matter for ER, state, class, git, and graph diagrams
2022-11-21 11:44:26 +01:00
renovate[bot]
b9f0c7c807 chore(deps): update pnpm to v7.17.0 2022-11-21 10:05:15 +00:00
Sidharth Vinod
4ad99a25d0
feat: Add package visualization 2022-11-20 14:16:22 +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
476917bda9 Revert "chore(deps): pin dependencies"
This reverts commit 17b72d565de595c94c1e339da37fc81676c4b200.
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
9144fa390f
cleanup 2022-11-14 15:05:58 +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