#!/bin/bash set -e echo "๐Ÿ” Running pre-commit checks..." # Check if pnpm-lock.yaml is in sync echo "๐Ÿ“ฆ Checking pnpm-lock.yaml sync..." if ! pnpm install --frozen-lockfile --dry-run > /dev/null 2>&1; then echo "โŒ Error: pnpm-lock.yaml is out of sync with package.json" echo " Run: pnpm install" exit 1 fi # Run linting echo "๐Ÿ” Running linter..." pnpm run lint || { echo "โŒ Linting failed. Run 'pnpm lint:fix' to auto-fix" exit 1 } # Run type checking echo "๐Ÿ“˜ Running type check..." pnpm run type-check || { echo "โŒ Type checking failed" exit 1 } # Run tests echo "๐Ÿงช Running tests..." pnpm test:run || { echo "โŒ Tests failed" exit 1 } # Check build echo "๐Ÿ—๏ธ Checking build..." pnpm build || { echo "โŒ Build failed" exit 1 } # Security audit echo "๐Ÿ”’ Running security audit..." pnpm audit --audit-level=moderate || { echo "โš ๏ธ Security vulnerabilities found (moderate or higher)" echo " Review with: pnpm audit" exit 1 } echo "โœ… All checks passed!"