- Add test-build.js script to verify standalone build locally - Add pre-commit hook with security, build, and test checks - Copy required-server-files.json to root of standalone for Amplify - Add husky for automatic pre-commit validation This ensures we test builds locally before pushing
29 lines
544 B
Bash
Executable File
29 lines
544 B
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "🔍 Running pre-commit checks..."
|
|
|
|
# Run security check
|
|
echo "🔐 Checking for credential leaks..."
|
|
npm run security:check
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ Security check failed!"
|
|
exit 1
|
|
fi
|
|
|
|
# Run build test
|
|
echo "🏗️ Testing build..."
|
|
node scripts/test-build.js
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ Build test failed!"
|
|
exit 1
|
|
fi
|
|
|
|
# Run tests
|
|
echo "🧪 Running tests..."
|
|
npm test -- --passWithNoTests
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ Tests failed!"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ All pre-commit checks passed!" |