Files
bookhoard/scripts/verify-quick.sh
T
john-okeefe 12c6b41577 fix: exclude web/static/ from JS/CSS checks (compiled output)
Exclude web/static/ from verification checks:
- These are TypeScript compiled output files
- Already in .gitignore (web/static/*.js)
- Similar to node_modules/ - build artifacts, not source

Updated verify-quick.sh to exclude:
- web/static/*.js (TypeScript → JS compilation)
- web/static/*.css (TailwindCSS → CSS compilation)

Also removed ./bookhoard binary from repository.

Verification now shows only 1 error: 12 legacy templates with custom CSS.
Docs templates already comply (converted in Phase 4).
2026-02-02 10:00:26 -05:00

75 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
# Quick verification script for immediate use
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
ERRORS=0
WARNINGS=0
PASSED=0
error_msg() { echo -e "${RED}✗ ERROR: $1${NC}"; ERRORS=$((ERRORS + 1)); }
warning_msg() { echo -e "${YELLOW}⚠ WARNING: $1${NC}"; WARNINGS=$((WARNINGS + 1)); }
success_msg() { echo -e "${GREEN}✓ PASS: $1${NC}"; PASSED=$((PASSED + 1)); }
section() { echo ""; echo -e "${BLUE}--- $1 ---${NC}"; }
echo -e "${BLUE}=== Quick Guidelines Check ===${NC}"
section "1. Custom CSS Check"
STYLE_COUNT=$(grep -l '<style>' templates/*.templ 2>/dev/null | wc -l || echo 0)
if [ "$STYLE_COUNT" -gt 0 ]; then
error_msg "Found $STYLE_COUNT templates with <style> tags"
grep -l '<style>' templates/*.templ 2>/dev/null | head -5
else
success_msg "No <style> in templates"
fi
section "2. JavaScript Files Check"
JS_COUNT=$(find . -name "*.js" -not -path "./node_modules/*" -not -path "./docs/*" -not -path "./.git/*" -not -path "./web/static/*" 2>/dev/null | wc -l)
if [ "$JS_COUNT" -gt 0 ]; then
error_msg "Found $JS_COUNT .js files"
find . -name "*.js" -not -path "./node_modules/*" -not -path "./docs/*" -not -path "./.git/*" -not -path "./web/static/*" 2>/dev/null | head -5
else
success_msg "No .js files (TypeScript compiled to web/static/)"
fi
section "3. Secrets Check"
if [ -f ".env" ] || [ -f "credentials.json" ]; then
error_msg "Found .env or credentials.json in repo"
else
success_msg "No secrets found"
fi
section "4. Build Check"
echo "Building..."
if go build -o /tmp/bookhoard-test ./cmd/server 2>/dev/null; then
success_msg "Code compiles"
rm -f /tmp/bookhoard-test
else
error_msg "Build failed"
fi
section "5. Binary Check"
BINARIES=$(find . -type f \( -name "bookhoard" -o -name "server" \) -not -path "./node_modules/*" -not -path "./.git/*" 2>/dev/null | wc -l)
if [ "$BINARIES" -gt 0 ]; then
error_msg "Found $BINARIES binary files"
find . -type f \( -name "bookhoard" -o -name "server" \) -not -path "./node_modules/*" -not -path "./.git/*" 2>/dev/null
else
success_msg "No binaries"
fi
echo ""
echo -e "${BLUE}=== Summary ===${NC}"
echo -e "${GREEN}PASSED: $PASSED${NC}"
echo -e "${YELLOW}WARNINGS: $WARNINGS${NC}"
echo -e "${RED}ERRORS: $ERRORS${NC}"
if [ $ERRORS -gt 0 ]; then
exit 1
fi
exit 0