Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/11.0.0 #5734

Merged
merged 1,175 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1175 commits
Select commit Hold shift + click to select a range
4e55f4c
chore: eslint autofix
sidharthv96 Jun 30, 2024
06377b8
chore: Fix eslint errors
sidharthv96 Jun 30, 2024
775d8bb
chore: update browsers list
cmmoran Jul 1, 2024
771d3fc
Remove logs
sidharthv96 Jul 1, 2024
00467c6
Adds Doctave to list of integrations
begleynk Jul 1, 2024
ec27270
Add Doctave to .cspell libraries
begleynk Jul 1, 2024
254ec07
Sync docs folder
begleynk Jul 1, 2024
6337470
Merge pull request #5603 from mermaid-js/sidv/eslintv9
sidharthv96 Jul 1, 2024
efd5cf1
Added test for divider alignment
ashishjain0512 Jul 1, 2024
95d629e
Merge pull request #5614 from begleynk/patch-1
sidharthv96 Jul 1, 2024
49c6c4d
chore(deps): update all patch dependencies
renovate[bot] Jul 1, 2024
f78f3e7
chore(deps): update dependency eslint-plugin-jsdoc to v48.5.0
renovate[bot] Jul 1, 2024
6e35c32
Merge pull request #5610 from mermaid-js/renovate/patch-all-patch
sidharthv96 Jul 1, 2024
2c2bd62
Merge pull request #5613 from mermaid-js/update-browserslist
sidharthv96 Jul 1, 2024
934a761
Merge pull request #5611 from mermaid-js/renovate/eslint
sidharthv96 Jul 1, 2024
b5b2bc4
chore: Remove "sideEffects: false"
sidharthv96 Jul 1, 2024
364511b
chore(deps): update dependency eslint-plugin-unicorn to v54
renovate[bot] Jul 1, 2024
161506b
Merge pull request #5612 from mermaid-js/renovate/major-eslint
sidharthv96 Jul 1, 2024
9a638ec
#5237 Fix for rough styling of regular states and dividers in state d…
knsv Jul 2, 2024
772a7fc
5237 New default width for flowchart edges
knsv Jul 2, 2024
f3474fa
Merge branch '5237-unified-layout-common-renderer' into sidv/5237_Cle…
sidharthv96 Jul 3, 2024
caf8341
Fix fro direction in layout data
ashishjain0512 Jul 3, 2024
d0b712f
#5237 Handling of subgraphs using elk
knsv Jul 3, 2024
345e3cd
#5237 Handling of subgraphs using elk
knsv Jul 3, 2024
8aa85d7
chnages from knut
ashishjain0512 Jul 3, 2024
9930d29
Merge branch '5237-unified-layout-common-renderer' of github.com:merm…
knsv Jul 3, 2024
d12cdf4
fix for note with a composite state
ashishjain0512 Jul 3, 2024
017a86b
#5237 Fix for diamond intersections with ELK
knsv Jul 3, 2024
9167038
Merge branch '5237-unified-layout-common-renderer' of github.com:merm…
knsv Jul 3, 2024
81419d1
MC-5237 Updates from review
sidharthv96 Jul 3, 2024
8db678a
#5237 Fix for diamond intersections with ELK, tweak
knsv Jul 3, 2024
6b7d78e
#5237 Fix fir subgraphs with elk
knsv Jul 3, 2024
fde668a
ci: upgrade to pnpm/action-setup@v4 to avoid CI failures
frantic1048 Jul 4, 2024
03a6346
Merge branch '5237-unified-layout-common-renderer' into sidv/5237_Cle…
sidharthv96 Jul 4, 2024
7f81569
Merge pull request #5621 from frantic1048/ci-bump-pnpm-action-setup-t…
sidharthv96 Jul 4, 2024
f014061
Merge branch 'develop' into pr/dontry/5607
sidharthv96 Jul 4, 2024
adf4351
Merge pull request #5607 from dontry/chore/bump-zenuml-core-version
sidharthv96 Jul 4, 2024
8ea7d5b
fix for direction
ashishjain0512 Jul 4, 2024
7f185d0
fix for direction
ashishjain0512 Jul 4, 2024
a80dd71
fix(class): #5624 Reset direction to default in classDiagram
sidharthv96 Jul 7, 2024
b263164
Merge pull request #5625 from mermaid-js/fix/5624_ClassDirection
sidharthv96 Jul 7, 2024
5dbe3ee
chore(deps): update eslint
renovate[bot] Jul 8, 2024
01fa7e6
chore: update browsers list
cmmoran Jul 8, 2024
e63b5a7
Merge pull request #5606 from mermaid-js/sidv/5237_Cleanup
ashishjain0512 Jul 8, 2024
fe22a5f
fix flowchart edges
ashishjain0512 Jul 8, 2024
c7e1b45
Merge pull request #5630 from mermaid-js/update-browserslist
sidharthv96 Jul 8, 2024
d44c65e
Merge pull request #5627 from mermaid-js/renovate/patch-eslint
sidharthv96 Jul 8, 2024
aa1432a
fix(deps): update all patch dependencies
renovate[bot] Jul 8, 2024
728334b
Merge pull request #5628 from mermaid-js/renovate/patch-all-patch
sidharthv96 Jul 9, 2024
6b7f33e
feat: Add threshold to argos test
sidharthv96 Jul 9, 2024
1929463
Merge pull request #5633 from mermaid-js/sidv/argosThreshold
sidharthv96 Jul 9, 2024
d686cee
ci: Do not run parallel in push to develop
sidharthv96 Jul 10, 2024
0d11035
chore: Add new test
sidharthv96 Jul 10, 2024
8bdd37c
chore: Fix boolean check in e2e.yml
sidharthv96 Jul 10, 2024
4434cf3
chore: Fix boolean check in e2e.yml
sidharthv96 Jul 10, 2024
4eba114
Merge branch 'develop' into sidv/testDevelopCI
sidharthv96 Jul 10, 2024
7afff87
Merge pull request #5635 from mermaid-js/sidv/testDevelopCI
sidharthv96 Jul 10, 2024
aa279f6
fix flowchart title class
ashishjain0512 Jul 10, 2024
9cb959b
fix flowchart subgraph label
ashishjain0512 Jul 10, 2024
cc6eae2
feat: Use marked instead of mdast-util-from-markdown
sidharthv96 Jul 11, 2024
7a45ed8
fix: lint issue
ashishjain0512 Jul 12, 2024
84b5179
docs: fix the classDef example in stateDiagram not display as code bl…
ScriptBloom Jul 12, 2024
4bb75e5
Merge pull request #5640 from ScriptBloom/docs/5639_optimize-state-di…
sidharthv96 Jul 13, 2024
207bc7c
chore: Fix emphasis type
sidharthv96 Jul 13, 2024
644199d
test: Change emphasis to em
sidharthv96 Jul 13, 2024
d71fe28
fix: Handle spaces after newline
sidharthv96 Jul 13, 2024
720aef6
fix: emphasis => em
sidharthv96 Jul 13, 2024
df87242
chore: Use single quotes
sidharthv96 Jul 13, 2024
3698c2b
fix: Handle negative numbers in `formatBytes`
sidharthv96 Jul 13, 2024
70dcfc8
chore: move abs below return check
sidharthv96 Jul 13, 2024
8b5b1d4
Merge branch 'develop' into sidv/marked
sidharthv96 Jul 13, 2024
9343c6f
typo
inverted-capital Jul 14, 2024
587c3c8
chore(deps): update eslint
renovate[bot] Jul 15, 2024
cdb87c1
chore: update browsers list
cmmoran Jul 15, 2024
8950fb1
fix: lint & build issue
ashishjain0512 Jul 15, 2024
6ead2e1
fix: typo issue
ashishjain0512 Jul 15, 2024
061aaf6
fix: typo issue
ashishjain0512 Jul 15, 2024
2fb50a2
fix: typo issue
ashishjain0512 Jul 15, 2024
dd7b071
Update docs
ashishjain0512 Jul 15, 2024
f9a20ab
fix: broken test, link style
ashishjain0512 Jul 15, 2024
d2a73bc
fix: mocked SVG element
ashishjain0512 Jul 15, 2024
3681a7a
Merge pull request #5644 from mermaid-js/renovate/eslint
sidharthv96 Jul 16, 2024
b1b480a
Merge pull request #5636 from mermaid-js/sidv/marked
sidharthv96 Jul 16, 2024
594f218
feat: implement multiple tags
Yash-Singh1 Jul 16, 2024
74c6fc3
fix: tests
Yash-Singh1 Jul 16, 2024
05a3806
feat: cherry picks with multiple tags
Yash-Singh1 Jul 16, 2024
5868a96
test: git graph
Yash-Singh1 Jul 16, 2024
b6a03fc
Merge branch 'develop' into fix/3801
Yash-Singh1 Jul 16, 2024
bfeab9e
test: e2e left-right
Yash-Singh1 Jul 16, 2024
acb799c
test: e2e bottom-top
Yash-Singh1 Jul 16, 2024
38a7a47
chore: push better live editor script alongside
Yash-Singh1 Jul 16, 2024
ab1a2ec
fix: clone if editor doesnt exist in script
Yash-Singh1 Jul 17, 2024
99644ba
fix: double space in wrapped sequence diagram messages
Yash-Singh1 Jul 17, 2024
b3dfb5a
merge from develop
ashishjain0512 Jul 17, 2024
5a6edf2
Merge pull request #5649 from mermaid-js/fix/wrap-double-space
Yash-Singh1 Jul 17, 2024
15c85ef
fix for broken images, htmlLabel false issues
ashishjain0512 Jul 17, 2024
eb714eb
chore: Cleanup getConfig()
sidharthv96 Jul 18, 2024
fd8f3c3
Add autofix.ci
sidharthv96 Jul 18, 2024
c269f6f
chore: Remove update step from lint.yml
sidharthv96 Jul 18, 2024
dd18cd1
docs: Test autofix.ci
sidharthv96 Jul 18, 2024
c5cf555
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 18, 2024
7db2de3
Merge pull request #5651 from mermaid-js/sidv/autofix
sidharthv96 Jul 18, 2024
bcc998c
Merge branch 'develop' into patch-1
sidharthv96 Jul 18, 2024
7389b94
Merge branch 'develop' into patch-1
sidharthv96 Jul 18, 2024
7dda1f5
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 18, 2024
aba109a
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 18, 2024
bae2741
Merge pull request #5591 from DannyBen/patch-1
sidharthv96 Jul 18, 2024
4bf52cc
Merge pull request #5645 from mermaid-js/update-browserslist
sidharthv96 Jul 18, 2024
5b86fe3
Update lockfile
sidharthv96 Jul 18, 2024
932260f
Merge pull request #5641 from inverted-capital/patch-1
sidharthv96 Jul 18, 2024
9b77c8a
chore(deps): update dependency typescript-eslint to v8.0.0-alpha.44
renovate[bot] Jul 18, 2024
f30d370
fix for other styling fixes
ashishjain0512 Jul 18, 2024
63850fd
#5237 Fix for issue from failing test, self loops to/from clusters
knsv Jul 18, 2024
09c5c62
Merge branch '5237-unified-layout-common-renderer' of github.com:merm…
knsv Jul 18, 2024
138ee49
fix for broken katex,state,error spec
ashishjain0512 Jul 18, 2024
61f55fe
Merge pull request #5647 from mermaid-js/fix/3801
sidharthv96 Jul 18, 2024
3c3d28d
Merge pull request #5643 from mermaid-js/renovate/patch-eslint
sidharthv96 Jul 18, 2024
5b47950
merge from develop
ashishjain0512 Jul 19, 2024
d96dcd2
#5237 Updated configuration schema for elk layout
knsv Jul 19, 2024
7175f57
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 19, 2024
2718cda
#5237 Fix for issues generated by linkting/cleanup
knsv Jul 19, 2024
86e4642
fix review comments
ashishjain0512 Jul 19, 2024
2800f55
fix lint issue
ashishjain0512 Jul 19, 2024
f20d89e
Remove `elkjs` dependency from mermaid package
Gusted Jul 19, 2024
0ad2282
chore: update browsers list
cmmoran Jul 22, 2024
fca35a3
Merge pull request #5654 from Gusted/elkjs
sidharthv96 Jul 22, 2024
ee88932
chore(deps): update autofix-ci/action digest to ff86a55
renovate[bot] Jul 22, 2024
1c0cb8b
Adding base theme to config.schema
knsv Jul 22, 2024
7bc7585
Merge pull request #5658 from mermaid-js/update-browserslist
sidharthv96 Jul 22, 2024
c91dc7d
Merge pull request #5656 from mermaid-js/renovate/autofix-ci-action-d…
sidharthv96 Jul 22, 2024
d809d8b
chore(deps): update dependency typescript-eslint to v8.0.0-alpha.49
renovate[bot] Jul 22, 2024
c0bf6d8
Merge pull request #5657 from mermaid-js/renovate/patch-eslint
sidharthv96 Jul 23, 2024
b79191e
chore: Simplify dataFetcher helper functions
sidharthv96 Jul 27, 2024
cdca63d
chore: Simplify dataFetcher helper functions
sidharthv96 Jul 27, 2024
6b336cb
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 27, 2024
2fdcb0b
chore(deps): update eslint
renovate[bot] Jul 29, 2024
1f44d11
Merge pull request #5672 from mermaid-js/renovate/eslint
sidharthv96 Jul 29, 2024
c4ce854
5237 Fix for edges to diamond shapes
knsv Jul 31, 2024
aa24229
#5237 Fix for issue with styling rectWithTitle
knsv Aug 1, 2024
f7ed91b
chore: Bump parser version
sidharthv96 Aug 2, 2024
09c966b
chore(deps): update dependency typescript-eslint to v8.0.0
renovate[bot] Aug 2, 2024
3f4c346
Merge pull request #5671 from mermaid-js/renovate/patch-eslint
sidharthv96 Aug 3, 2024
53e5f3a
chore(deps): update dependency eslint-plugin-unicorn to v55
renovate[bot] Aug 5, 2024
61cc2fc
#5237 Fix for issue with edge routing for elk layout
knsv Aug 5, 2024
e32151c
Merge pull request #5690 from mermaid-js/renovate/major-eslint
sidharthv96 Aug 6, 2024
6cd0585
chore(deps): update eslint
renovate[bot] Aug 6, 2024
47601ac
Merge pull request #5689 from mermaid-js/renovate/eslint
sidharthv96 Aug 7, 2024
c2a479a
Adding elk test
knsv Aug 9, 2024
729080f
#5237 Fixes from comments
knsv Aug 9, 2024
ba0d216
#5237 Removing old flowchart renderer
knsv Aug 9, 2024
537512f
#5237 Replace generic object with Map
knsv Aug 9, 2024
d4d7ca7
review comment fixes
ashishjain0512 Aug 9, 2024
95fb824
merge commit
ashishjain0512 Aug 9, 2024
095e8ca
sequence diagram NaN values issue
ashishjain0512 Aug 9, 2024
afb69a3
#5237 Async fix for clusters
knsv Aug 9, 2024
02eb8da
Merge branch '5237-unified-layout-common-renderer' of github.com:merm…
knsv Aug 9, 2024
9b9f4ea
adding handDrawn cypress test
ashishjain0512 Aug 9, 2024
734f1ad
Updated handDrawn cypress test
ashishjain0512 Aug 9, 2024
db725c1
#5237 Fix for subroutine positioning
knsv Aug 9, 2024
39fdaef
merge commit
ashishjain0512 Aug 9, 2024
7f9d4cd
#5237 Fix for text alignment for handdrawn text using svg labels
knsv Aug 12, 2024
3b2bb5a
Merge from develop
ashishjain0512 Aug 12, 2024
2352137
Fixed lint issue
ashishjain0512 Aug 12, 2024
d242395
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 12, 2024
61cfb15
Fixed broken test
ashishjain0512 Aug 12, 2024
d2bbe83
Removed the un-necessary test
ashishjain0512 Aug 12, 2024
9b42ffd
Ignore codeql warning
ashishjain0512 Aug 12, 2024
87b2084
Merge pull request #5604 from mermaid-js/5237-unified-layout-common-r…
ashishjain0512 Aug 12, 2024
c5eb07c
fix: Making insertCluster async
knsv Aug 13, 2024
79d50eb
add MonsterWriter to list of community integrations
Aug 17, 2024
bd02373
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 17, 2024
0faeeb6
Merge branch 'develop' into sidv/5237_review
sidharthv96 Aug 20, 2024
4e40f29
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 20, 2024
6205ddd
Merge pull request #5719 from wolfoo2931/develop
sidharthv96 Aug 20, 2024
210f8c2
Merge pull request #5399 from FutzMonitor/5356Issue
sidharthv96 Aug 20, 2024
22168ed
Merge branch 'develop' into fix/RequirementDiagramOverflow
sidharthv96 Aug 20, 2024
f63eb45
Merge branch 'develop' into pr/FutzMonitor/5335
sidharthv96 Aug 20, 2024
262bf4e
chore: Simplify unit test
sidharthv96 Aug 20, 2024
d5432ce
Merge pull request #5305 from Mikek16/fix/RequirementDiagramOverflow
sidharthv96 Aug 20, 2024
4e7d650
Revert #5305
sidharthv96 Aug 20, 2024
04c29e2
Merge pull request #5335 from FutzMonitor/4175Issue-allowSemicolons
sidharthv96 Aug 20, 2024
6b5286e
refactor!(git): default to `useMaxWidth` true
aloisklink Jun 17, 2024
d82958d
refactor!(sankey): default to `useMaxWidth` true
aloisklink Aug 20, 2024
3ee1933
fix: Create a copy of config passed in initialize, so that theme vari…
sidharthv96 Aug 20, 2024
78fbf36
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 20, 2024
f76cab1
#5726 Setting the default margin
knsv Aug 20, 2024
1168db6
#5726 Refactor paragraph margin in mermaid styles
knsv Aug 20, 2024
a48d970
Merge pull request #5723 from aloisklink/fix/default-gitGraph-useMaxW…
knsv Aug 20, 2024
c5dfa42
Merge pull request #5724 from aloisklink/fix/default-sankey-useMaxWid…
knsv Aug 20, 2024
6df6f5a
Merge pull request #5725 from mermaid-js/sidv/copyInitOptions
knsv Aug 20, 2024
25efa4e
Merge pull request #5727 from mermaid-js/5726_doctype
knsv Aug 20, 2024
1956d3d
Merge pull request #5670 from mermaid-js/sidv/5237_review
sidharthv96 Aug 20, 2024
21efbbd
chore: Skip running autofix.ci on renovate branches
sidharthv96 Aug 20, 2024
8fdeb6d
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
sidharthv96 Aug 20, 2024
69b3a9d
feat: Support fallback layouts in renderer
sidharthv96 Aug 21, 2024
754fa24
chore: Remove redundant flowDiagram-v2
sidharthv96 Aug 21, 2024
bc3fe33
feat: Set config.layout=elk when using flowchart-elk
sidharthv96 Aug 21, 2024
77118ad
feat: Use dagre as fallback if elk layout is not present
sidharthv96 Aug 21, 2024
c140e1a
chore: Update pnpm and lockfile
sidharthv96 Aug 21, 2024
4487569
chore: Remove `mermaid-flowchart-elk`
sidharthv96 Aug 21, 2024
4e126e1
chore: Cleanup layoutelk
sidharthv96 Aug 21, 2024
0cc7eb7
Merge pull request #5728 from mermaid-js/sidv/updatePNPM
sidharthv96 Aug 21, 2024
58aa4c4
Merge branch 'develop' into elk-migration
sidharthv96 Aug 21, 2024
04e205b
Merge branch 'elk-migration' into sidv/cleanupLayoutElk
sidharthv96 Aug 21, 2024
43ffb00
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 21, 2024
ed07a9e
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 21, 2024
50a5351
chore: Use default export
sidharthv96 Aug 21, 2024
db8a002
docs: Add Readme
sidharthv96 Aug 21, 2024
797877b
chore: Use spaces
sidharthv96 Aug 21, 2024
f4097df
Merge pull request #5729 from mermaid-js/elk-migration
knsv Aug 21, 2024
b2db7eb
Merge branch 'elk-migration' into sidv/cleanupLayoutElk
sidharthv96 Aug 21, 2024
c1cd39b
Merge branch 'develop' into sidv/cleanupLayoutElk
sidharthv96 Aug 21, 2024
01b5935
chore: ts-ignore errors
sidharthv96 Aug 21, 2024
c5be9fd
chore: Move render function to bottom
sidharthv96 Aug 21, 2024
f6e1515
feat: Inject internal helpers into render function
sidharthv96 Aug 21, 2024
4d7b1e8
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 21, 2024
037ba2f
chore: Rename Group to SVGGroup
sidharthv96 Aug 21, 2024
3593fa6
fix: Type of render
sidharthv96 Aug 21, 2024
7c81096
Merge branch 'sidv/cleanupLayoutElk' of https://github.com/mermaid-js…
sidharthv96 Aug 21, 2024
8ffd198
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 21, 2024
10c2534
#5237 Removing unused code
knsv Aug 21, 2024
9134e1c
#5237 Clean and fix for issue with edges to the diamond shape
knsv Aug 21, 2024
0b9554c
Merge pull request #5730 from mermaid-js/sidv/cleanupLayoutElk
knsv Aug 21, 2024
f1c066b
Merge branch 'develop' into release/11.0.0
knsv Aug 21, 2024
47ac57b
Removing the redundant element in the render function
knsv Aug 22, 2024
0a0546e
chore: Fix build issue
sidharthv96 Aug 22, 2024
4da4793
Revert pnpm-lock changes
sidharthv96 Aug 22, 2024
225115a
Fix docs
sidharthv96 Aug 22, 2024
95e47d2
#5237 Proper setting of the handdrawn seed in the visual tests
knsv Aug 22, 2024
44037c0
Merge branch 'release/11.0.0' of github.com:mermaid-js/mermaid into r…
knsv Aug 22, 2024
0e68788
Merge branch 'release/11.0.0' of https://github.com/mermaid-js/mermai…
sidharthv96 Aug 22, 2024
a9d317f
docs: Update release version
sidharthv96 Aug 22, 2024
4665b6b
docs: Update release version
sidharthv96 Aug 22, 2024
2fe5e67
Merge branch 'master' into develop
sidharthv96 Aug 22, 2024
53bff11
Merge branch 'develop' into release/11.0.0
sidharthv96 Aug 22, 2024
0ad44c1
chore: Fix peer dependencies
sidharthv96 Aug 22, 2024
ae2dc70
chore: Update lockfile
sidharthv96 Aug 22, 2024
19d46fc
#5237 Fix for weird line intersection
knsv Aug 22, 2024
8c4c92a
Merge pull request #5737 from mermaid-js/sidv/fixPeerDependency
sidharthv96 Aug 22, 2024
029a444
Merge branch 'develop' into release/11.0.0
sidharthv96 Aug 22, 2024
99ee235
Fix for text alignment issue
ashishjain0512 Aug 22, 2024
09afb07
Basic fix for handdrawn subgraph styling
knsv Aug 23, 2024
24490f7
Update ComboStrap link
sidharthv96 Aug 23, 2024
14a94c0
Merge branch 'develop' into release/11.0.0
sidharthv96 Aug 23, 2024
46b7ee8
Fix for turned arrow heads and missing edge sections
knsv Aug 23, 2024
fdf376f
Merge branch 'release/11.0.0' of github.com:mermaid-js/mermaid into r…
knsv Aug 23, 2024
48fd76e
Fix for selecting the correct diagramPadding for flowcharts
knsv Aug 23, 2024
efba4c1
Updating syntax reference with code showing how to select layout and …
knsv Aug 23, 2024
dd57030
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 23, 2024
21c636c
Run release drafter in release branch
sidharthv96 Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .build/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Shared common options for both ESBuild and Vite
*/
export const packageOptions = {
parser: {
name: 'mermaid-parser',
packageName: 'parser',
file: 'index.ts',
},
mermaid: {
name: 'mermaid',
packageName: 'mermaid',
file: 'mermaid.ts',
},
'mermaid-example-diagram': {
name: 'mermaid-example-diagram',
packageName: 'mermaid-example-diagram',
file: 'detector.ts',
},
'mermaid-zenuml': {
name: 'mermaid-zenuml',
packageName: 'mermaid-zenuml',
file: 'detector.ts',
},
'mermaid-layout-elk': {
name: 'mermaid-layout-elk',
packageName: 'mermaid-layout-elk',
file: 'layouts.ts',
},
} as const;
5 changes: 5 additions & 0 deletions .build/generateLangium.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generate } from 'langium-cli';

