mermaid/scripts/editor.bash

39 lines
833 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# Fail on errors
set -euxo pipefail
2024-02-26 22:40:43 +05:30
export COREPACK_ENABLE_STRICT='0'
# Increase heap size
export NODE_OPTIONS="--max_old_space_size=4096"
2023-09-22 10:40:42 +05:30
pushd packages/mermaid
# Append commit hash to version
jq ".version = .version + \"+${COMMIT_REF:0:7}\"" package.json > package.tmp.json
mv package.tmp.json package.json
2024-02-26 22:40:43 +05:30
yarn link
2023-09-22 10:40:42 +05:30
popd
2023-09-22 10:47:06 +05:30
pnpm run -r clean
2023-11-15 09:09:48 +05:30
pnpm build:esbuild
2023-09-22 10:47:06 +05:30
pnpm build:types
# Clone the Mermaid Live Editor repository
if [ ! -d "mermaid-live-editor" ]; then
git clone --single-branch https://github.com/mermaid-js/mermaid-live-editor.git
fi
cd mermaid-live-editor
git clean -xdf
rm -rf docs/
# We have to use npm instead of yarn because it causes trouble in netlify
# Install dependencies
2024-02-26 22:40:43 +05:30
yarn install
# Link local mermaid to live editor
2024-02-26 22:40:43 +05:30
yarn link mermaid
# Force Build the site
2024-03-19 08:45:19 +05:30
yarn run build