2023-08-25 00:12:14 +05:30
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-08-26 23:43:27 +05:30
|
|
|
# Fail on errors
|
2023-08-25 08:22:24 +05:30
|
|
|
set -euxo pipefail
|
2024-02-26 22:40:43 +05:30
|
|
|
export COREPACK_ENABLE_STRICT='0'
|
2023-08-26 23:43:27 +05:30
|
|
|
|
|
|
|
# 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
|
2023-08-25 00:12:14 +05:30
|
|
|
|
2023-08-25 10:04:53 +05:30
|
|
|
# Clone the Mermaid Live Editor repository
|
|
|
|
cd mermaid-live-editor
|
2024-07-16 13:26:20 -07:00
|
|
|
git clean -xdf
|
|
|
|
rm -rf docs/
|
2023-08-25 00:12:14 +05:30
|
|
|
|
2023-08-25 10:04:53 +05:30
|
|
|
# We have to use npm instead of yarn because it causes trouble in netlify
|
2023-08-25 00:12:14 +05:30
|
|
|
# Install dependencies
|
2024-02-26 22:40:43 +05:30
|
|
|
yarn install
|
2023-08-25 10:04:53 +05:30
|
|
|
|
|
|
|
# Link local mermaid to live editor
|
2024-02-26 22:40:43 +05:30
|
|
|
yarn link mermaid
|
2023-08-25 09:37:22 +05:30
|
|
|
|
|
|
|
# Force Build the site
|
2024-03-19 08:45:19 +05:30
|
|
|
yarn run build
|
2023-08-25 00:12:14 +05:30
|
|
|
|