#!/usr/bin/env bash # Build the Starlight wiki site into site/dist/. # Does not publish; see tools/site-deploy.sh for the orphan pages branch. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" SITE="$ROOT/site" if ! command -v pnpm >/dev/null 2>&1; then echo "site-build: pnpm is required (https://pnpm.io/installation)" >&2 exit 1 fi if ! command -v node >/dev/null 2>&1; then echo "site-build: node is required" >&2 exit 1 fi cd "$SITE" if [ ! -d node_modules ]; then echo "site-build: installing dependencies..." # pnpm runs only the reviewed dependency build scripts listed in # site/pnpm-workspace.yaml (esbuild and sharp). pnpm install --frozen-lockfile fi echo "site-build: syncing wiki + building (base=${SITE_BASE:-/misaligned})..." # Call the build script via pnpm; package.json invokes astro through # node directly so the .bin shim (which needs sed) is not required. pnpm run build echo "site-build: OK → $SITE/dist"