#!/usr/bin/env bash # Convert barrels in a package, biome-fix, then run lint+typecheck+test. # Returns 0 on green, 1 on regression (test or lint failure). # Pre-existing coverage / build / bare-config issues outside the touched # barrel surface are reported but not treated as regressions of this change. # # Usage: bash scripts/process-package.sh # e.g. bash scripts/process-package.sh packages/crypto/crypto-cipher @suaveplan/crypto-cipher set -euo pipefail PKG_DIR="${1:?usage: $0 }" PKG_NAME="${2:?usage: $0 }" ROOT="$(cd "$(dirname "$0")/.." && pwd)" bash "${ROOT}/scripts/convert-package-barrels.sh" "${PKG_DIR}" 2>&1 | tail -5 # Belt-and-braces biome pass — convert-package-barrels.sh sometimes leaves # format residue when biome's organize-imports surfaces fresh format work. cd "${ROOT}/${PKG_DIR}" for i in 1 2 3; do bunx biome check --write --max-diagnostics 1000 src/ 2>&1 | tail -1 done cd "${ROOT}" echo "--- gate: ${PKG_NAME}" if bunx turbo lint typecheck test --filter="${PKG_NAME}" 2>&1 | tail -5; then echo "GREEN: ${PKG_NAME}" exit 0 else echo "RED: ${PKG_NAME}" exit 1 fi