export async function generateLangium() {
await generate({ file: `./packages/parser/langium-config.json` });
}
1 change: 1 addition & 0 deletions .vite/jisonTransformer.ts → .build/jisonTransformer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import jison from 'jison';

export const transformJison = (src: string): string => {
// @ts-ignore - Jison is not typed properly
const parser = new jison.Generator(src, {
moduleType: 'js',
'token-stack': true,
Expand Down
124 changes: 124 additions & 0 deletions .build/jsonSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import { load, JSON_SCHEMA } from 'js-yaml';
import assert from 'node:assert';
import Ajv2019, { type JSONSchemaType } from 'ajv/dist/2019.js';
import type { MermaidConfig, BaseDiagramConfig } from '../packages/mermaid/src/config.type.js';

/**
* All of the keys in the mermaid config that have a mermaid diagram config.
*/
const MERMAID_CONFIG_DIAGRAM_KEYS = [
'flowchart',
'sequence',
'gantt',
'journey',
'class',
'state',
'er',
'pie',
'quadrantChart',
'xyChart',
'requirement',
'mindmap',
'timeline',
'gitGraph',
'c4',
'sankey',
'block',
'packet',
] as const;

/**
* Generate default values from the JSON Schema.
*
* AJV does not support nested default values yet (or default values with $ref),
* so we need to manually find them (this may be fixed in ajv v9).
*
* @param mermaidConfigSchema - The Mermaid JSON Schema to use.
* @returns The default mermaid config object.
*/
function generateDefaults(mermaidConfigSchema: JSONSchemaType<MermaidConfig>) {
const ajv = new Ajv2019({
useDefaults: true,
allowUnionTypes: true,
strict: true,
});

ajv.addKeyword({
keyword: 'meta:enum', // used by jsonschema2md
errors: false,
});
ajv.addKeyword({
keyword: 'tsType', // used by json-schema-to-typescript
errors: false,
});

// ajv currently doesn't support nested default values, see https://github.com/ajv-validator/ajv/issues/1718
// (may be fixed in v9) so we need to manually use sub-schemas
const mermaidDefaultConfig = {};

assert.ok(mermaidConfigSchema.$defs);
const baseDiagramConfig = mermaidConfigSchema.$defs.BaseDiagramConfig;

for (const key of MERMAID_CONFIG_DIAGRAM_KEYS) {
const subSchemaRef = mermaidConfigSchema.properties[key].$ref;
const [root, defs, defName] = subSchemaRef.split('/');
assert.strictEqual(root, '#');
assert.strictEqual(defs, '$defs');
const subSchema = {
$schema: mermaidConfigSchema.$schema,
$defs: mermaidConfigSchema.$defs,
...mermaidConfigSchema.$defs[defName],
} as JSONSchemaType<BaseDiagramConfig>;

const validate = ajv.compile(subSchema);

mermaidDefaultConfig[key] = {};

for (const required of subSchema.required ?? []) {
if (subSchema.properties[required] === undefined && baseDiagramConfig.properties[required]) {
mermaidDefaultConfig[key][required] = baseDiagramConfig.properties[required].default;
}
}
if (!validate(mermaidDefaultConfig[key])) {
throw new Error(
`schema for subconfig ${key} does not have valid defaults! Errors were ${JSON.stringify(
validate.errors,
undefined,
2
)}`
);
}
}

const validate = ajv.compile(mermaidConfigSchema);

if (!validate(mermaidDefaultConfig)) {
throw new Error(
`Mermaid config JSON Schema does not have valid defaults! Errors were ${JSON.stringify(
validate.errors,
undefined,
2
)}`
);
}

return mermaidDefaultConfig;
}

export const loadSchema = (src: string, filename: string): JSONSchemaType<MermaidConfig> => {
const jsonSchema = load(src, {
filename,
// only allow JSON types in our YAML doc (will probably be default in YAML 1.3)
// e.g. `true` will be parsed a boolean `true`, `True` will be parsed as string `"True"`.
schema: JSON_SCHEMA,
}) as JSONSchemaType<MermaidConfig>;
return jsonSchema;
};

export const getDefaults = (schema: JSONSchemaType<MermaidConfig>) => {
return `export default ${JSON.stringify(generateDefaults(schema), undefined, 2)};`;
};

export const getSchema = (schema: JSONSchemaType<MermaidConfig>) => {
return `export default ${JSON.stringify(schema, undefined, 2)};`;
};
25 changes: 25 additions & 0 deletions .build/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* eslint-disable no-console */
import { packageOptions } from './common.js';
import { execSync } from 'child_process';

const buildType = (packageName: string) => {
console.log(`Building types for ${packageName}`);
try {
const out = execSync(`tsc -p ./packages/${packageName}/tsconfig.json --emitDeclarationOnly`);
if (out.length > 0) {
console.log(out.toString());
}
} catch (e) {
console.error(e);
if (e.stdout.length > 0) {
console.error(e.stdout.toString());
}
if (e.stderr.length > 0) {
console.error(e.stderr.toString());
}
}
};

for (const { packageName } of Object.values(packageOptions)) {
buildType(packageName);
}
3 changes: 0 additions & 3 deletions .commitlintrc.json

This file was deleted.

11 changes: 11 additions & 0 deletions .cspell/code-terms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ bqstring
BQUOTE
bramp
BRKT
brotli
callbackargs
callbackname
classdef
Expand All @@ -27,6 +28,7 @@ controly
CSSCLASS
CYLINDEREND
CYLINDERSTART
DAGA
datakey
DEND
descr
Expand All @@ -53,6 +55,7 @@ GENERICTYPE
getBoundarys
grammr
graphtype
iife
interp
introdcued
INVTRAPEND
Expand All @@ -74,18 +77,21 @@ loglevel
LOGMSG
lookaheads
mdast
metafile
minlen
Mstartx
MULT
NODIR
NSTR
outdir
Qcontrolx
reinit
rels
reqs
rewritelinks
rgba
RIGHTOF
roughjs
sankey
sequencenumber
shrc
Expand All @@ -105,13 +111,17 @@ strikethrough
stringifying
struct
STYLECLASS
STYLEDEF
STYLEOPTS
subcomponent
subcomponents
subconfig
SUBROUTINEEND
SUBROUTINESTART
Subschemas
substr
SVGG
SVGSVG
TAGEND
TAGSTART
techn
Expand All @@ -122,6 +132,7 @@ titlevalue
topbar
TRAPEND
TRAPSTART
treemap
ts-nocheck
tsdoc
typeof
Expand Down
1 change: 1 addition & 0 deletions .cspell/contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ cpettitt
Dong Cai
Nikolay Rozhkov
Peng Xiao
Per Brolin
subhash-halder
Vinod Sidharth
4 changes: 4 additions & 0 deletions .cspell/libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dagre-d3
Deepdwn
Docsify
Docsy
Doctave
DokuWiki
dompurify
elkjs
Expand Down Expand Up @@ -54,14 +55,17 @@ presetAttributify
pyplot
redmine
rehype
roughjs
rscratch
shiki
Slidev
sparkline
sphinxcontrib
ssim
stylis
Swimm
tsbuildinfo
tseslint
Tuleap
Typora
unocss
Expand Down
2 changes: 2 additions & 0 deletions .cspell/mermaid-terms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ elems
gantt
gitgraph
gzipped
handDrawn
knsv
Knut
marginx
Expand All @@ -17,6 +18,7 @@ Markdownish
mermaidjs
mindmap
mindmaps
mrtree
multigraph
nodesep
NOTEGROUP
Expand Down
5 changes: 5 additions & 0 deletions .cspell/misc-terms.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
BRANDES
circo
handDrawn
KOEPF
neato
newbranch
67 changes: 67 additions & 0 deletions .esbuild/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { build } from 'esbuild';
import { mkdir, writeFile } from 'node:fs/promises';
import { packageOptions } from '../.build/common.js';
import { generateLangium } from '../.build/generateLangium.js';
import type { MermaidBuildOptions } from './util.js';
import { defaultOptions, getBuildConfig } from './util.js';

const shouldVisualize = process.argv.includes('--visualize');

const buildPackage = async (entryName: keyof typeof packageOptions) => {
const commonOptions: MermaidBuildOptions = { ...defaultOptions, entryName } as const;
const buildConfigs: MermaidBuildOptions[] = [
// package.mjs
{ ...commonOptions },
// package.min.mjs
{
...commonOptions,
minify: true,
metafile: shouldVisualize,
},
// package.core.mjs
{ ...commonOptions, core: true },
];

if (entryName === 'mermaid') {
const iifeOptions: MermaidBuildOptions = { ...commonOptions, format: 'iife' };
buildConfigs.push(
// mermaid.js
{ ...iifeOptions },
// mermaid.min.js
{ ...iifeOptions, minify: true, metafile: shouldVisualize }
);
}

const results = await Promise.all(buildConfigs.map((option) => build(getBuildConfig(option))));

if (shouldVisualize) {
for (const { metafile } of results) {
if (!metafile?.outputs) {
continue;
}
const fileName = Object.keys(metafile.outputs)
.find((file) => !file.includes('chunks') && file.endsWith('js'))
.replace('dist/', '');
// Upload metafile into https://esbuild.github.io/analyze/
await writeFile(`stats/${fileName}.meta.json`, JSON.stringify(metafile));
}
}
};

const handler = (e) => {
// eslint-disable-next-line no-console
console.error(e);
process.exit(1);
};

const main = async () => {
await generateLangium();
await mkdir('stats', { recursive: true });
const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[];
// it should build `parser` before `mermaid` because it's a dependency
for (const pkg of packageNames) {
await buildPackage(pkg).catch(handler);
}
};

void main();
Loading
Loading