Add class override system for framework customization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-10 02:37:07 +00:00
parent 025bb2d768
commit ecc386301f
6 changed files with 337 additions and 4 deletions

View File

@@ -181,6 +181,44 @@ if [ "$SHOW_DIFF" = true ]; then
exit 0
fi
# =============================================================================
# STEP: Clean up class override artifacts before checking for uncommitted changes
# =============================================================================
# The manifest's class override system renames framework files to .upstream when
# an rsx/ override exists. Before updating, we need to:
# 1. Restore any deleted files (git checkout)
# 2. Delete any .upstream files (the originals will be restored by git)
# This ensures git sees a clean state, and the next manifest build will
# re-apply any overrides with the updated framework files.
# =============================================================================
echo "→ Cleaning up class override artifacts..."
# Step 1: Restore deleted files
DELETED_FILES=$(git status --porcelain 2>&1 | grep "^ D " | sed 's/^ D //' || true)
if [ -n "$DELETED_FILES" ]; then
echo " Restoring deleted files..."
echo "$DELETED_FILES" | while read -r file; do
if [ -n "$file" ]; then
git checkout HEAD -- "$file" 2>/dev/null && echo " ✓ Restored: $file" || true
fi
done
fi
# Step 2: Delete .upstream files (framework files renamed by class override system)
UPSTREAM_FILES=$(find . -name "*.upstream" -type f 2>/dev/null | grep -v "./rsx/" || true)
if [ -n "$UPSTREAM_FILES" ]; then
echo " Removing .upstream override markers..."
echo "$UPSTREAM_FILES" | while read -r upstream_file; do
if [ -n "$upstream_file" ] && [ -f "$upstream_file" ]; then
rm -f "$upstream_file" && echo " ✓ Removed: $upstream_file" || true
fi
done
fi
echo " ✓ Override cleanup complete"
echo ""
# In project mode, check for uncommitted changes outside ./rsx
if [ "$IS_PROJECT_MODE" = true ]; then
# Get uncommitted changes (modified, staged, deleted) excluding ./rsx