From 50134849246141ec400e33e08c12c10539b84de9 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 23 Aug 2024 19:21:40 +0530 Subject: [PATCH 01/23] Release parser, v0.1.0, test changeset --- .changeset/perfect-teachers-whisper.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/perfect-teachers-whisper.md diff --git a/.changeset/perfect-teachers-whisper.md b/.changeset/perfect-teachers-whisper.md new file mode 100644 index 000000000..774c177eb --- /dev/null +++ b/.changeset/perfect-teachers-whisper.md @@ -0,0 +1,6 @@ +--- +'@mermaid-js/parser': minor +'mermaid': patch +--- + +Release parser, test changesets From eb3ed2a5e4762e34545dd7c776a3966225c9d717 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 23 Aug 2024 13:56:03 +0000 Subject: [PATCH 02/23] Version Packages --- .changeset/perfect-teachers-whisper.md | 6 ------ packages/mermaid/CHANGELOG.md | 10 ++++++++++ packages/mermaid/package.json | 2 +- packages/parser/CHANGELOG.md | 7 +++++++ packages/parser/package.json | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 .changeset/perfect-teachers-whisper.md create mode 100644 packages/mermaid/CHANGELOG.md create mode 100644 packages/parser/CHANGELOG.md diff --git a/.changeset/perfect-teachers-whisper.md b/.changeset/perfect-teachers-whisper.md deleted file mode 100644 index 774c177eb..000000000 --- a/.changeset/perfect-teachers-whisper.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@mermaid-js/parser': minor -'mermaid': patch ---- - -Release parser, test changesets diff --git a/packages/mermaid/CHANGELOG.md b/packages/mermaid/CHANGELOG.md new file mode 100644 index 000000000..2604152e7 --- /dev/null +++ b/packages/mermaid/CHANGELOG.md @@ -0,0 +1,10 @@ +# mermaid + +## 11.0.1 + +### Patch Changes + +- [#5744](https://github.com/mermaid-js/mermaid/pull/5744) [`5013484`](https://github.com/mermaid-js/mermaid/commit/50134849246141ec400e33e08c12c10539b84de9) Thanks [@sidharthv96](https://github.com/sidharthv96)! - Release parser, test changesets + +- Updated dependencies [[`5013484`](https://github.com/mermaid-js/mermaid/commit/50134849246141ec400e33e08c12c10539b84de9)]: + - @mermaid-js/parser@0.1.0 diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index c18190982..9994bb3a8 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "11.0.0", + "version": "11.0.1", "description": "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.", "type": "module", "module": "./dist/mermaid.core.mjs", diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md new file mode 100644 index 000000000..acbff369a --- /dev/null +++ b/packages/parser/CHANGELOG.md @@ -0,0 +1,7 @@ +# @mermaid-js/parser + +## 0.1.0 + +### Minor Changes + +- [#5744](https://github.com/mermaid-js/mermaid/pull/5744) [`5013484`](https://github.com/mermaid-js/mermaid/commit/50134849246141ec400e33e08c12c10539b84de9) Thanks [@sidharthv96](https://github.com/sidharthv96)! - Release parser, test changesets diff --git a/packages/parser/package.json b/packages/parser/package.json index da875ce45..a44174696 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-js/parser", - "version": "0.1.0-rc.2", + "version": "0.1.0", "description": "MermaidJS parser", "author": "Yokozuna59", "contributors": [ From 83926c9707b09c34e300888186250191ee8ae30a Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 23 Aug 2024 20:18:23 +0530 Subject: [PATCH 03/23] Test changeset (#5746) --- .changeset/old-weeks-arrive.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/old-weeks-arrive.md diff --git a/.changeset/old-weeks-arrive.md b/.changeset/old-weeks-arrive.md new file mode 100644 index 000000000..5ef860f56 --- /dev/null +++ b/.changeset/old-weeks-arrive.md @@ -0,0 +1,5 @@ +--- +'@mermaid-js/parser': patch +--- + +test changeset From 5bbf3678c55da595523e8aeddd172e73664a90ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:22:20 +0530 Subject: [PATCH 04/23] Version Packages (#5748) Co-authored-by: github-actions[bot] --- .changeset/old-weeks-arrive.md | 5 ----- packages/mermaid/CHANGELOG.md | 7 +++++++ packages/mermaid/package.json | 2 +- packages/parser/CHANGELOG.md | 6 ++++++ packages/parser/package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/old-weeks-arrive.md diff --git a/.changeset/old-weeks-arrive.md b/.changeset/old-weeks-arrive.md deleted file mode 100644 index 5ef860f56..000000000 --- a/.changeset/old-weeks-arrive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mermaid-js/parser': patch ---- - -test changeset diff --git a/packages/mermaid/CHANGELOG.md b/packages/mermaid/CHANGELOG.md index 2604152e7..fe7360f81 100644 --- a/packages/mermaid/CHANGELOG.md +++ b/packages/mermaid/CHANGELOG.md @@ -1,5 +1,12 @@ # mermaid +## 11.0.2 + +### Patch Changes + +- Updated dependencies [[`83926c9`](https://github.com/mermaid-js/mermaid/commit/83926c9707b09c34e300888186250191ee8ae30a)]: + - @mermaid-js/parser@0.1.1 + ## 11.0.1 ### Patch Changes diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 9994bb3a8..8956eb1e5 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "11.0.1", + "version": "11.0.2", "description": "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.", "type": "module", "module": "./dist/mermaid.core.mjs", diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index acbff369a..f6b145b5a 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,5 +1,11 @@ # @mermaid-js/parser +## 0.1.1 + +### Patch Changes + +- [#5746](https://github.com/mermaid-js/mermaid/pull/5746) [`83926c9`](https://github.com/mermaid-js/mermaid/commit/83926c9707b09c34e300888186250191ee8ae30a) Thanks [@sidharthv96](https://github.com/sidharthv96)! - test changeset + ## 0.1.0 ### Minor Changes diff --git a/packages/parser/package.json b/packages/parser/package.json index a44174696..157d4dd05 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-js/parser", - "version": "0.1.0", + "version": "0.1.1", "description": "MermaidJS parser", "author": "Yokozuna59", "contributors": [ From f04fa4d5650042b91245f4fa588e2f69969a56ab Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Fri, 23 Aug 2024 07:58:53 -0700 Subject: [PATCH 05/23] add latest blog posts --- .../setup/interfaces/mermaid.RenderOptions.md | 19 ------------------- docs/news/blog.md | 18 ++++++++++++++++++ packages/mermaid/src/docs/news/blog.md | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 19 deletions(-) delete mode 100644 docs/config/setup/interfaces/mermaid.RenderOptions.md diff --git a/docs/config/setup/interfaces/mermaid.RenderOptions.md b/docs/config/setup/interfaces/mermaid.RenderOptions.md deleted file mode 100644 index 9319cb3b1..000000000 --- a/docs/config/setup/interfaces/mermaid.RenderOptions.md +++ /dev/null @@ -1,19 +0,0 @@ -> **Warning** -> -> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. -> -> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.RenderOptions.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.RenderOptions.md). - -# Interface: RenderOptions - -[mermaid](../modules/mermaid.md).RenderOptions - -## Properties - -### algorithm - -• `Optional` **algorithm**: `string` - -#### Defined in - -[packages/mermaid/src/rendering-util/render.ts:8](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L8) diff --git a/docs/news/blog.md b/docs/news/blog.md index 4c7c982c3..372247b86 100644 --- a/docs/news/blog.md +++ b/docs/news/blog.md @@ -6,6 +6,24 @@ # Blog +## [Mermaid v11 is out!](https://www.mermaidchart.com/blog/posts/mermaid-v11/) + +23 August 2024 · 2 mins + +Mermaid v11 introduces advanced layout options, new diagram types, and enhanced customization features, thanks to the incredible contributions from our community. + +## [Mermaid Innovation - Introducing New Looks for Mermaid Diagrams](https://www.mermaidchart.com/blog/posts/mermaid-innovation-introducing-new-looks-for-mermaid-diagrams/) + +6 August 2024 ·3 mins + +Discover the fresh new and unique Neo and Hand-Drawn looks for Mermaid Diagrams, while still offering the classic look you love. + +## [The Mermaid Chart Plugin for Jira: A How-To User Guide](https://www.mermaidchart.com/blog/posts/the-mermaid-chart-plugin-for-jira-a-how-to-user-guide/) + +31 July 2024 · 5 mins + +The Mermaid Chart plugin for Jira has arrived! + ## [Mermaid AI Is Here to Change the Game For Diagram Creation](https://www.mermaidchart.com/blog/posts/mermaid-ai-is-here-to-change-the-game-for-diagram-creation/) 22 July 2024 · 5 mins diff --git a/packages/mermaid/src/docs/news/blog.md b/packages/mermaid/src/docs/news/blog.md index 10f7672fd..f7f28bf4b 100644 --- a/packages/mermaid/src/docs/news/blog.md +++ b/packages/mermaid/src/docs/news/blog.md @@ -1,5 +1,23 @@ # Blog +## [Mermaid v11 is out!](https://www.mermaidchart.com/blog/posts/mermaid-v11/) + +23 August 2024 · 2 mins + +Mermaid v11 introduces advanced layout options, new diagram types, and enhanced customization features, thanks to the incredible contributions from our community. + +## [Mermaid Innovation - Introducing New Looks for Mermaid Diagrams](https://www.mermaidchart.com/blog/posts/mermaid-innovation-introducing-new-looks-for-mermaid-diagrams/) + +6 August 2024 ·3 mins + +Discover the fresh new and unique Neo and Hand-Drawn looks for Mermaid Diagrams, while still offering the classic look you love. + +## [The Mermaid Chart Plugin for Jira: A How-To User Guide](https://www.mermaidchart.com/blog/posts/the-mermaid-chart-plugin-for-jira-a-how-to-user-guide/) + +31 July 2024 · 5 mins + +The Mermaid Chart plugin for Jira has arrived! + ## [Mermaid AI Is Here to Change the Game For Diagram Creation](https://www.mermaidchart.com/blog/posts/mermaid-ai-is-here-to-change-the-game-for-diagram-creation/) 22 July 2024 · 5 mins From 2efe741924ce6d3737da4885405060dda34fb0cd Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 23 Aug 2024 20:29:33 +0530 Subject: [PATCH 06/23] Revert mermaid version --- packages/mermaid/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 8956eb1e5..c18190982 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "11.0.2", + "version": "11.0.0", "description": "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.", "type": "module", "module": "./dist/mermaid.core.mjs", From bf05d8781edacb580fdb053da167e968b7570117 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 23 Aug 2024 20:30:02 +0530 Subject: [PATCH 07/23] Bump mermaid minor --- .changeset/clever-ties-return.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/clever-ties-return.md diff --git a/.changeset/clever-ties-return.md b/.changeset/clever-ties-return.md new file mode 100644 index 000000000..ee2553120 --- /dev/null +++ b/.changeset/clever-ties-return.md @@ -0,0 +1,5 @@ +--- +'mermaid': patch +--- + +test changeset From 4d10e3f2586fb8b08b72d93a1036a17d53153997 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:33:20 +0530 Subject: [PATCH 08/23] Version Packages (#5749) Co-authored-by: github-actions[bot] --- .changeset/clever-ties-return.md | 5 ----- packages/mermaid/CHANGELOG.md | 6 ++++++ packages/mermaid/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/clever-ties-return.md diff --git a/.changeset/clever-ties-return.md b/.changeset/clever-ties-return.md deleted file mode 100644 index ee2553120..000000000 --- a/.changeset/clever-ties-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': patch ---- - -test changeset diff --git a/packages/mermaid/CHANGELOG.md b/packages/mermaid/CHANGELOG.md index fe7360f81..ae05b0637 100644 --- a/packages/mermaid/CHANGELOG.md +++ b/packages/mermaid/CHANGELOG.md @@ -1,5 +1,11 @@ # mermaid +## 11.0.1 + +### Patch Changes + +- [#2](https://github.com/calvinvette/mermaid/pull/2) [`bf05d87`](https://github.com/mermaid-js/mermaid/commit/bf05d8781edacb580fdb053da167e968b7570117) Thanks [@calvinvette](https://github.com/calvinvette)! - test changeset + ## 11.0.2 ### Patch Changes diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index c18190982..9994bb3a8 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "11.0.0", + "version": "11.0.1", "description": "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.", "type": "module", "module": "./dist/mermaid.core.mjs", From e391966de888d28c6be1e43c69bc4334bfccd9f4 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:08:07 +0000 Subject: [PATCH 09/23] [autofix.ci] apply automated fixes --- .../setup/interfaces/mermaid.RenderOptions.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/config/setup/interfaces/mermaid.RenderOptions.md diff --git a/docs/config/setup/interfaces/mermaid.RenderOptions.md b/docs/config/setup/interfaces/mermaid.RenderOptions.md new file mode 100644 index 000000000..9319cb3b1 --- /dev/null +++ b/docs/config/setup/interfaces/mermaid.RenderOptions.md @@ -0,0 +1,19 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.RenderOptions.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.RenderOptions.md). + +# Interface: RenderOptions + +[mermaid](../modules/mermaid.md).RenderOptions + +## Properties + +### algorithm + +• `Optional` **algorithm**: `string` + +#### Defined in + +[packages/mermaid/src/rendering-util/render.ts:8](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L8) From d559fcc90bb765f90975f0d402dc24dcd195e251 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 23 Aug 2024 17:35:44 +0200 Subject: [PATCH 10/23] Updating syntax reference with code showing how to select layout and look. --- docs/intro/syntax-reference.md | 153 ++++++++++++++++++ .../src/docs/intro/syntax-reference.md | 108 +++++++++++++ 2 files changed, 261 insertions(+) diff --git a/docs/intro/syntax-reference.md b/docs/intro/syntax-reference.md index 00330f21d..2c204ba12 100644 --- a/docs/intro/syntax-reference.md +++ b/docs/intro/syntax-reference.md @@ -83,3 +83,156 @@ Allows for the limited reconfiguration of a diagram just before it is rendered. ### [Theme Manipulation](../config/theming.md) An application of using Directives to change [Themes](../config/theming.md). `Theme` is a value within Mermaid's configuration that dictates the color scheme for diagrams. + +### Layout and look + +We've restructured how Mermaid renders diagrams, enabling new features like selecting layout and look. **Currently, this is supported for flowcharts and state diagrams**, with plans to extend support to all diagram types. + +### Selecting Diagram Looks + +Mermaid offers a variety of styles or “looks” for your diagrams, allowing you to tailor the visual appearance to match your specific needs or preferences. Whether you prefer a hand-drawn or classic style, you can easily customize your diagrams. + +**Available Looks:** + +``` +• Hand-Drawn Look: For a more personal, creative touch, the hand-drawn look brings a sketch-like quality to your diagrams. This style is perfect for informal settings or when you want to add a bit of personality to your diagrams. +• Classic Look: If you prefer the traditional Mermaid style, the classic look maintains the original appearance that many users are familiar with. It’s great for consistency across projects or when you want to keep the familiar aesthetic. +``` + +**How to Select a Look:** + +You can select a look by adding the look parameter in the metadata section of your Mermaid diagram code. Here’s an example: + +```mermaid-example +--- +config: + look: handDrawn + theme: neutral +--- +flowchart LR + A[Start] --> B{Decision} + B -->|Yes| C[Continue] + B -->|No| D[Stop] +``` + +```mermaid +--- +config: + look: handDrawn + theme: neutral +--- +flowchart LR + A[Start] --> B{Decision} + B -->|Yes| C[Continue] + B -->|No| D[Stop] +``` + +#### Selecting Layout Algorithms + +In addition to customizing the look of your diagrams, Mermaid Chart now allows you to choose different layout algorithms to better organize and present your diagrams, especially when dealing with more complex structures. The layout algorithm dictates how nodes and edges are arranged on the page. + +#### Supported Layout Algorithms: + +``` +• Dagre (default): This is the classic layout algorithm that has been used in Mermaid for a long time. It provides a good balance of simplicity and visual clarity, making it ideal for most diagrams. +• ELK: For those who need more sophisticated layout capabilities, especially when working with large or intricate diagrams, the ELK (Eclipse Layout Kernel) layout offers advanced options. It provides a more optimized arrangement, potentially reducing overlapping and improving readability. This is not included out the box but needs to be added when integrating mermaid for sites/applications that want to have elk support. +``` + +#### How to Select a Layout Algorithm: + +You can specify the layout algorithm directly in the metadata section of your Mermaid diagram code. Here’s an example: + +```mermaid-example +--- +config: + layout: elk + look: handdrawn + theme: forest +--- +flowchart TB + A[Start] --> B{Decision} + B -->|Yes| C[Continue] + B -->|No| D[Stop] +``` + +```mermaid +--- +config: + layout: elk + look: handdrawn + theme: forest +--- +flowchart TB + A[Start] --> B{Decision} + B -->|Yes| C[Continue] + B -->|No| D[Stop] +``` + +In this example, the `layout: elk` line configures the diagram to use the ELK layout algorithm, along with the handdrawn look and forest theme. + +#### Customizing ELK Layout: + +When using the ELK layout, you can further refine the diagram’s configuration, such as how nodes are placed and whether parallel edges should be combined: + +- To combine parallel edges, use mergeEdges: true | false. +- To configure node placement, use nodePlacementStrategy with the following options: + o SIMPLE + o NETWORK_SIMPLEX + o LINEAR_SEGMENTS + o BRANDES_KOEPF (default) + +**Example configuration:** + +```mermaid-example +--- +config: + layout: elk + elk: + mergeEdges: true + nodePlacementStrategy: LINEAR_SEGMENTS +--- +flowchart LR + A[Start] --> B{Choose Path} + B -->|Option 1| C[Path 1] + B -->|Option 2| D[Path 2] + +#### Using Dagre Layout with Classic Look: +``` + +```mermaid +--- +config: + layout: elk + elk: + mergeEdges: true + nodePlacementStrategy: LINEAR_SEGMENTS +--- +flowchart LR + A[Start] --> B{Choose Path} + B -->|Option 1| C[Path 1] + B -->|Option 2| D[Path 2] + +#### Using Dagre Layout with Classic Look: +``` + +--- + +config: +layout: dagre +look: classic +theme: default + +--- + +flowchart LR +A\[Start] --> B{Choose Path} +B -->|Option 1| C\[Path 1] +B -->|Option 2| D\[Path 2] + +``` + +These options give you the flexibility to create diagrams that not only look great but are also arranged to best suit your data’s structure and flow. + +When integrating Mermaid, you can include look and layout configuration with the initialize call. This is also where you add the loading of elk. + +``` diff --git a/packages/mermaid/src/docs/intro/syntax-reference.md b/packages/mermaid/src/docs/intro/syntax-reference.md index d4ee1067f..7f36413b2 100644 --- a/packages/mermaid/src/docs/intro/syntax-reference.md +++ b/packages/mermaid/src/docs/intro/syntax-reference.md @@ -65,3 +65,111 @@ Allows for the limited reconfiguration of a diagram just before it is rendered. ### [Theme Manipulation](../config/theming.md) An application of using Directives to change [Themes](../config/theming.md). `Theme` is a value within Mermaid's configuration that dictates the color scheme for diagrams. + +### Layout and look + +We've restructured how Mermaid renders diagrams, enabling new features like selecting layout and look. **Currently, this is supported for flowcharts and state diagrams**, with plans to extend support to all diagram types. + +### Selecting Diagram Looks + +Mermaid offers a variety of styles or “looks” for your diagrams, allowing you to tailor the visual appearance to match your specific needs or preferences. Whether you prefer a hand-drawn or classic style, you can easily customize your diagrams. + +**Available Looks:** + + • Hand-Drawn Look: For a more personal, creative touch, the hand-drawn look brings a sketch-like quality to your diagrams. This style is perfect for informal settings or when you want to add a bit of personality to your diagrams. + • Classic Look: If you prefer the traditional Mermaid style, the classic look maintains the original appearance that many users are familiar with. It’s great for consistency across projects or when you want to keep the familiar aesthetic. + +**How to Select a Look:** + +You can select a look by adding the look parameter in the metadata section of your Mermaid diagram code. Here’s an example: + +```mermaid +--- +config: + look: handDrawn + theme: neutral +--- +flowchart LR + A[Start] --> B{Decision} + B -->|Yes| C[Continue] + B -->|No| D[Stop] +``` + +#### Selecting Layout Algorithms + +In addition to customizing the look of your diagrams, Mermaid Chart now allows you to choose different layout algorithms to better organize and present your diagrams, especially when dealing with more complex structures. The layout algorithm dictates how nodes and edges are arranged on the page. + +#### Supported Layout Algorithms: + + • Dagre (default): This is the classic layout algorithm that has been used in Mermaid for a long time. It provides a good balance of simplicity and visual clarity, making it ideal for most diagrams. + • ELK: For those who need more sophisticated layout capabilities, especially when working with large or intricate diagrams, the ELK (Eclipse Layout Kernel) layout offers advanced options. It provides a more optimized arrangement, potentially reducing overlapping and improving readability. This is not included out the box but needs to be added when integrating mermaid for sites/applications that want to have elk support. + +#### How to Select a Layout Algorithm: + +You can specify the layout algorithm directly in the metadata section of your Mermaid diagram code. Here’s an example: + +```mermaid +--- +config: + layout: elk + look: handdrawn + theme: forest +--- +flowchart TB + A[Start] --> B{Decision} + B -->|Yes| C[Continue] + B -->|No| D[Stop] +``` + +In this example, the `layout: elk` line configures the diagram to use the ELK layout algorithm, along with the handdrawn look and forest theme. + +#### Customizing ELK Layout: + +When using the ELK layout, you can further refine the diagram’s configuration, such as how nodes are placed and whether parallel edges should be combined: + +- To combine parallel edges, use mergeEdges: true | false. +- To configure node placement, use nodePlacementStrategy with the following options: + o SIMPLE + o NETWORK_SIMPLEX + o LINEAR_SEGMENTS + o BRANDES_KOEPF (default) + +**Example configuration:** + +```mermaid +--- +config: + layout: elk + elk: + mergeEdges: true + nodePlacementStrategy: LINEAR_SEGMENTS +--- +flowchart LR + A[Start] --> B{Choose Path} + B -->|Option 1| C[Path 1] + B -->|Option 2| D[Path 2] + +#### Using Dagre Layout with Classic Look: +``` + +--- + +config: +layout: dagre +look: classic +theme: default + +--- + +flowchart LR +A[Start] --> B{Choose Path} +B -->|Option 1| C[Path 1] +B -->|Option 2| D[Path 2] + +``` + +These options give you the flexibility to create diagrams that not only look great but are also arranged to best suit your data’s structure and flow. + +When integrating Mermaid, you can include look and layout configuration with the initialize call. This is also where you add the loading of elk. + +``` From e499f700ce058524bcdc824ccb1ef7815c560986 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 23 Aug 2024 17:41:24 +0200 Subject: [PATCH 11/23] Updates to information about the new syntax --- docs/intro/syntax-reference.md | 45 ++++++------------- .../src/docs/intro/syntax-reference.md | 25 +++++------ 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/docs/intro/syntax-reference.md b/docs/intro/syntax-reference.md index 2c204ba12..006b6f3f7 100644 --- a/docs/intro/syntax-reference.md +++ b/docs/intro/syntax-reference.md @@ -147,7 +147,7 @@ You can specify the layout algorithm directly in the metadata section of your Me config: layout: elk look: handdrawn - theme: forest + theme: dark --- flowchart TB A[Start] --> B{Decision} @@ -160,7 +160,7 @@ flowchart TB config: layout: elk look: handdrawn - theme: forest + theme: dark --- flowchart TB A[Start] --> B{Decision} @@ -176,14 +176,14 @@ When using the ELK layout, you can further refine the diagram’s configuration, - To combine parallel edges, use mergeEdges: true | false. - To configure node placement, use nodePlacementStrategy with the following options: - o SIMPLE - o NETWORK_SIMPLEX - o LINEAR_SEGMENTS - o BRANDES_KOEPF (default) + - SIMPLE + - NETWORK_SIMPLEX + - LINEAR_SEGMENTS + - BRANDES_KOEPF (default) **Example configuration:** -```mermaid-example +``` --- config: layout: elk @@ -199,40 +199,23 @@ flowchart LR #### Using Dagre Layout with Classic Look: ``` -```mermaid ---- -config: - layout: elk - elk: - mergeEdges: true - nodePlacementStrategy: LINEAR_SEGMENTS ---- -flowchart LR - A[Start] --> B{Choose Path} - B -->|Option 1| C[Path 1] - B -->|Option 2| D[Path 2] +Another example: -#### Using Dagre Layout with Classic Look: ``` - --- - config: -layout: dagre -look: classic -theme: default - + layout: dagre + look: classic + theme: default --- flowchart LR -A\[Start] --> B{Choose Path} -B -->|Option 1| C\[Path 1] -B -->|Option 2| D\[Path 2] +A[Start] --> B{Choose Path} +B -->|Option 1| C[Path 1] +B -->|Option 2| D[Path 2] ``` These options give you the flexibility to create diagrams that not only look great but are also arranged to best suit your data’s structure and flow. When integrating Mermaid, you can include look and layout configuration with the initialize call. This is also where you add the loading of elk. - -``` diff --git a/packages/mermaid/src/docs/intro/syntax-reference.md b/packages/mermaid/src/docs/intro/syntax-reference.md index 7f36413b2..1e7cbc4bb 100644 --- a/packages/mermaid/src/docs/intro/syntax-reference.md +++ b/packages/mermaid/src/docs/intro/syntax-reference.md @@ -113,7 +113,7 @@ You can specify the layout algorithm directly in the metadata section of your Me config: layout: elk look: handdrawn - theme: forest + theme: dark --- flowchart TB A[Start] --> B{Decision} @@ -129,14 +129,14 @@ When using the ELK layout, you can further refine the diagram’s configuration, - To combine parallel edges, use mergeEdges: true | false. - To configure node placement, use nodePlacementStrategy with the following options: - o SIMPLE - o NETWORK_SIMPLEX - o LINEAR_SEGMENTS - o BRANDES_KOEPF (default) + - SIMPLE + - NETWORK_SIMPLEX + - LINEAR_SEGMENTS + - BRANDES_KOEPF (default) **Example configuration:** -```mermaid +``` --- config: layout: elk @@ -152,13 +152,14 @@ flowchart LR #### Using Dagre Layout with Classic Look: ``` +Another example: + +``` --- - config: -layout: dagre -look: classic -theme: default - + layout: dagre + look: classic + theme: default --- flowchart LR @@ -171,5 +172,3 @@ B -->|Option 2| D[Path 2] These options give you the flexibility to create diagrams that not only look great but are also arranged to best suit your data’s structure and flow. When integrating Mermaid, you can include look and layout configuration with the initialize call. This is also where you add the loading of elk. - -``` From a4e1479759b64e5a4b27fb2b4e5100be024fd77d Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 23 Aug 2024 17:49:52 +0200 Subject: [PATCH 12/23] Correct casing for hand drawn --- docs/intro/syntax-reference.md | 6 +++--- packages/mermaid/src/docs/intro/syntax-reference.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/intro/syntax-reference.md b/docs/intro/syntax-reference.md index 006b6f3f7..f736840e6 100644 --- a/docs/intro/syntax-reference.md +++ b/docs/intro/syntax-reference.md @@ -146,7 +146,7 @@ You can specify the layout algorithm directly in the metadata section of your Me --- config: layout: elk - look: handdrawn + look: handDrawn theme: dark --- flowchart TB @@ -159,7 +159,7 @@ flowchart TB --- config: layout: elk - look: handdrawn + look: handDrawn theme: dark --- flowchart TB @@ -168,7 +168,7 @@ flowchart TB B -->|No| D[Stop] ``` -In this example, the `layout: elk` line configures the diagram to use the ELK layout algorithm, along with the handdrawn look and forest theme. +In this example, the `layout: elk` line configures the diagram to use the ELK layout algorithm, along with the hand drawn look and forest theme. #### Customizing ELK Layout: diff --git a/packages/mermaid/src/docs/intro/syntax-reference.md b/packages/mermaid/src/docs/intro/syntax-reference.md index 1e7cbc4bb..7d7fd5994 100644 --- a/packages/mermaid/src/docs/intro/syntax-reference.md +++ b/packages/mermaid/src/docs/intro/syntax-reference.md @@ -112,7 +112,7 @@ You can specify the layout algorithm directly in the metadata section of your Me --- config: layout: elk - look: handdrawn + look: handDrawn theme: dark --- flowchart TB @@ -121,7 +121,7 @@ flowchart TB B -->|No| D[Stop] ``` -In this example, the `layout: elk` line configures the diagram to use the ELK layout algorithm, along with the handdrawn look and forest theme. +In this example, the `layout: elk` line configures the diagram to use the ELK layout algorithm, along with the hand drawn look and forest theme. #### Customizing ELK Layout: From ca57235e056768e585f97b421b1ffcc86123c710 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 11:51:00 +0530 Subject: [PATCH 13/23] fix: Type export for layout-elk --- packages/mermaid-layout-elk/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid-layout-elk/package.json b/packages/mermaid-layout-elk/package.json index 78ad309b8..3c5d7a917 100644 --- a/packages/mermaid-layout-elk/package.json +++ b/packages/mermaid-layout-elk/package.json @@ -3,12 +3,12 @@ "version": "0.1.0", "description": "ELK layout engine for mermaid", "module": "dist/mermaid-layout-elk.core.mjs", - "types": "dist/packages/mermaid-layout-elk/src/index.d.ts", + "types": "dist/layout.d.ts", "type": "module", "exports": { ".": { "import": "./dist/mermaid-layout-elk.core.mjs", - "types": "./dist/packages/mermaid-layout-elk/src/index.d.ts" + "types": "./dist/layout.d.ts" }, "./*": "./*" }, From 501a55d8f225901ba345c498dec4298490a0196e Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 11:51:33 +0530 Subject: [PATCH 14/23] chore: Add changeset --- .changeset/khaki-news-count.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/khaki-news-count.md diff --git a/.changeset/khaki-news-count.md b/.changeset/khaki-news-count.md new file mode 100644 index 000000000..1fcb629c9 --- /dev/null +++ b/.changeset/khaki-news-count.md @@ -0,0 +1,5 @@ +--- +'@mermaid-js/layout-elk': patch +--- + +fix: Types path From 17c0af1cf6546b94e6a631d40209f35d7b13f902 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 12:18:19 +0530 Subject: [PATCH 15/23] chore: Update flowchart widths --- cypress/integration/rendering/flowchart-v2.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/rendering/flowchart-v2.spec.js b/cypress/integration/rendering/flowchart-v2.spec.js index c2fd0b011..452cdb5a0 100644 --- a/cypress/integration/rendering/flowchart-v2.spec.js +++ b/cypress/integration/rendering/flowchart-v2.spec.js @@ -99,7 +99,7 @@ describe('Flowchart v2', () => { const style = svg.attr('style'); expect(style).to.match(/^max-width: [\d.]+px;$/); const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join('')); - expect(maxWidthValue).to.be.within(446 * 0.95 - 1, 446 * 1.05); + expect(maxWidthValue).to.be.within(417 * 0.95, 417 * 1.05); }); }); it('8: should render a flowchart when useMaxWidth is false', () => { @@ -118,7 +118,7 @@ describe('Flowchart v2', () => { const width = parseFloat(svg.attr('width')); // use within because the absolute value can be slightly different depending on the environment ±5% // expect(height).to.be.within(446 * 0.95, 446 * 1.05); - expect(width).to.be.within(446 * 0.95 - 1, 446 * 1.05); + expect(width).to.be.within(417 * 0.95, 417 * 1.05); expect(svg).to.not.have.attr('style'); }); }); From dab8f08a9e98b42951e8792899ff7f01c67213d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 24 Aug 2024 07:03:01 +0000 Subject: [PATCH 16/23] Version Packages --- .changeset/dirty-mails-watch.md | 6 ------ .changeset/khaki-news-count.md | 5 ----- packages/mermaid-layout-elk/CHANGELOG.md | 10 ++++++++++ packages/mermaid-layout-elk/package.json | 2 +- packages/mermaid/CHANGELOG.md | 9 +++++++++ packages/mermaid/package.json | 2 +- packages/parser/CHANGELOG.md | 6 ++++++ packages/parser/package.json | 2 +- 8 files changed, 28 insertions(+), 14 deletions(-) delete mode 100644 .changeset/dirty-mails-watch.md delete mode 100644 .changeset/khaki-news-count.md create mode 100644 packages/mermaid-layout-elk/CHANGELOG.md diff --git a/.changeset/dirty-mails-watch.md b/.changeset/dirty-mails-watch.md deleted file mode 100644 index 8fd5ec941..000000000 --- a/.changeset/dirty-mails-watch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@mermaid-js/parser': minor -'mermaid': patch ---- - -chore: Migrate git graph to langium, use typescript for internals diff --git a/.changeset/khaki-news-count.md b/.changeset/khaki-news-count.md deleted file mode 100644 index 1fcb629c9..000000000 --- a/.changeset/khaki-news-count.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mermaid-js/layout-elk': patch ---- - -fix: Types path diff --git a/packages/mermaid-layout-elk/CHANGELOG.md b/packages/mermaid-layout-elk/CHANGELOG.md new file mode 100644 index 000000000..2db340af7 --- /dev/null +++ b/packages/mermaid-layout-elk/CHANGELOG.md @@ -0,0 +1,10 @@ +# @mermaid-js/layout-elk + +## 0.1.1 + +### Patch Changes + +- [#5758](https://github.com/mermaid-js/mermaid/pull/5758) [`501a55d`](https://github.com/mermaid-js/mermaid/commit/501a55d8f225901ba345c498dec4298490a0196e) Thanks [@sidharthv96](https://github.com/sidharthv96)! - fix: Types path + +- Updated dependencies [[`5deaef4`](https://github.com/mermaid-js/mermaid/commit/5deaef456e74d796866431c26f69360e4e74dbff)]: + - mermaid@11.0.2 diff --git a/packages/mermaid-layout-elk/package.json b/packages/mermaid-layout-elk/package.json index 3c5d7a917..f53302c09 100644 --- a/packages/mermaid-layout-elk/package.json +++ b/packages/mermaid-layout-elk/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-js/layout-elk", - "version": "0.1.0", + "version": "0.1.1", "description": "ELK layout engine for mermaid", "module": "dist/mermaid-layout-elk.core.mjs", "types": "dist/layout.d.ts", diff --git a/packages/mermaid/CHANGELOG.md b/packages/mermaid/CHANGELOG.md index ae05b0637..5a34667fa 100644 --- a/packages/mermaid/CHANGELOG.md +++ b/packages/mermaid/CHANGELOG.md @@ -1,5 +1,14 @@ # mermaid +## 11.0.2 + +### Patch Changes + +- [#5664](https://github.com/mermaid-js/mermaid/pull/5664) [`5deaef4`](https://github.com/mermaid-js/mermaid/commit/5deaef456e74d796866431c26f69360e4e74dbff) Thanks [@Austin-Fulbright](https://github.com/Austin-Fulbright)! - chore: Migrate git graph to langium, use typescript for internals + +- Updated dependencies [[`5deaef4`](https://github.com/mermaid-js/mermaid/commit/5deaef456e74d796866431c26f69360e4e74dbff)]: + - @mermaid-js/parser@0.2.0 + ## 11.0.1 ### Patch Changes diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 9994bb3a8..8956eb1e5 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "11.0.1", + "version": "11.0.2", "description": "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.", "type": "module", "module": "./dist/mermaid.core.mjs", diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index f6b145b5a..4b864f523 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,5 +1,11 @@ # @mermaid-js/parser +## 0.2.0 + +### Minor Changes + +- [#5664](https://github.com/mermaid-js/mermaid/pull/5664) [`5deaef4`](https://github.com/mermaid-js/mermaid/commit/5deaef456e74d796866431c26f69360e4e74dbff) Thanks [@Austin-Fulbright](https://github.com/Austin-Fulbright)! - chore: Migrate git graph to langium, use typescript for internals + ## 0.1.1 ### Patch Changes diff --git a/packages/parser/package.json b/packages/parser/package.json index 157d4dd05..fc70e844b 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-js/parser", - "version": "0.1.1", + "version": "0.2.0", "description": "MermaidJS parser", "author": "Yokozuna59", "contributors": [ From b34dfe8f45eded31da10965ced7ea40fde1ca76c Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 12:41:18 +0530 Subject: [PATCH 17/23] fix: Type file path for layout-elk --- .changeset/khaki-plants-watch.md | 5 +++++ packages/mermaid-layout-elk/package.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/khaki-plants-watch.md diff --git a/.changeset/khaki-plants-watch.md b/.changeset/khaki-plants-watch.md new file mode 100644 index 000000000..0849105f3 --- /dev/null +++ b/.changeset/khaki-plants-watch.md @@ -0,0 +1,5 @@ +--- +'@mermaid-js/layout-elk': patch +--- + +Fix type file path diff --git a/packages/mermaid-layout-elk/package.json b/packages/mermaid-layout-elk/package.json index f53302c09..56fa53f0e 100644 --- a/packages/mermaid-layout-elk/package.json +++ b/packages/mermaid-layout-elk/package.json @@ -3,12 +3,12 @@ "version": "0.1.1", "description": "ELK layout engine for mermaid", "module": "dist/mermaid-layout-elk.core.mjs", - "types": "dist/layout.d.ts", + "types": "dist/layouts.d.ts", "type": "module", "exports": { ".": { "import": "./dist/mermaid-layout-elk.core.mjs", - "types": "./dist/layout.d.ts" + "types": "./dist/layouts.d.ts" }, "./*": "./*" }, From 1532721f09ed52ac1e8b741086b369819147b41c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 24 Aug 2024 07:17:31 +0000 Subject: [PATCH 18/23] Version Packages --- .changeset/khaki-plants-watch.md | 5 ----- packages/mermaid-layout-elk/CHANGELOG.md | 6 ++++++ packages/mermaid-layout-elk/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/khaki-plants-watch.md diff --git a/.changeset/khaki-plants-watch.md b/.changeset/khaki-plants-watch.md deleted file mode 100644 index 0849105f3..000000000 --- a/.changeset/khaki-plants-watch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mermaid-js/layout-elk': patch ---- - -Fix type file path diff --git a/packages/mermaid-layout-elk/CHANGELOG.md b/packages/mermaid-layout-elk/CHANGELOG.md index 2db340af7..e1ec1d2dd 100644 --- a/packages/mermaid-layout-elk/CHANGELOG.md +++ b/packages/mermaid-layout-elk/CHANGELOG.md @@ -1,5 +1,11 @@ # @mermaid-js/layout-elk +## 0.1.2 + +### Patch Changes + +- [#5761](https://github.com/mermaid-js/mermaid/pull/5761) [`b34dfe8`](https://github.com/mermaid-js/mermaid/commit/b34dfe8f45eded31da10965ced7ea40fde1ca76c) Thanks [@sidharthv96](https://github.com/sidharthv96)! - Fix type file path + ## 0.1.1 ### Patch Changes diff --git a/packages/mermaid-layout-elk/package.json b/packages/mermaid-layout-elk/package.json index 56fa53f0e..5fa491bc8 100644 --- a/packages/mermaid-layout-elk/package.json +++ b/packages/mermaid-layout-elk/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-js/layout-elk", - "version": "0.1.1", + "version": "0.1.2", "description": "ELK layout engine for mermaid", "module": "dist/mermaid-layout-elk.core.mjs", "types": "dist/layouts.d.ts", From 5c59505589a2ddec79be501811080eddd915e3e9 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 14:51:23 +0530 Subject: [PATCH 19/23] chore: Skip running E2E on Push to most branches --- .github/workflows/e2e.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 2600b3fb8..fe420a7eb 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,8 +2,10 @@ name: E2E on: push: - branches-ignore: - - 'gh-readonly-queue/**' + branches: + - develop + - master + - release/** pull_request: merge_group: From 1a1f6687455efb5cb8cff884fafab202c61a5a9d Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 15:04:14 +0530 Subject: [PATCH 20/23] chore: Add concurrency for actions --- .github/workflows/autofix.yml | 2 ++ .github/workflows/build-docs.yml | 2 ++ .github/workflows/e2e-applitools.yml | 2 ++ .github/workflows/e2e.yml | 2 ++ .github/workflows/lint.yml | 6 ++---- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index f26bf4ab8..1eef1eae2 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -7,6 +7,8 @@ on: permissions: contents: read +concurrency: ${{ github.workflow }}-${{ github.ref }} + jobs: autofix: runs-on: ubuntu-latest diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 0ce778957..ca422de52 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -8,6 +8,8 @@ on: pull_request: merge_group: +concurrency: ${{ github.workflow }}-${{ github.ref }} + permissions: contents: read diff --git a/.github/workflows/e2e-applitools.yml b/.github/workflows/e2e-applitools.yml index 5e5407a23..e75ad60d3 100644 --- a/.github/workflows/e2e-applitools.yml +++ b/.github/workflows/e2e-applitools.yml @@ -11,6 +11,8 @@ on: default: master description: 'Parent branch to use for PRs' +concurrency: ${{ github.workflow }}-${{ github.ref }} + permissions: contents: read diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fe420a7eb..f7eb63a8c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,6 +9,8 @@ on: pull_request: merge_group: +concurrency: ${{ github.workflow }}-${{ github.ref }} + permissions: contents: read diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 632cd6ddc..25de168c1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,12 +4,10 @@ on: push: merge_group: pull_request: - types: - - opened - - synchronize - - ready_for_review workflow_dispatch: +concurrency: ${{ github.workflow }}-${{ github.ref }} + permissions: contents: write From ab4ba4cf2fa67fa4c339d741eefc5ad068ce4565 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 15:05:28 +0530 Subject: [PATCH 21/23] chore: Remove unnecessary workflows --- .github/workflows/build.yml | 49 --------------------------- .github/workflows/release-publish.yml | 47 ------------------------- 2 files changed, 96 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/release-publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c6e96912e..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Build - -on: - push: {} - merge_group: - pull_request: - types: - - opened - - synchronize - - ready_for_review - -permissions: - contents: read - -jobs: - build-mermaid: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - # uses version from "packageManager" field in package.json - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: pnpm - node-version-file: '.node-version' - - - name: Install Packages - run: | - pnpm install --frozen-lockfile - env: - CYPRESS_CACHE_FOLDER: .cache/Cypress - - - name: Run Build - run: pnpm run build - - - name: Upload Mermaid Build as Artifact - uses: actions/upload-artifact@v4 - with: - name: mermaid-build - path: packages/mermaid/dist - - - name: Upload Mermaid Mindmap Build as Artifact - uses: actions/upload-artifact@v4 - with: - name: mermaid-mindmap-build - path: packages/mermaid-mindmap/dist diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml deleted file mode 100644 index 4dcf709c0..000000000 --- a/.github/workflows/release-publish.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Publish release - -on: - release: - types: [published] - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: fregante/setup-git-user@v2 - - - uses: pnpm/action-setup@v4 - # uses version from "packageManager" field in package.json - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: pnpm - node-version-file: '.node-version' - - - name: Install Packages - run: | - pnpm install --frozen-lockfile - npm i json --global - env: - CYPRESS_CACHE_FOLDER: .cache/Cypress - - - name: Prepare release - run: | - VERSION=${GITHUB_REF:10} - echo "Preparing release $VERSION" - git checkout -t origin/release/$VERSION - npm version --no-git-tag-version --allow-same-version $VERSION - git add package.json - git commit -nm "Bump version $VERSION" - git checkout -t origin/master - git merge -m "Release $VERSION" --no-ff release/$VERSION - git push --no-verify - - - name: Publish - run: | - npm set //registry.npmjs.org/:_authToken $NPM_TOKEN - npm publish - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From d08ef70e0fc55ef9c28df6c976b0006c1bf8c1be Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 15:06:08 +0530 Subject: [PATCH 22/23] chore: Merge checks into lint --- .github/workflows/checks.yml | 26 -------------------------- .github/workflows/lint.yml | 7 +++++++ 2 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/checks.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 012fbf19d..000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,26 +0,0 @@ -on: - push: - merge_group: - pull_request: - types: - - opened - - synchronize - - ready_for_review - -name: Static analysis on Test files - -jobs: - check-tests: - runs-on: ubuntu-latest - name: check tests - if: github.repository_owner == 'mermaid-js' - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: testomatio/check-tests@stable - with: - framework: cypress - tests: './cypress/e2e/**/**.spec.js' - token: ${{ secrets.GITHUB_TOKEN }} - has-tests-label: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 25de168c1..a32a60ab2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -80,3 +80,10 @@ jobs: working-directory: ./packages/mermaid continue-on-error: ${{ github.event_name == 'push' }} run: pnpm run docs:verify + + - uses: testomatio/check-tests@stable + with: + framework: cypress + tests: './cypress/e2e/**/**.spec.js' + token: ${{ secrets.GITHUB_TOKEN }} + has-tests-label: true From f6333b4a5e08743bb6c92212517bebafb159606c Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 24 Aug 2024 15:34:53 +0530 Subject: [PATCH 23/23] chore: Add provenance flag --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b36a82b3..607f8de97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,3 +35,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true