mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-23 12:55:26 +00:00
- Update CLAUDE.md to reflect actual hooks configuration from settings.json - Document all 7 hook event types (PreToolUse, PostToolUse, SessionStart, etc.) - Add RuVector environment variables documentation - Update agent coordination protocol to use ruvector hooks CLI - Add self-learning hooks section to npm ruvector README - Bump ruvector to v0.1.38 with hooks documentation - Fix sync-lockfile.sh to handle platform-specific optional deps 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51 lines
1.6 KiB
Bash
Executable file
51 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
# Automatically sync package-lock.json with package.json changes
|
|
# Can be used as git hook, CI/CD step, or manual script
|
|
|
|
set -e
|
|
|
|
echo "🔍 Checking package-lock.json sync..."
|
|
|
|
# Change to npm directory (if it exists)
|
|
NPM_DIR="$(dirname "$0")/../npm"
|
|
if [ ! -d "$NPM_DIR" ]; then
|
|
echo "✅ No npm directory found, skipping sync"
|
|
exit 0
|
|
fi
|
|
cd "$NPM_DIR"
|
|
|
|
# Check if package.json or any workspace package.json changed
|
|
CHANGED_PACKAGES=$(git diff --cached --name-only | grep -E 'package\.json$' || true)
|
|
|
|
if [ -n "$CHANGED_PACKAGES" ]; then
|
|
echo "📦 Package.json changes detected:"
|
|
echo "$CHANGED_PACKAGES"
|
|
echo ""
|
|
echo "🔄 Running npm install to sync lock file..."
|
|
|
|
# Run npm install to update lock file
|
|
# Use --ignore-optional to skip platform-specific optional deps (darwin-arm64 on linux, etc.)
|
|
npm install --ignore-optional || {
|
|
echo "⚠️ npm install had warnings (likely platform-specific optional deps)"
|
|
echo " Continuing with lock file sync..."
|
|
}
|
|
|
|
# Check if lock file changed
|
|
if git diff --name-only | grep -q 'package-lock.json'; then
|
|
echo "✅ Lock file updated successfully"
|
|
|
|
# If running as pre-commit hook, add the lock file
|
|
if [ "${GIT_HOOK}" = "pre-commit" ]; then
|
|
cd ..
|
|
git add npm/package-lock.json
|
|
echo "✅ Lock file staged for commit"
|
|
else
|
|
echo "⚠️ Lock file modified but not staged"
|
|
echo " Run: git add npm/package-lock.json"
|
|
fi
|
|
else
|
|
echo "✅ Lock file already in sync"
|
|
fi
|
|
else
|
|
echo "✅ No package.json changes detected"
|
|
fi
|