From d05fd25339fd4be4237a60a7710f8abc0d46b868 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Tue, 15 Nov 2022 23:59:17 +0530 Subject: [PATCH 1/9] Fix #3799: Remove `type` from package.json --- packages/mermaid/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 9cbc695b1..f8ff46325 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,11 +1,10 @@ { "name": "mermaid", - "version": "9.2.2", + "version": "9.2.3-rc.1", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "main": "./dist/mermaid.min.js", "module": "./dist/mermaid.core.mjs", "types": "./dist/mermaid.d.ts", - "type": "commonjs", "exports": { ".": { "require": "./dist/mermaid.min.js", From 3358406e685e22e7621a0e4851ac0ff02ad21f19 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 16 Nov 2022 00:06:47 +0530 Subject: [PATCH 2/9] fix: release-preview-publish.yml --- .github/workflows/release-preview-publish.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index 2b2ff559b..da12cb5cc 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -10,21 +10,27 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + - name: Setup Node.js uses: actions/setup-node@v3 with: + cache: pnpm node-version: 18.x - - name: Install Yarn - run: npm i yarn --global + + - name: Install Packages + run: | + pnpm install --frozen-lockfile + env: + CYPRESS_CACHE_FOLDER: .cache/Cypress - name: Install Json run: npm i json --global - - name: Install Packages - run: yarn install --frozen-lockfile - - name: Publish run: | + cd packages/mermaid PREVIEW_VERSION=8 VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION echo $VERSION From 1ad63d5b0b7a410fd9a1809c14bd95c1b0d927d7 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 16 Nov 2022 09:49:41 +0530 Subject: [PATCH 3/9] chore: Add working directory --- .github/workflows/release-preview-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index da12cb5cc..f5b70eedd 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -29,8 +29,8 @@ jobs: run: npm i json --global - name: Publish + working-directory: ./packages/mermaid run: | - cd packages/mermaid PREVIEW_VERSION=8 VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION echo $VERSION From 503114c0eb76f1b3776fd7b5ac6007eac0c64060 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 16 Nov 2022 10:22:37 +0530 Subject: [PATCH 4/9] fix: Add commit count to release preview --- .github/workflows/release-preview-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index f5b70eedd..8bcfbc357 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -31,7 +31,7 @@ jobs: - name: Publish working-directory: ./packages/mermaid run: | - PREVIEW_VERSION=8 + PREVIEW_VERSION=$(git log --oneline "origin/$GITHUB_REF_NAME" ^"origin/master" | wc -l) VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION echo $VERSION npm version --no-git-tag-version --allow-same-version $VERSION From 1d828fe8be8ee818c35df0a2c3dfe153d8d83e5a Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 16 Nov 2022 10:27:42 +0530 Subject: [PATCH 5/9] fix: Add commit count to release preview --- .github/workflows/release-preview-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index 8bcfbc357..f910c67b7 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: | + git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master - uses: pnpm/action-setup@v2 From 52ee234c0fec0dc2a00e78844c193963d0359d7c Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 16 Nov 2022 10:31:07 +0530 Subject: [PATCH 6/9] fix: Fetch depth --- .github/workflows/release-preview-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index f910c67b7..ff57b4f58 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master + git fetch --no-tags --prune --depth=0 origin +refs/heads/master:refs/remotes/origin/master - uses: pnpm/action-setup@v2 From e05e0f8ae35e7e6c1739a68b76361637aea9b18e Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 16 Nov 2022 10:31:49 +0530 Subject: [PATCH 7/9] fix: Fetch depth --- .github/workflows/release-preview-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index ff57b4f58..e9c4e46a3 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: | - git fetch --no-tags --prune --depth=0 origin +refs/heads/master:refs/remotes/origin/master + git fetch --no-tags --prune origin +refs/heads/master:refs/remotes/origin/master - uses: pnpm/action-setup@v2 From 2092330eec603abfd673cf782762f217bd8b5e5c Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 16 Nov 2022 11:30:58 +0530 Subject: [PATCH 8/9] fix: Fetch depth --- .github/workflows/release-preview-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index e9c4e46a3..5f4936ab6 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: | - git fetch --no-tags --prune origin +refs/heads/master:refs/remotes/origin/master + with: + fetch-depth: 0 - uses: pnpm/action-setup@v2 From e9f8ba6915376b2bd30e0b63075fb243806c2d4c Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 18 Nov 2022 11:28:29 +0530 Subject: [PATCH 9/9] doc: Add mindmap integration docs --- docs/mindmap.md | 14 ++++++++++++++ docs/n00b-gettingStarted.md | 4 ++++ packages/mermaid/src/docs/mindmap.md | 14 ++++++++++++++ packages/mermaid/src/docs/n00b-gettingStarted.md | 4 ++++ 4 files changed, 36 insertions(+) diff --git a/docs/mindmap.md b/docs/mindmap.md index 32f1e099d..935572ddc 100644 --- a/docs/mindmap.md +++ b/docs/mindmap.md @@ -235,3 +235,17 @@ Root B C ``` + +## Integrating with your library/website. + +Mindmap uses the experimental lazy loading & async rendering features which could change in the future. + +```html + +``` + +You can also refer the implementation in the live editor [here](https://github.com/mermaid-js/mermaid-live-editor/blob/fcf53c98c25604c90a218104268c339be53035a6/src/lib/util/mermaid.ts) to see how the async loading is done. diff --git a/docs/n00b-gettingStarted.md b/docs/n00b-gettingStarted.md index feac48919..e4e98d082 100644 --- a/docs/n00b-gettingStarted.md +++ b/docs/n00b-gettingStarted.md @@ -119,6 +119,10 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac | ----------- | --------------------------------- | ------- | ----------- | | startOnLoad | Toggle for Rendering upon loading | Boolean | true, false | +### Adding external diagrams to mermaid + +Please refer to the [Mindmap](./mindmap.md?id=integrating-with-your-librarywebsite) section for more information. + ### Working Examples **Here is a full working example of the mermaidAPI being called through the CDN:** diff --git a/packages/mermaid/src/docs/mindmap.md b/packages/mermaid/src/docs/mindmap.md index 5aa6f4953..2b47e3e19 100644 --- a/packages/mermaid/src/docs/mindmap.md +++ b/packages/mermaid/src/docs/mindmap.md @@ -153,3 +153,17 @@ Root B C ``` + +## Integrating with your library/website. + +Mindmap uses the experimental lazy loading & async rendering features which could change in the future. + +```html + +``` + +You can also refer the implementation in the live editor [here](https://github.com/mermaid-js/mermaid-live-editor/blob/fcf53c98c25604c90a218104268c339be53035a6/src/lib/util/mermaid.ts) to see how the async loading is done. diff --git a/packages/mermaid/src/docs/n00b-gettingStarted.md b/packages/mermaid/src/docs/n00b-gettingStarted.md index 095cece24..398541eb1 100644 --- a/packages/mermaid/src/docs/n00b-gettingStarted.md +++ b/packages/mermaid/src/docs/n00b-gettingStarted.md @@ -117,6 +117,10 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac | ----------- | --------------------------------- | ------- | ----------- | | startOnLoad | Toggle for Rendering upon loading | Boolean | true, false | +### Adding external diagrams to mermaid + +Please refer to the [Mindmap](./mindmap.md?id=integrating-with-your-librarywebsite) section for more information. + ### Working Examples **Here is a full working example of the mermaidAPI being called through the CDN:**