ruvector/scripts/install-hooks.sh
rUv 38c79dc4ac feat: Add automated package-lock.json sync tooling
 New Features:
- sync-lockfile.sh: Auto-sync lock file with package.json changes
- install-hooks.sh: Install git pre-commit hooks
- ci-sync-lockfile.sh: CI/CD auto-fix for lock file issues
- Pre-commit hook: Automatically runs on git commit
- validate-lockfile.yml: GitHub Actions workflow for validation

📚 Documentation:
- CONTRIBUTING.md: Complete contribution guide
- scripts/README.md: Automation scripts documentation

🎯 Benefits:
- Prevents "lock file out of sync" CI/CD failures
- Automatic staging of lock file changes
- Zero manual intervention needed
- Works with any workflow (hooks, manual, CI/CD)

🔧 Usage:
1. Install hooks: ./scripts/install-hooks.sh
2. Add dependencies normally
3. Commit - hook auto-syncs lock file
4. CI validates automatically

Resolves the recurring package-lock.json sync issues.
2025-11-25 21:24:14 +00:00

28 lines
732 B
Bash
Executable file

#!/bin/bash
# Install git hooks for automatic lock file syncing
set -e
echo "🔧 Installing git hooks..."
# Create .git/hooks directory if it doesn't exist
mkdir -p .git/hooks
# Install pre-commit hook
if [ -f ".githooks/pre-commit" ]; then
ln -sf ../../.githooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
chmod +x .githooks/pre-commit
echo "✅ Pre-commit hook installed"
else
echo "❌ Pre-commit hook file not found"
exit 1
fi
echo ""
echo "✨ Git hooks installed successfully!"
echo ""
echo "The following hooks are now active:"
echo " • pre-commit: Automatically syncs package-lock.json when package.json changes"
echo ""
echo "To disable, run: rm .git/hooks/pre-commit"