2023-08-24 20:42:14 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-08-26 20:13:27 +02:00
|
|
|
# Fail on errors
|
2023-08-25 04:52:24 +02:00
|
|
|
set -euxo pipefail
|
2024-02-26 18:10:43 +01:00
|
|
|
export COREPACK_ENABLE_STRICT='0'
|
2023-08-26 20:13:27 +02:00
|
|
|
|
|
|
|
# Increase heap size
|
|
|
|
export NODE_OPTIONS="--max_old_space_size=4096"
|
|
|
|
|
2023-09-22 07:10:42 +02:00
|
|
|
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 18:10:43 +01:00
|
|
|
yarn link
|
2023-09-22 07:10:42 +02:00
|
|
|
popd
|
|
|
|
|
2023-09-22 07:17:06 +02:00
|
|
|
pnpm run -r clean
|
2023-11-15 04:39:48 +01:00
|
|
|
pnpm build:esbuild
|
2023-09-22 07:17:06 +02:00
|
|
|
pnpm build:types
|
2023-08-24 20:42:14 +02:00
|
|
|
|
2023-08-25 06:34:53 +02:00
|
|
|
# Clone the Mermaid Live Editor repository
|
|
|
|
rm -rf mermaid-live-editor
|
|
|
|
git clone --single-branch https://github.com/mermaid-js/mermaid-live-editor.git
|
2023-08-24 20:42:14 +02:00
|
|
|
|
2023-08-25 06:34:53 +02:00
|
|
|
cd mermaid-live-editor
|
2023-08-24 20:42:14 +02:00
|
|
|
|
2023-08-25 06:34:53 +02:00
|
|
|
# We have to use npm instead of yarn because it causes trouble in netlify
|
2023-08-24 20:42:14 +02:00
|
|
|
# Install dependencies
|
2024-02-26 18:10:43 +01:00
|
|
|
yarn install
|
2023-08-25 06:34:53 +02:00
|
|
|
|
|
|
|
# Link local mermaid to live editor
|
2024-02-26 18:10:43 +01:00
|
|
|
yarn link mermaid
|
2023-08-25 06:07:22 +02:00
|
|
|
|
|
|
|
# Force Build the site
|
2024-02-26 18:10:43 +01:00
|
|
|
yarn run build -- --force
|
2023-08-24 20:42:14 +02:00
|
|
|
|