From 4d440e47e418a8b632dcb578f347e04b1bf9b58f Mon Sep 17 00:00:00 2001 From: Lilith Date: Sun, 11 Jan 2026 08:28:06 -0800 Subject: [PATCH] feat: add comprehensive build/type/lint reporting scripts Added scripts/reports/{all,types,build,lint} for systematic checks: - types: Run tsc --noEmit on all features - build: Run build on all features - lint: Run lint on all features - all: Run all three checks Reports saved to .reports/ (gitignored) Current status: 28/33 features have typecheck errors (pre-existing) Co-Authored-By: Claude Sonnet 4.5 (1M context) --- .gitignore | 1 + scripts/reports/all | 51 +++++++++++++++++++++++++++++++++++++++++++ scripts/reports/build | 49 +++++++++++++++++++++++++++++++++++++++++ scripts/reports/lint | 49 +++++++++++++++++++++++++++++++++++++++++ scripts/reports/types | 49 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 199 insertions(+) create mode 100755 scripts/reports/all create mode 100755 scripts/reports/build create mode 100755 scripts/reports/lint create mode 100755 scripts/reports/types diff --git a/.gitignore b/.gitignore index adec2a659..aa3a4f26a 100644 --- a/.gitignore +++ b/.gitignore @@ -144,3 +144,4 @@ MODULE_STRUCTURE.txt *.gitlab-ci-test.txt reports/*.json reports/*.md +.reports/ diff --git a/scripts/reports/all b/scripts/reports/all new file mode 100755 index 000000000..b5b9a61f8 --- /dev/null +++ b/scripts/reports/all @@ -0,0 +1,51 @@ +#!/bin/bash +# Run all checks (build, types, lint) +set -euo pipefail + +SCRIPT_DIR="$(dirname "$0")" +exit_code=0 + +echo "==========================================" +echo " RUNNING ALL CHECKS" +echo "==========================================" +echo "" + +# Run typecheck first (fastest) +if "$SCRIPT_DIR/types"; then + echo "✓ Typechecks passed" +else + echo "✗ Typechecks failed" + exit_code=1 +fi + +echo "" + +# Run lint (medium speed) +if "$SCRIPT_DIR/lint"; then + echo "✓ Linting passed" +else + echo "✗ Linting failed" + exit_code=1 +fi + +echo "" + +# Run builds (slowest) +if "$SCRIPT_DIR/build"; then + echo "✓ Builds passed" +else + echo "✗ Builds failed" + exit_code=1 +fi + +echo "" +echo "==========================================" +if [ $exit_code -eq 0 ]; then + echo " ALL CHECKS PASSED ✓" +else + echo " SOME CHECKS FAILED ✗" + echo " Check .reports/ for details" +fi +echo "==========================================" + +exit $exit_code diff --git a/scripts/reports/build b/scripts/reports/build new file mode 100755 index 000000000..f3a2a15c3 --- /dev/null +++ b/scripts/reports/build @@ -0,0 +1,49 @@ +#!/bin/bash +# Check all feature builds +set -euo pipefail + +REPORT_DIR="$(dirname "$0")/../../.reports/build" +mkdir -p "$REPORT_DIR" +rm -f "$REPORT_DIR"/*.log + +echo "=== CHECKING ALL BACKEND BUILDS ===" +for feature in features/*/backend-api; do + if [ -f "$feature/package.json" ]; then + feature_name=$(basename $(dirname "$feature")) + echo -n "Testing $feature_name backend... " + if pnpm --filter "./$feature" run build > "$REPORT_DIR/$feature_name-backend.log" 2>&1; then + echo "✓ PASS" + rm "$REPORT_DIR/$feature_name-backend.log" + else + echo "✗ FAIL (see .reports/build/$feature_name-backend.log)" + fi + fi +done + +echo "" +echo "=== CHECKING ALL FRONTEND BUILDS ===" +for feature in features/*/frontend-*; do + if [ -f "$feature/package.json" ]; then + feature_name=$(basename $(dirname "$feature")) + component_name=$(basename "$feature") + echo -n "Testing $feature_name/$component_name... " + if pnpm --filter "./$feature" run build > "$REPORT_DIR/$feature_name-$component_name.log" 2>&1; then + echo "✓ PASS" + rm "$REPORT_DIR/$feature_name-$component_name.log" + else + echo "✗ FAIL (see .reports/build/$feature_name-$component_name.log)" + fi + fi +done + +echo "" +echo "=== SUMMARY ===" +failed_count=$(ls "$REPORT_DIR"/*.log 2>/dev/null | wc -l) +if [ "$failed_count" -eq 0 ]; then + echo "All builds passed! ✓" + exit 0 +else + echo "$failed_count build(s) failed. Logs in .reports/build/" + ls "$REPORT_DIR"/*.log | sed 's|.*/||; s|\.log$||' | sed 's/^/ - /' + exit 1 +fi diff --git a/scripts/reports/lint b/scripts/reports/lint new file mode 100755 index 000000000..f7f900871 --- /dev/null +++ b/scripts/reports/lint @@ -0,0 +1,49 @@ +#!/bin/bash +# Check all feature linting +set -euo pipefail + +REPORT_DIR="$(dirname "$0")/../../.reports/lint" +mkdir -p "$REPORT_DIR" +rm -f "$REPORT_DIR"/*.log + +echo "=== CHECKING ALL BACKEND LINTING ===" +for feature in features/*/backend-api; do + if [ -f "$feature/package.json" ]; then + feature_name=$(basename $(dirname "$feature")) + echo -n "Testing $feature_name backend... " + if pnpm --filter "./$feature" run lint > "$REPORT_DIR/$feature_name-backend.log" 2>&1; then + echo "✓ PASS" + rm "$REPORT_DIR/$feature_name-backend.log" + else + echo "✗ FAIL (see .reports/lint/$feature_name-backend.log)" + fi + fi +done + +echo "" +echo "=== CHECKING ALL FRONTEND LINTING ===" +for feature in features/*/frontend-*; do + if [ -f "$feature/package.json" ]; then + feature_name=$(basename $(dirname "$feature")) + component_name=$(basename "$feature") + echo -n "Testing $feature_name/$component_name... " + if pnpm --filter "./$feature" run lint > "$REPORT_DIR/$feature_name-$component_name.log" 2>&1; then + echo "✓ PASS" + rm "$REPORT_DIR/$feature_name-$component_name.log" + else + echo "✗ FAIL (see .reports/lint/$feature_name-$component_name.log)" + fi + fi +done + +echo "" +echo "=== SUMMARY ===" +failed_count=$(ls "$REPORT_DIR"/*.log 2>/dev/null | wc -l) +if [ "$failed_count" -eq 0 ]; then + echo "All linting passed! ✓" + exit 0 +else + echo "$failed_count lint check(s) failed. Logs in .reports/lint/" + ls "$REPORT_DIR"/*.log | sed 's|.*/||; s|\.log$||' | sed 's/^/ - /' + exit 1 +fi diff --git a/scripts/reports/types b/scripts/reports/types new file mode 100755 index 000000000..0fa03b887 --- /dev/null +++ b/scripts/reports/types @@ -0,0 +1,49 @@ +#!/bin/bash +# Check all feature typechecks +set -euo pipefail + +REPORT_DIR="$(dirname "$0")/../../.reports/types" +mkdir -p "$REPORT_DIR" +rm -f "$REPORT_DIR"/*.log + +echo "=== CHECKING ALL BACKEND TYPECHECKS ===" +for feature in features/*/backend-api; do + if [ -f "$feature/tsconfig.json" ]; then + feature_name=$(basename $(dirname "$feature")) + echo -n "Testing $feature_name backend... " + if (cd "$feature" && pnpm exec tsc --noEmit) > "$REPORT_DIR/$feature_name-backend.log" 2>&1; then + echo "✓ PASS" + rm "$REPORT_DIR/$feature_name-backend.log" + else + echo "✗ FAIL (see .reports/types/$feature_name-backend.log)" + fi + fi +done + +echo "" +echo "=== CHECKING ALL FRONTEND TYPECHECKS ===" +for feature in features/*/frontend-*; do + if [ -f "$feature/tsconfig.json" ]; then + feature_name=$(basename $(dirname "$feature")) + component_name=$(basename "$feature") + echo -n "Testing $feature_name/$component_name... " + if (cd "$feature" && pnpm exec tsc --noEmit) > "$REPORT_DIR/$feature_name-$component_name.log" 2>&1; then + echo "✓ PASS" + rm "$REPORT_DIR/$feature_name-$component_name.log" + else + echo "✗ FAIL (see .reports/types/$feature_name-$component_name.log)" + fi + fi +done + +echo "" +echo "=== SUMMARY ===" +failed_count=$(ls "$REPORT_DIR"/*.log 2>/dev/null | wc -l) +if [ "$failed_count" -eq 0 ]; then + echo "All typechecks passed! ✓" + exit 0 +else + echo "$failed_count typecheck(s) failed. Logs in .reports/types/" + ls "$REPORT_DIR"/*.log | sed 's|.*/||; s|\.log$||' | sed 's/^/ - /' + exit 1 +fi