veza/tmt/tests/frontend/build_perf.sh
senke ad60247f33 feat: global update including storybook setup and backend fixes
- Web: Setup Storybook, added addons, configured Tailwind, added stories for UI components.
- Backend: Updated API router, database, workers, and auth in common.
- Stream Server: Removed SQLx queries and updated auth.
- Docs & Scripts: Updated documentation and recovery scripts.
2026-02-02 19:34:14 +01:00

36 lines
959 B
Bash
Executable file

#!/bin/bash
set -e
# CONTRACT: docs/BUDGETS.md
# DO NOT CHANGE THESE VALUES WITHOUT UPDATING THE CONTRACT FIRST.
MAX_BUILD_SECONDS=120
REPO_ROOT=$(git rev-parse --show-toplevel)
WEB_DIR="$REPO_ROOT/apps/web"
echo "📍 Frontend Build Performance Check"
echo "📜 Contract: docs/BUDGETS.md"
echo "⏱️ Budget: ${MAX_BUILD_SECONDS}s"
cd "$WEB_DIR"
START_TIME=$(date +%s)
# Run build independently of the other build test to measure PURE time
# In a real CI, we might skip if artifact exists, but here we enforce speed of build
npm run build > /dev/null 2>&1
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
echo "📊 Build took: ${DURATION}s"
if [ "$DURATION" -gt "$MAX_BUILD_SECONDS" ]; then
echo "❌ FATAL: Build deemed TOO SLOW for a vital component."
echo " Limit: ${MAX_BUILD_SECONDS}s"
echo " Actual: ${DURATION}s"
echo " See docs/FRUGALITY.md for policy."
exit 1
fi
echo "✅ Build speed within limits."