868 B39 lines
Blame
1#!/usr/bin/env bash
2
3# Fail on errors
4set -euxo pipefail
5export COREPACK_ENABLE_STRICT='0'
6
7# Increase heap size
8export NODE_OPTIONS="--max_old_space_size=4096"
9
10pushd packages/mermaid
11# Append commit hash to version
12jq ".version = .version + \"+${COMMIT_REF:0:7}\"" package.json > package.tmp.json
13mv package.tmp.json package.json
14popd
15
16pnpm run -r clean
17pnpm build:esbuild
18pnpm build:types
19
20# Clone the Mermaid Live Editor repository
21if [ ! -d "mermaid-live-editor" ]; then
22 git clone --single-branch https://github.com/mermaid-js/mermaid-live-editor.git
23fi
24cd mermaid-live-editor
25git clean -xdf
26rm -rf docs/
27
28# Tells PNPM that mermaid-live-editor is not part of this workspace
29touch pnpm-workspace.yaml
30
31# Install dependencies
32pnpm install --frozen-lockfile
33
34# Link local mermaid to live editor
35pnpm link ../packages/mermaid
36
37# Force Build the site
38pnpm run build
39