From 0ef115f69ab7c0e1f0d7ca880991f914fe9e437f Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 17 May 2023 11:28:17 +0530 Subject: [PATCH 1/9] Fix vitepress build --- 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 dd4f5344b..53f0728f7 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -28,7 +28,7 @@ "docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts", "docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts --verify", "docs:pre:vitepress": "rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.mts --vitepress", - "docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm --filter ./ install && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing", + "docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm --filter ./ install --no-frozen-lockfile && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing", "docs:dev": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./ src/vitepress dev\" \"ts-node-esm src/docs.mts --watch --vitepress\"", "docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress", "docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"", From 9eeeb97e15059a6e8891a9b24f4b1ffbe765805f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 06:00:51 +0000 Subject: [PATCH 2/9] Update all patch dependencies --- packages/mermaid/src/docs/package.json | 2 +- pnpm-lock.yaml | 134 ++++++++++++++----------- 2 files changed, 76 insertions(+), 60 deletions(-) diff --git a/packages/mermaid/src/docs/package.json b/packages/mermaid/src/docs/package.json index 6135fa15b..01a63aeb5 100644 --- a/packages/mermaid/src/docs/package.json +++ b/packages/mermaid/src/docs/package.json @@ -30,7 +30,7 @@ "unplugin-vue-components": "^0.24.1", "vite": "^4.3.3", "vite-plugin-pwa": "^0.14.7", - "vitepress": "1.0.0-alpha.74", + "vitepress": "1.0.0-alpha.75", "workbox-window": "^6.5.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d69718ef8..f52a221e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -419,60 +419,8 @@ importers: specifier: ^0.14.7 version: 0.14.7(vite@4.3.3)(workbox-build@6.5.4)(workbox-window@6.5.4) vitepress: - specifier: 1.0.0-alpha.74 - version: 1.0.0-alpha.74(@algolia/client-search@4.14.2)(@types/node@18.16.0) - workbox-window: - specifier: ^6.5.4 - version: 6.5.4 - - packages/mermaid/src/vitepress: - dependencies: - '@vueuse/core': - specifier: ^10.1.0 - version: 10.1.0(vue@3.2.47) - jiti: - specifier: ^1.18.2 - version: 1.18.2 - vue: - specifier: ^3.2.47 - version: 3.2.47 - devDependencies: - '@iconify-json/carbon': - specifier: ^1.1.16 - version: 1.1.16 - '@unocss/reset': - specifier: ^0.51.8 - version: 0.51.8 - '@vite-pwa/vitepress': - specifier: ^0.0.5 - version: 0.0.5(vite-plugin-pwa@0.14.7) - '@vitejs/plugin-vue': - specifier: ^4.2.1 - version: 4.2.1(vite@4.3.3)(vue@3.2.47) - fast-glob: - specifier: ^3.2.12 - version: 3.2.12 - https-localhost: - specifier: ^4.7.1 - version: 4.7.1 - pathe: - specifier: ^1.1.0 - version: 1.1.0 - unocss: - specifier: ^0.51.8 - version: 0.51.8(postcss@8.4.23)(rollup@2.79.1)(vite@4.3.3) - unplugin-vue-components: - specifier: ^0.24.1 - version: 0.24.1(rollup@2.79.1)(vue@3.2.47) - vite: - specifier: ^4.3.3 - version: 4.3.3(@types/node@18.16.0) - vite-plugin-pwa: - specifier: ^0.14.7 - version: 0.14.7(vite@4.3.3)(workbox-build@6.5.4)(workbox-window@6.5.4) - vitepress: - specifier: 1.0.0-alpha.74 - version: 1.0.0-alpha.74(@algolia/client-search@4.14.2)(@types/node@18.16.0) + specifier: 1.0.0-alpha.75 + version: 1.0.0-alpha.75(@algolia/client-search@4.14.2)(@types/node@18.16.0) workbox-window: specifier: ^6.5.4 version: 6.5.4 @@ -504,6 +452,12 @@ packages: '@algolia/autocomplete-shared': 1.7.4 dev: true + /@algolia/autocomplete-core@1.8.2: + resolution: {integrity: sha512-mTeshsyFhAqw/ebqNsQpMtbnjr+qVOSKXArEj4K0d7sqc8It1XD0gkASwecm9mF/jlOQ4Z9RNg1HbdA8JPdRwQ==} + dependencies: + '@algolia/autocomplete-shared': 1.8.2 + dev: true + /@algolia/autocomplete-preset-algolia@1.7.4(@algolia/client-search@4.14.2)(algoliasearch@4.14.2): resolution: {integrity: sha512-s37hrvLEIfcmKY8VU9LsAXgm2yfmkdHT3DnA3SgHaY93yjZ2qL57wzb5QweVkYuEBZkT2PIREvRoLXC2sxTbpQ==} peerDependencies: @@ -515,10 +469,25 @@ packages: algoliasearch: 4.14.2 dev: true + /@algolia/autocomplete-preset-algolia@1.8.2(@algolia/client-search@4.14.2)(algoliasearch@4.14.2): + resolution: {integrity: sha512-J0oTx4me6ZM9kIKPuL3lyU3aB8DEvpVvR6xWmHVROx5rOYJGQcZsdG4ozxwcOyiiu3qxMkIbzntnV1S1VWD8yA==} + peerDependencies: + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' + dependencies: + '@algolia/autocomplete-shared': 1.8.2 + '@algolia/client-search': 4.14.2 + algoliasearch: 4.14.2 + dev: true + /@algolia/autocomplete-shared@1.7.4: resolution: {integrity: sha512-2VGCk7I9tA9Ge73Km99+Qg87w0wzW4tgUruvWAn/gfey1ZXgmxZtyIRBebk35R1O8TbK77wujVtCnpsGpRy1kg==} dev: true + /@algolia/autocomplete-shared@1.8.2: + resolution: {integrity: sha512-b6Z/X4MczChMcfhk6kfRmBzPgjoPzuS9KGR4AFsiLulLNRAAqhP+xZTKtMnZGhLuc61I20d5WqlId02AZvcO6g==} + dev: true + /@algolia/cache-browser-local-storage@4.14.2: resolution: {integrity: sha512-FRweBkK/ywO+GKYfAWbrepewQsPTIEirhi1BdykX9mxvBPtGNKccYAxvGdDCumU1jL4r3cayio4psfzKMejBlA==} dependencies: @@ -2908,6 +2877,10 @@ packages: resolution: {integrity: sha512-6SCwI7P8ao+se1TUsdZ7B4XzL+gqeQZnBc+2EONZlcVa0dVrk0NjETxozFKgMv0eEGH8QzP1fkN+A1rH61l4eg==} dev: true + /@docsearch/css@3.3.4: + resolution: {integrity: sha512-vDwCDoVXDgopw/hvr0zEADew2wWaGP8Qq0Bxhgii1Ewz2t4fQeyJwIRN/mWADeLFYPVkpz8TpEbxya/i6Tm0WA==} + dev: true + /@docsearch/js@3.3.3(@algolia/client-search@4.14.2)(react-dom@16.14.0)(react@16.14.0): resolution: {integrity: sha512-2xAv2GFuHzzmG0SSZgf8wHX0qZX8n9Y1ZirKUk5Wrdc+vH9CL837x2hZIUdwcPZI9caBA+/CzxsS68O4waYjUQ==} dependencies: @@ -2920,6 +2893,18 @@ packages: - react-dom dev: true + /@docsearch/js@3.3.4(@algolia/client-search@4.14.2): + resolution: {integrity: sha512-Xd2saBziXJ1UuVpcDz94zAFEFAM6ap993agh0za2e3LDZLhaW993b1f9gyUL4e1CZLsR076tztG2un2gVncvpA==} + dependencies: + '@docsearch/react': 3.3.4(@algolia/client-search@4.14.2) + preact: 10.11.0 + transitivePeerDependencies: + - '@algolia/client-search' + - '@types/react' + - react + - react-dom + dev: true + /@docsearch/react@3.3.3(@algolia/client-search@4.14.2)(react-dom@16.14.0)(react@16.14.0): resolution: {integrity: sha512-pLa0cxnl+G0FuIDuYlW+EBK6Rw2jwLw9B1RHIeS4N4s2VhsfJ/wzeCi3CWcs5yVfxLd5ZK50t//TMA5e79YT7Q==} peerDependencies: @@ -2944,6 +2929,28 @@ packages: - '@algolia/client-search' dev: true + /@docsearch/react@3.3.4(@algolia/client-search@4.14.2): + resolution: {integrity: sha512-aeOf1WC5zMzBEi2SI6WWznOmIo9rnpN4p7a3zHXxowVciqlI4HsZGtOR9nFOufLeolv7HibwLlaM0oyUqJxasw==} + peerDependencies: + '@types/react': '>= 16.8.0 < 19.0.0' + react: '>= 16.8.0 < 19.0.0' + react-dom: '>= 16.8.0 < 19.0.0' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + react-dom: + optional: true + dependencies: + '@algolia/autocomplete-core': 1.8.2 + '@algolia/autocomplete-preset-algolia': 1.8.2(@algolia/client-search@4.14.2)(algoliasearch@4.14.2) + '@docsearch/css': 3.3.4 + algoliasearch: 4.14.2 + transitivePeerDependencies: + - '@algolia/client-search' + dev: true + /@es-joy/jsdoccomment@0.37.1: resolution: {integrity: sha512-5vxWJ1gEkEF0yRd0O+uK6dHJf7adrxwQSX8PuRiPfFSAbNLnY0ZJfXaZucoz14Jj2N11xn2DnlEPwWRpYpvRjg==} engines: {node: ^14 || ^16 || ^17 || ^18 || ^19 || ^20} @@ -12829,6 +12836,15 @@ packages: vscode-textmate: 8.0.0 dev: true + /shiki@0.14.2: + resolution: {integrity: sha512-ltSZlSLOuSY0M0Y75KA+ieRaZ0Trf5Wl3gutE7jzLuIcWxLp5i/uEnLoQWNvgKXQ5OMpGkJnVMRLAuzjc0LJ2A==} + dependencies: + ansi-sequence-parser: 1.1.0 + jsonc-parser: 3.2.0 + vscode-oniguruma: 1.7.0 + vscode-textmate: 8.0.0 + dev: true + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -14253,19 +14269,19 @@ packages: - terser dev: true - /vitepress@1.0.0-alpha.74(@algolia/client-search@4.14.2)(@types/node@18.16.0): - resolution: {integrity: sha512-n5UHqsLJKaJ3V6BSiofS5ZVhtxzarNIn3/kyOzUp/vePmVbQyX/pZ6/MhZgNr0g5t4E55j7XM3AHf/Fo0hnrpw==} + /vitepress@1.0.0-alpha.75(@algolia/client-search@4.14.2)(@types/node@18.16.0): + resolution: {integrity: sha512-twpPZ/6UnDR8X0Nmj767KwKhXlTQQM9V/J1i2BP9ryO29/w4hpxBfEum6nvfpNhJ4H3h+cIhwzAK/e9crZ6HEQ==} hasBin: true dependencies: - '@docsearch/css': 3.3.3 - '@docsearch/js': 3.3.3(@algolia/client-search@4.14.2)(react-dom@16.14.0)(react@16.14.0) + '@docsearch/css': 3.3.4 + '@docsearch/js': 3.3.4(@algolia/client-search@4.14.2) '@vitejs/plugin-vue': 4.2.1(vite@4.3.3)(vue@3.2.47) '@vue/devtools-api': 6.5.0 '@vueuse/core': 10.1.0(vue@3.2.47) body-scroll-lock: 4.0.0-beta.0 mark.js: 8.11.1 minisearch: 6.0.1 - shiki: 0.14.1 + shiki: 0.14.2 vite: 4.3.3(@types/node@18.16.0) vue: 3.2.47 transitivePeerDependencies: From b1590c2211777f986f223b1c91d784fb59b004a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 09:18:32 +0000 Subject: [PATCH 3/9] Update all minor dependencies --- .github/workflows/link-checker.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 3a9af99c1..a2dc989e7 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -36,7 +36,7 @@ jobs: restore-keys: cache-lychee- - name: Link Checker - uses: lycheeverse/lychee-action@v1.7.0 + uses: lycheeverse/lychee-action@v1.8.0 with: args: >- --verbose diff --git a/package.json b/package.json index fe7a3ba00..80cb6087b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "10.1.0", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "type": "module", - "packageManager": "pnpm@8.4.0", + "packageManager": "pnpm@8.5.1", "keywords": [ "diagram", "markdown", From bb400d53b9edab6ebced1d59ff7f443822af5dce Mon Sep 17 00:00:00 2001 From: Dong Cai <3481791+dontry@users.noreply.github.com> Date: Tue, 16 May 2023 20:29:56 +1000 Subject: [PATCH 4/9] Address mermaid-zenuml PR comments --- docs/syntax/zenuml.md | 108 ++++++++++++++++----- packages/mermaid-zenuml/README.md | 1 + packages/mermaid-zenuml/package.json | 26 ++--- packages/mermaid-zenuml/src/parser.ts | 10 +- packages/mermaid/src/docs/syntax/zenuml.md | 77 +++++++++------ 5 files changed, 152 insertions(+), 70 deletions(-) create mode 120000 packages/mermaid-zenuml/README.md diff --git a/docs/syntax/zenuml.md b/docs/syntax/zenuml.md index a9c7c0f4b..d936e5f76 100644 --- a/docs/syntax/zenuml.md +++ b/docs/syntax/zenuml.md @@ -8,7 +8,7 @@ > A Sequence diagram is an interaction diagram that shows how processes operate with one another and in what order. -Mermaid can render sequence diagrams with ZenUML. Note that ZenUML uses a different +Mermaid can render sequence diagrams with [ZenUML](https://zenuml.com). Note that ZenUML uses a different syntax than the original Sequence Diagram in mermaid. ```mermaid-example @@ -153,13 +153,24 @@ zenuml We use `new` keyword to create an object. +```mermaid-example +zenuml new A1 new A2(with, parameters) +``` + +```mermaid +zenuml + new A1 + new A2(with, parameters) +``` ### Reply message There are three ways to express a reply message: +```mermaid-example +zenuml // 1. assign a variable from a sync message. a = A.SyncMessage() @@ -168,12 +179,31 @@ There are three ways to express a reply message: // 2. use return keyword A.SyncMessage() { - return result + return result } // 3. use @return or @reply annotator on an async message @return A->B: result +``` + +```mermaid +zenuml + // 1. assign a variable from a sync message. + a = A.SyncMessage() + + // 1.1. optionally give the variable a type + SomeType a = A.SyncMessage() + + // 2. use return keyword + A.SyncMessage() { + return result + } + + // 3. use @return or @reply annotator on an async message + @return + A->B: result +``` The third way `@return` is rarely used, but it is useful when you want to return to one level up. @@ -237,11 +267,23 @@ are ignored. Markdown is supported. See the example below: - // a comment on a participent will not be rendered +```mermaid-example +zenuml + // a comment on a participant will not be rendered BookService // a comment on a message. // **Markdown** is supported. BookService.getBook() +``` + +```mermaid +zenuml + // a comment on a participant will not be rendered + BookService + // a comment on a message. + // **Markdown** is supported. + BookService.getBook() +``` ## Loops @@ -253,11 +295,11 @@ following notations: 3. forEach, foreach 4. loop - - - while(condition) { - ...statements... - } +```zenuml +while(condition) { + ...statements... +} +``` See the example below: @@ -281,13 +323,15 @@ zenuml It is possible to express alternative paths in a sequence diagram. This is done by the notation - if(condition1) { - ...statements... - } else if(condition2) { - ...statements... - } else { - ...statements... - } +```zenuml +if(condition1) { + ...statements... +} else if(condition2) { + ...statements... +} else { + ...statements... +} +``` See the example below: @@ -315,9 +359,11 @@ zenuml It is possible to render an `opt` fragment. This is done by the notation - opt { - ...statements... - } +```zenuml +opt { + ...statements... +} +``` See the example below: @@ -345,11 +391,13 @@ It is possible to show actions that are happening in parallel. This is done by the notation - par { - statement1 - statement2 - statement3 - } +```zenuml +par { + statement1 + statement2 + statement3 +} +``` See the example below: @@ -408,3 +456,17 @@ zenuml API->BookingService: rollback status } ``` + +## Integrating with your library/website. + +Zenuml uses the experimental lazy loading & async rendering features which could change in the future. + +You can use this method to add mermaid including the zenuml diagram to a web page: + +```html + +``` diff --git a/packages/mermaid-zenuml/README.md b/packages/mermaid-zenuml/README.md new file mode 120000 index 000000000..e80740063 --- /dev/null +++ b/packages/mermaid-zenuml/README.md @@ -0,0 +1 @@ +../mermaid/src/docs/syntax/zenuml.md \ No newline at end of file diff --git a/packages/mermaid-zenuml/package.json b/packages/mermaid-zenuml/package.json index 67e6a6e38..c6cf93061 100644 --- a/packages/mermaid-zenuml/package.json +++ b/packages/mermaid-zenuml/package.json @@ -1,7 +1,7 @@ { "name": "@mermaid-js/mermaid-zenuml", - "version": "0.0.1", - "description": "Zenuml integration for MermaidJS.", + "version": "0.1.0", + "description": "MermaidJS plugin for ZenUML integration", "module": "dist/mermaid-zenuml.core.mjs", "types": "dist/detector.d.ts", "type": "module", @@ -23,23 +23,23 @@ }, "repository": { "type": "git", - "url": "https://github.com/mermaid-js/mermaid" + "url": "https://github.com/mermaid-js/mermaid", + "directory": "packages/mermaid-zenuml" }, - "author": "Peng Xiao", + "contributors": [ + "Peng Xiao", + "Sidharth Vinod (https://sidharth.dev)", + "Dong Cai" + ], "license": "MIT", - "standard": { - "ignore": [ - "dist/**/*.js" - ], - "globals": [ - "page" - ] - }, "dependencies": { "@zenuml/core": "^3.0.0" }, "devDependencies": { - "mermaid": "workspace:*" + "mermaid": "workspace:^" + }, + "peerDependencies": { + "mermaid": "workspace:^" }, "files": [ "dist" diff --git a/packages/mermaid-zenuml/src/parser.ts b/packages/mermaid-zenuml/src/parser.ts index 6a97991c6..8c0ca55d5 100644 --- a/packages/mermaid-zenuml/src/parser.ts +++ b/packages/mermaid-zenuml/src/parser.ts @@ -1,7 +1,9 @@ -// ZenUML manage parsing internally. It uses Antlr4 to parse the DSL. -// The parser is defined in https://github.com/ZenUml/vue-sequence/blob/main/src/parser/index.js - -// This is a dummy parser that satisfies the mermaid API logic. +/** + * ZenUML manage parsing internally. It uses Antlr4 to parse the DSL. + * The parser is defined in https://github.com/ZenUml/vue-sequence/blob/main/src/parser/index.js + * + * This is a dummy parser that satisfies the mermaid API logic. + */ export default { parser: { yy: {} }, parse: () => { diff --git a/packages/mermaid/src/docs/syntax/zenuml.md b/packages/mermaid/src/docs/syntax/zenuml.md index 03081f2b9..e4babf705 100644 --- a/packages/mermaid/src/docs/syntax/zenuml.md +++ b/packages/mermaid/src/docs/syntax/zenuml.md @@ -2,7 +2,7 @@ > A Sequence diagram is an interaction diagram that shows how processes operate with one another and in what order. -Mermaid can render sequence diagrams with ZenUML. Note that ZenUML uses a different +Mermaid can render sequence diagrams with [ZenUML](https://zenuml.com). Note that ZenUML uses a different syntax than the original Sequence Diagram in mermaid. ```mermaid-example @@ -97,30 +97,32 @@ zenuml We use `new` keyword to create an object. -``` -new A1 -new A2(with, parameters) +```mermaid-example +zenuml + new A1 + new A2(with, parameters) ``` ### Reply message There are three ways to express a reply message: -``` -// 1. assign a variable from a sync message. -a = A.SyncMessage() +```mermaid-example +zenuml + // 1. assign a variable from a sync message. + a = A.SyncMessage() -// 1.1. optionally give the variable a type -SomeType a = A.SyncMessage() + // 1.1. optionally give the variable a type + SomeType a = A.SyncMessage() -// 2. use return keyword -A.SyncMessage() { - return result -} + // 2. use return keyword + A.SyncMessage() { + return result + } -// 3. use @return or @reply annotator on an async message -@return -A->B: result + // 3. use @return or @reply annotator on an async message + @return + A->B: result ``` The third way `@return` is rarely used, but it is useful when you want to return to one level up. @@ -161,12 +163,13 @@ are ignored. Markdown is supported. See the example below: -``` -// a comment on a participent will not be rendered -BookService -// a comment on a message. -// **Markdown** is supported. -BookService.getBook() +```mermaid-example +zenuml + // a comment on a participant will not be rendered + BookService + // a comment on a message. + // **Markdown** is supported. + BookService.getBook() ``` ## Loops @@ -179,9 +182,9 @@ following notations: 3. forEach, foreach 4. loop -``` +```zenuml while(condition) { - ...statements... + ...statements... } ``` @@ -199,13 +202,13 @@ zenuml It is possible to express alternative paths in a sequence diagram. This is done by the notation -``` +```zenuml if(condition1) { - ...statements... + ...statements... } else if(condition2) { - ...statements... + ...statements... } else { - ...statements... + ...statements... } ``` @@ -225,7 +228,7 @@ zenuml It is possible to render an `opt` fragment. This is done by the notation -``` +```zenuml opt { ...statements... } @@ -248,7 +251,7 @@ It is possible to show actions that are happening in parallel. This is done by the notation -``` +```zenuml par { statement1 statement2 @@ -295,3 +298,17 @@ zenuml API->BookingService: rollback status } ``` + +## Integrating with your library/website. + +Zenuml uses the experimental lazy loading & async rendering features which could change in the future. + +You can use this method to add mermaid including the zenuml diagram to a web page: + +```html + +``` From 507e24cc7284c4709145e6ca16e3eb16a898bae3 Mon Sep 17 00:00:00 2001 From: Dong Cai <3481791+dontry@users.noreply.github.com> Date: Tue, 16 May 2023 21:08:25 +1000 Subject: [PATCH 5/9] update pnpm-lock.yaml --- pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c86e69b55..3441625da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -380,7 +380,7 @@ importers: version: 3.0.0(ts-node@10.9.1) devDependencies: mermaid: - specifier: workspace:* + specifier: workspace:^ version: link:../mermaid tests/webpack: From 27e59e5adcce25d9419259fc842b79470fb1d883 Mon Sep 17 00:00:00 2001 From: Dong Cai <3481791+dontry@users.noreply.github.com> Date: Tue, 16 May 2023 23:41:53 +1000 Subject: [PATCH 6/9] fixed typo and update peerDependencies version --- docs/syntax/zenuml.md | 2 +- packages/mermaid-zenuml/package.json | 2 +- packages/mermaid/src/docs/syntax/zenuml.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/syntax/zenuml.md b/docs/syntax/zenuml.md index d936e5f76..9e9b11255 100644 --- a/docs/syntax/zenuml.md +++ b/docs/syntax/zenuml.md @@ -466,7 +466,7 @@ You can use this method to add mermaid including the zenuml diagram to a web pag ```html ``` diff --git a/packages/mermaid-zenuml/package.json b/packages/mermaid-zenuml/package.json index c6cf93061..3e26e0dcf 100644 --- a/packages/mermaid-zenuml/package.json +++ b/packages/mermaid-zenuml/package.json @@ -39,7 +39,7 @@ "mermaid": "workspace:^" }, "peerDependencies": { - "mermaid": "workspace:^" + "mermaid": "workspace:>=10.0.0" }, "files": [ "dist" diff --git a/packages/mermaid/src/docs/syntax/zenuml.md b/packages/mermaid/src/docs/syntax/zenuml.md index e4babf705..292c0f1c1 100644 --- a/packages/mermaid/src/docs/syntax/zenuml.md +++ b/packages/mermaid/src/docs/syntax/zenuml.md @@ -308,7 +308,7 @@ You can use this method to add mermaid including the zenuml diagram to a web pag ```html ``` From 49c97dad4c6f56729796c46b6429e29b7cfcbd86 Mon Sep 17 00:00:00 2001 From: dontry Date: Wed, 17 May 2023 23:50:57 +1000 Subject: [PATCH 7/9] ignore ZenUML types --- package.json | 2 +- packages/mermaid-zenuml/src/zenumlRenderer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fe7a3ba00..611622029 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build:vite": "ts-node-esm --transpileOnly .vite/build.ts", "build:mermaid": "pnpm build:vite --mermaid", "build:viz": "pnpm build:mermaid --visualize", - "build:types": "tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-example-diagram/tsconfig.json --emitDeclarationOnly", + "build:types": "tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-zenuml/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-example-diagram/tsconfig.json --emitDeclarationOnly", "build:watch": "pnpm build:vite --watch", "build": "pnpm run -r clean && pnpm build:types && pnpm build:vite", "dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"", diff --git a/packages/mermaid-zenuml/src/zenumlRenderer.ts b/packages/mermaid-zenuml/src/zenumlRenderer.ts index 8ea5f4331..e8ab69cdd 100644 --- a/packages/mermaid-zenuml/src/zenumlRenderer.ts +++ b/packages/mermaid-zenuml/src/zenumlRenderer.ts @@ -53,7 +53,7 @@ export const draw = async function (text: string, id: string) { const { foreignObject, container, app } = createForeignObject(id); svgContainer.appendChild(foreignObject); - + // @ts-expect-error @zenuml/core@3.0.0 exports the wrong type for ZenUml const zenuml = new ZenUml(app); // default is a theme name. More themes to be added and will be configurable in the future await zenuml.render(text, 'theme-mermaid'); From a00616863d28322100b289845d75a103dc378451 Mon Sep 17 00:00:00 2001 From: dontry Date: Wed, 17 May 2023 23:51:51 +1000 Subject: [PATCH 8/9] Add contributors profile url --- packages/mermaid-zenuml/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid-zenuml/package.json b/packages/mermaid-zenuml/package.json index 3e26e0dcf..6181c857b 100644 --- a/packages/mermaid-zenuml/package.json +++ b/packages/mermaid-zenuml/package.json @@ -27,9 +27,9 @@ "directory": "packages/mermaid-zenuml" }, "contributors": [ - "Peng Xiao", + "Peng Xiao (https://github.com/MrCoder)", "Sidharth Vinod (https://sidharth.dev)", - "Dong Cai" + "Dong Cai (https://github.com/dontry)" ], "license": "MIT", "dependencies": { From 6cce1b20fb83116e98b784f80edc80e07b2b82dc Mon Sep 17 00:00:00 2001 From: aloisklink Date: Wed, 17 May 2023 18:46:58 +0000 Subject: [PATCH 9/9] Update docs --- docs/config/setup/README.md | 13 + docs/config/setup/modules/config.md | 276 +++++++++++++++++++++ docs/config/setup/modules/defaultConfig.md | 56 +++++ 3 files changed, 345 insertions(+) create mode 100644 docs/config/setup/README.md create mode 100644 docs/config/setup/modules/config.md create mode 100644 docs/config/setup/modules/defaultConfig.md diff --git a/docs/config/setup/README.md b/docs/config/setup/README.md new file mode 100644 index 000000000..1cf82797d --- /dev/null +++ b/docs/config/setup/README.md @@ -0,0 +1,13 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/README.md](../../../packages/mermaid/src/docs/config/setup/README.md). + +# mermaid + +## Modules + +- [config](modules/config.md) +- [defaultConfig](modules/defaultConfig.md) +- [mermaidAPI](modules/mermaidAPI.md) diff --git a/docs/config/setup/modules/config.md b/docs/config/setup/modules/config.md new file mode 100644 index 000000000..8381dc8c7 --- /dev/null +++ b/docs/config/setup/modules/config.md @@ -0,0 +1,276 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/modules/config.md](../../../../packages/mermaid/src/docs/config/setup/modules/config.md). + +# Module: config + +## Variables + +### defaultConfig + +• `Const` **defaultConfig**: `MermaidConfig` + +#### Defined in + +[config.ts:7](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L7) + +## Functions + +### addDirective + +▸ **addDirective**(`directive`): `void` + +Pushes in a directive to the configuration + +#### Parameters + +| Name | Type | Description | +| :---------- | :---- | :----------------------- | +| `directive` | `any` | The directive to push in | + +#### Returns + +`void` + +#### Defined in + +[config.ts:191](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L191) + +--- + +### getConfig + +▸ **getConfig**(): `MermaidConfig` + +## getConfig + +| Function | Description | Type | Return Values | +| --------- | ------------------------- | ----------- | ------------------------------ | +| getConfig | Obtains the currentConfig | Get Request | Any Values from current Config | + +**Notes**: Returns **any** the currentConfig + +#### Returns + +`MermaidConfig` + +The currentConfig + +#### Defined in + +[config.ts:137](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L137) + +--- + +### getSiteConfig + +▸ **getSiteConfig**(): `MermaidConfig` + +## getSiteConfig + +| Function | Description | Type | Values | +| ------------- | ------------------------------------------------- | ----------- | -------------------------------- | +| setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig | + +**Notes**: Returns **any** values in siteConfig. + +#### Returns + +`MermaidConfig` + +The siteConfig + +#### Defined in + +[config.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L96) + +--- + +### reset + +▸ **reset**(`config?`): `void` + +## reset + +| Function | Description | Type | Required | Values | +| -------- | ---------------------------- | ----------- | -------- | ------ | +| reset | Resets currentConfig to conf | Put Request | Required | None | + +## conf + +| Parameter | Description | Type | Required | Values | +| --------- | -------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- | +| conf | base set of values, which currentConfig could be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array | + +**Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`) + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :-------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `config` | `MermaidConfig` | `siteConfig` | base set of values, which currentConfig could be **reset** to. Defaults to the current siteConfig (e.g returned by [getSiteConfig](config.md#getsiteconfig)). | + +#### Returns + +`void` + +#### Defined in + +[config.ts:223](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L223) + +--- + +### sanitize + +▸ **sanitize**(`options`): `void` + +## sanitize + +| Function | Description | Type | Values | +| -------- | -------------------------------------- | ----------- | ------ | +| sanitize | Sets the siteConfig to desired values. | Put Request | None | + +Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies +options in-place + +#### Parameters + +| Name | Type | Description | +| :-------- | :---- | :-------------------------------- | +| `options` | `any` | The potential setConfig parameter | + +#### Returns + +`void` + +#### Defined in + +[config.ts:152](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L152) + +--- + +### saveConfigFromInitialize + +▸ **saveConfigFromInitialize**(`conf`): `void` + +#### Parameters + +| Name | Type | +| :----- | :-------------- | +| `conf` | `MermaidConfig` | + +#### Returns + +`void` + +#### Defined in + +[config.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L75) + +--- + +### setConfig + +▸ **setConfig**(`conf`): `MermaidConfig` + +## setConfig + +| Function | Description | Type | Values | +| ------------- | ------------------------------------- | ----------- | --------------------------------------- | +| setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | + +**Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure +keys. Any values found in conf with key found in siteConfig.secure will be replaced with the +corresponding siteConfig value. + +#### Parameters + +| Name | Type | Description | +| :----- | :-------------- | :-------------------------- | +| `conf` | `MermaidConfig` | The potential currentConfig | + +#### Returns + +`MermaidConfig` + +The currentConfig merged with the sanitized conf + +#### Defined in + +[config.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L113) + +--- + +### setSiteConfig + +▸ **setSiteConfig**(`conf`): `MermaidConfig` + +## setSiteConfig + +| Function | Description | Type | Values | +| ------------- | ------------------------------------- | ----------- | --------------------------------------- | +| setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | + +**Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls +to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) +will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this +function _Default value: At default, will mirror Global Config_ + +#### Parameters + +| Name | Type | Description | +| :----- | :-------------- | :------------------------------------------ | +| `conf` | `MermaidConfig` | The base currentConfig to use as siteConfig | + +#### Returns + +`MermaidConfig` + +The new siteConfig + +#### Defined in + +[config.ts:61](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L61) + +--- + +### updateCurrentConfig + +▸ **updateCurrentConfig**(`siteCfg`, `_directives`): `MermaidConfig` + +#### Parameters + +| Name | Type | +| :------------ | :-------------- | +| `siteCfg` | `MermaidConfig` | +| `_directives` | `any`\[] | + +#### Returns + +`MermaidConfig` + +#### Defined in + +[config.ts:14](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L14) + +--- + +### updateSiteConfig + +▸ **updateSiteConfig**(`conf`): `MermaidConfig` + +#### Parameters + +| Name | Type | +| :----- | :-------------- | +| `conf` | `MermaidConfig` | + +#### Returns + +`MermaidConfig` + +#### Defined in + +[config.ts:79](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L79) diff --git a/docs/config/setup/modules/defaultConfig.md b/docs/config/setup/modules/defaultConfig.md new file mode 100644 index 000000000..d95ec4e92 --- /dev/null +++ b/docs/config/setup/modules/defaultConfig.md @@ -0,0 +1,56 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/modules/defaultConfig.md](../../../../packages/mermaid/src/docs/config/setup/modules/defaultConfig.md). + +# Module: defaultConfig + +## Variables + +### configKeys + +• `Const` **configKeys**: `string`\[] + +#### Defined in + +[defaultConfig.ts:2293](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L2293) + +--- + +### default + +• `Const` **default**: `Partial`<`MermaidConfig`> + +**Configuration methods in Mermaid version 8.6.0 have been updated, to learn more\[[click +here](8.6.0_docs.md)].** + +## **What follows are config instructions for older versions** + +These are the default options which can be overridden with the initialization call like so: + +**Example 1:** + +```js +mermaid.initialize({ flowchart: { htmlLabels: false } }); +``` + +**Example 2:** + +```html + +``` + +A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults). +A description of each option follows below. + +#### Defined in + +[defaultConfig.ts:33](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L33)