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>
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
[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.
* 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
...
* 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
...
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!)
* 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: (50 commits)
docs: Sync
capitalization fix
format Setup.md
format cSpell.json
format docs YAML
format cSpell.json
separate words & ignoreWords
fix: "skin param"
ignore the changelog
Revert "fix: "skin param""
fix: "skin param"
fix: "corresponding"
known terms
known terms
fix: "JetBrains"
known terms
known terms
fix: "stable"
known term
add known term
...
* 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
Re-enables the `pnpm run prepare` script.
The prepare script is automatically run when running
`pnpm install` locally.
It both:
- Sets up husky/git pre-commit scripts
- Builds the `packages/mermaid/dist` folder.
* 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
* develop: (30 commits)
Fix docs
Auto stash before merge of "develop" and "origin/develop"
vite -> cts
add lcov
chore(deps-dev): bump esbuild from 0.15.6 to 0.15.8
fix(docs): update link
CI Concurrency 4
Remove build
Parallel e2e
Revert "unify Jison tranformers"
Update yarn.lock
fix(docs): `mmd` detection
Hope this fails
Remove `docs:build` from postbuild.
Add verification log
This should fail CI
chore(deps-dev): bump @types/lodash from 4.14.184 to 4.14.185
Update integrations.md
Add vitepress pluin
Fix lint
...
* develop: (28 commits)
fix(docs): update link
Revert "unify Jison tranformers"
Update yarn.lock
Revert "fix(test): No esm exports"
fix(test): No esm exports
fix(docs): `mmd` detection
Hope this fails
unify Jison tranformers
Fix jest
Remove `docs:build` from postbuild.
Add verification log
This should fail CI
fix: imports in HTML
Revert "Add diagramAPI to outfile"
Add `type: module` to package.json
chore(deps-dev): bump @types/lodash from 4.14.184 to 4.14.185
Update integrations.md
Add vitepress pluin
Update mermaid version
Fix ports
...
* develop: (23 commits)
Revert #3475
chore: updyaate browsers list
Support EMPTYSTR in jison parser, add unit tests for git graph parser
Use undefined to mean default tagging behavior
feat(git): allow cherry-pick to suppress tag altogether
Update src/diagrams/git/parser/gitGraph.jison
fix(git): fix cherry-pick regex parsing error
test(git): add basic parsing test for cherry-pick
feat(git): cherry-pick keyword supports tag attribute
ci(e2e-applitols): add applitools CI action
Test docs:verify
Cleanup docs
Fixed Linting issues
ci(e2e): re-enable e2e tests
style: fix .github/workflow/e2e styling
chore: upgrade cypress to v10
fix(flowchart-v2): fix arrowMarkerAbsolute=true
test(e2e): fix most arrowMarkerAbsolute tests
text(e2e): give git tests consistent commit id
test(e2e): widen flowchart width to within 10%
...
* develop: (221 commits)
cleanup
Fix docs
Fix coverage
Fix for issues in errorhandling and class diagrams after refactoring
Replace GoogleAnalytics with Plausible
chore(deps): bump dompurify from 2.3.10 to 2.4.0 (#3444)
chore(deps): bump stylis from 4.1.1 to 4.1.2 (#3439)
chore(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#3450)
fix(git): support single character branch names
Cleanup unused variables and some commented out code
Cleanup fixing som lingering issues
Remove extension
Apply suggestions from code review
ci(e2e): re-enable e2e tests
style: fix .github/workflow/e2e styling
chore: upgrade cypress to v10
fix(flowchart-v2): fix arrowMarkerAbsolute=true
test(e2e): fix most arrowMarkerAbsolute tests
text(e2e): give git tests consistent commit id
test(e2e): widen flowchart width to within 10%
...
* develop:
cleanup
Fix docs
Fix coverage
Fix for issues in errorhandling and class diagrams after refactoring
Replace GoogleAnalytics with Plausible
fix(git): support single character branch names
Cleanup unused variables and some commented out code
ci(e2e): re-enable e2e tests
style: fix .github/workflow/e2e styling
chore: upgrade cypress to v10
fix(flowchart-v2): fix arrowMarkerAbsolute=true
test(e2e): fix most arrowMarkerAbsolute tests
text(e2e): give git tests consistent commit id
test(e2e): widen flowchart width to within 10%
test(e2e): fix failing xss9 test
* develop: (77 commits)
cleanup
Fix docs
Fix coverage
Fix for issues in errorhandling and class diagrams after refactoring
Replace GoogleAnalytics with Plausible
chore(deps): bump dompurify from 2.3.10 to 2.4.0 (#3444)
chore(deps): bump stylis from 4.1.1 to 4.1.2 (#3439)
chore(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#3450)
fix(git): support single character branch names
Cleanup unused variables and some commented out code
Cleanup fixing som lingering issues
Remove extension
Apply suggestions from code review
ci(e2e): re-enable e2e tests
style: fix .github/workflow/e2e styling
chore: upgrade cypress to v10
fix(flowchart-v2): fix arrowMarkerAbsolute=true
test(e2e): fix most arrowMarkerAbsolute tests
text(e2e): give git tests consistent commit id
test(e2e): widen flowchart width to within 10%
...
* sidv/esbuild: (115 commits)
cleanup
Fix docs
Fix coverage
Fix for issues in errorhandling and class diagrams after refactoring
Replace GoogleAnalytics with Plausible
chore(deps): bump dompurify from 2.3.10 to 2.4.0 (#3444)
chore(deps): bump stylis from 4.1.1 to 4.1.2 (#3439)
chore(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#3450)
fix(git): support single character branch names
Cleanup unused variables and some commented out code
Cleanup fixing som lingering issues
Remove extension
Apply suggestions from code review
chore(deps-dev): bump eslint-plugin-jest from 27.0.1 to 27.0.4 (#3458)
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#3457)
chore(deps-dev): bump concurrently from 7.3.0 to 7.4.0 (#3445)
chore(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.0 (#3442)
chore(deps-dev): bump @typescript-eslint/parser from 5.36.1 to 5.37.0 (#3451)
chore(deps-dev): bump @babel/core from 7.18.13 to 7.19.0 (#3447)
chore(deps-dev): bump jest-environment-jsdom from 29.0.2 to 29.0.3 (#3441)
...
* sidv/esbuild:
chore(deps): bump dompurify from 2.3.10 to 2.4.0 (#3444)
chore(deps): bump stylis from 4.1.1 to 4.1.2 (#3439)
chore(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#3450)
Cleanup fixing som lingering issues
Apply suggestions from code review
chore: fix eslint warnings
chore: Turn off eslint rules in spec, demos, etc.
* develop: (56 commits)
chore(deps): bump dompurify from 2.3.10 to 2.4.0 (#3444)
chore(deps): bump stylis from 4.1.1 to 4.1.2 (#3439)
chore(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#3450)
Cleanup fixing som lingering issues
Apply suggestions from code review
chore(deps-dev): bump eslint-plugin-jest from 27.0.1 to 27.0.4 (#3458)
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#3457)
chore(deps-dev): bump concurrently from 7.3.0 to 7.4.0 (#3445)
chore(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.0 (#3442)
chore(deps-dev): bump @typescript-eslint/parser from 5.36.1 to 5.37.0 (#3451)
chore(deps-dev): bump @babel/core from 7.18.13 to 7.19.0 (#3447)
chore(deps-dev): bump jest-environment-jsdom from 29.0.2 to 29.0.3 (#3441)
chore(deps-dev): bump babel-jest from 29.0.2 to 29.0.3 (#3448)
chore(deps-dev): bump eslint from 8.23.0 to 8.23.1
chore: fix eslint warnings
chore: Turn off eslint rules in spec, demos, etc.
chore(deps-dev): bump typescript from 4.8.2 to 4.8.3 (#3446)
chore(deps): bump actions/checkout from 2 to 3 (#3449)
change wording of console log message (use comma)
Moving out tests from mermaid.spec.js
...
* sidv/mergeRelease:
chore(deps-dev): bump eslint-plugin-jest from 27.0.1 to 27.0.4 (#3458)
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#3457)
chore(deps-dev): bump concurrently from 7.3.0 to 7.4.0 (#3445)
chore(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.0 (#3442)
chore(deps-dev): bump @typescript-eslint/parser from 5.36.1 to 5.37.0 (#3451)
chore(deps-dev): bump @babel/core from 7.18.13 to 7.19.0 (#3447)
chore(deps-dev): bump jest-environment-jsdom from 29.0.2 to 29.0.3 (#3441)
chore(deps-dev): bump babel-jest from 29.0.2 to 29.0.3 (#3448)
chore(deps-dev): bump eslint from 8.23.0 to 8.23.1
Release 9.1.7
Fix for broken rendering test
Fix for issue #3428, load the configured diagrams even when initialize has not been called.
Cypress v10 had some minor breaking changes,
(e.g. the cypress/plugins folder dissapeared)
so I had to change some things.
It looks like the Cypress was previously reverted in [dee9cfe][1],
due to applitools not working properly,
but I think my changes fix this, so it should be okay.
[1]: dee9cfea85
`mermaid.core.mjs` should be the default export.
This is because it does not bundle `node_modules/`, allowing users of
mermaid to bundle dependencies themselves,
using Webpack/ESBuild/others.