config-template / check.shmain at 3b8ad1b
#!/bin/sh
# check.sh — type-checks and tests this repo and each repo its code imports from, as they are in
# the folders beside it. Nothing checks a push, so run this before one:
#
# ./check.sh
#
# Each repo checks itself (`pnpm typecheck`, `pnpm test` in its folder); this runs them all, in
# the order package.json names them, and stops at the first that fails.
set -eu
cd "$(dirname "$0")"
named=$(node -p 'Object.keys(require("./package.json").dependencies).filter((name) => name.startsWith("@repos/")).map((name) => name.slice("@repos/".length)).join(" ")')
for name in $named; do
echo "== $name"
pnpm -C "../$name" typecheck
pnpm -C "../$name" test
done
echo "== this repo"
pnpm typecheck
pnpm test