#!/bin/bash RUN="docker-compose run --rm" name=$(basename $0) command=$1 args=${@:2} case $command in sh) $RUN mermaid sh -c "npx $args" ;; pnpm) $RUN mermaid sh -c "npx $command $args" ;; dev) $RUN --service-ports mermaid sh -c "npx pnpm run dev" ;; docs:dev) $RUN --service-ports mermaid sh -c "cd packages/mermaid/src/docs && npx pnpm prefetch && npx vitepress --port 3333 --host" ;; help) usage=$( cat <' # git diff --name-only develop | xargs run pnpm prettier --write $name pnpm test # Run unit tests $name pnpm vitest # Run watcher for unit tests $name pnpm e2e # Run integration tests $name pnpm -w run lint:fix EOF ) echo -n -e "$usage" ;; *) $name help ;; esac