vibetunnel/web/scripts/check-all.sh
Peter Steinberger fd2737b8a1 Merge PR #391: Add comprehensive vt command tests
- Add vitest integration test for vt command functionality
- Add shell script test for build-time validation
- Include vt tests in main check script to run in CI
- Tests cover: syntax validation, help functionality, error handling, npm package config
- Add pnpm run test:vt script for easy testing
- Exclude vt symlink from package.json bin section to avoid conflicts with other vt installations

Co-authored-by: hewigovens <360470+hewigovens@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-17 13:16:16 +02:00

69 lines
No EOL
1.4 KiB
Bash
Executable file

#!/bin/bash
# Run all code quality checks
# Format and lint checks run in parallel (read-only)
# Type checking runs in parallel as it doesn't modify files
# Create temporary files for capturing output
FORMAT_OUT=$(mktemp)
LINT_OUT=$(mktemp)
TYPECHECK_OUT=$(mktemp)
VT_OUT=$(mktemp)
# Track PIDs for parallel tasks
declare -a pids=()
# Run format CHECK (read-only) in parallel
{
if ! pnpm run format:check > "$FORMAT_OUT" 2>&1; then
echo "Format check failed:"
cat "$FORMAT_OUT"
exit 1
fi
} &
pids+=($!)
# Run lint CHECK (with Biome check, not write) in parallel
{
if ! pnpm run lint > "$LINT_OUT" 2>&1; then
echo "Lint check failed:"
cat "$LINT_OUT"
exit 1
fi
} &
pids+=($!)
# Run typecheck in parallel (doesn't modify files)
{
if ! pnpm run typecheck > "$TYPECHECK_OUT" 2>&1; then
echo "Typecheck failed:"
cat "$TYPECHECK_OUT"
exit 1
fi
} &
pids+=($!)
# Run vt script tests in parallel
{
if ! pnpm run test:vt > "$VT_OUT" 2>&1; then
echo "VT script test failed:"
cat "$VT_OUT"
exit 1
fi
} &
pids+=($!)
# Wait for all parallel processes
failed=false
for pid in "${pids[@]}"; do
if ! wait "$pid"; then
failed=true
fi
done
# Cleanup
rm -f "$FORMAT_OUT" "$LINT_OUT" "$TYPECHECK_OUT" "$VT_OUT"
# Exit with appropriate code
if [ "$failed" = true ]; then
exit 1
fi