From 54de763a663520ba975f8ff2c30cbde1316c53cc Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 25 Aug 2023 00:12:14 +0530 Subject: [PATCH 1/3] chore: Add live editor build script for previews --- scripts/editor.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/editor.sh diff --git a/scripts/editor.sh b/scripts/editor.sh new file mode 100755 index 0000000000..1fd9a56f26 --- /dev/null +++ b/scripts/editor.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# We have to use npm instead of yarn because it causes trouble in netlify + +# Link local mermaid to npm +pushd packages/mermaid || exit +npm link +popd || exit + +# Clone the Mermaid Live Editor repository +git clone https://github.com/mermaid-js/mermaid-live-editor.git + +# Change to the repository directory +cd mermaid-live-editor || exit + +# Link local mermaid to live editor +npm link mermaid + +# Install dependencies +npm install + +# Build the site +npm run build From 32d178339044273a498d0b30d22db342b70314a0 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 25 Aug 2023 08:22:24 +0530 Subject: [PATCH 2/3] chore: Update editor script Co-authored-by: Alois Klink --- scripts/{editor.sh => editor.bash} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename scripts/{editor.sh => editor.bash} (84%) diff --git a/scripts/editor.sh b/scripts/editor.bash similarity index 84% rename from scripts/editor.sh rename to scripts/editor.bash index 1fd9a56f26..836353b13a 100755 --- a/scripts/editor.sh +++ b/scripts/editor.bash @@ -1,17 +1,18 @@ #!/usr/bin/env bash +set -euxo pipefail # We have to use npm instead of yarn because it causes trouble in netlify # Link local mermaid to npm -pushd packages/mermaid || exit +pushd packages/mermaid npm link -popd || exit +popd # Clone the Mermaid Live Editor repository git clone https://github.com/mermaid-js/mermaid-live-editor.git # Change to the repository directory -cd mermaid-live-editor || exit +cd mermaid-live-editor # Link local mermaid to live editor npm link mermaid From c3939d3fb328eb020e6cff033a7f1428a80dca75 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 25 Aug 2023 08:26:34 +0530 Subject: [PATCH 3/3] chore: Add netlify.toml --- netlify.toml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000000..2853f4c82d --- /dev/null +++ b/netlify.toml @@ -0,0 +1,18 @@ +# Settings in the [build] context are global and are applied to +# all contexts unless otherwise overridden by more specific contexts. +[build] + # Directory where the build system installs dependencies + # and runs your build. Store your package.json, .nvmrc, etc here. + # If not set, defaults to the root directory. + base = "" + + # Directory that contains the deploy-ready HTML files and + # assets generated by the build. This is an absolute path relative + # to the base directory, which is the root by default (/). + # This sample publishes the directory located at the absolute + # path "root/project/build-output" + + publish = "mermaid-live-editor/docs" + + # Default build command. + command = "./scripts/editor.bash"