mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-08-06 19:28:06 +00:00
chore: second-pass cleanup — dead installer branch, broken script, orphaned JS, misfiled test deps
- first_time_install.sh: removed the pip fallback branch that installed from requirements_web_v2.txt — a file that has not existed since the v2 web interface was removed (the branch always printed its own 'not found; skipping' warning). - scripts/remove_plugin_backups.sh deleted: its PROJECT_ROOT resolved to the repo's PARENT directory, and its verify_submodules() checks for plugin submodules from an era before plugins moved to the store — it could never have worked from its current location. - plugins_manager.js: removed three functions with zero call sites anywhere (addKeyValuePair, formatCommit, togglePasswordVisibility) — verified against all templates, all JS, and the dynamic window[name] dispatch sites, which resolve widget-registry keys only. Also replaced base.html's misleading 'Legacy ... during migration' label: the file is deliberately loaded last and provides the LIVE implementations of seven window.* plugin actions that shadow same-named definitions in app.js/app-shell.js. - pytest/pytest-cov/pytest-mock moved from runtime requirements.txt to requirements-test.txt (CI already installs both files; the installer's line-by-line loop simply installs three fewer packages on devices; no store plugin declares pytest). HOW_TO_RUN_TESTS.md updated. - scripts/add_defaults_to_schemas.py and analyze_plugin_schemas.py scanned the empty legacy plugins/ dir — now scan plugin-repos/. Verified: fresh venv installs all four requirements files with pip check clean and pytest available; bash -n on the installer; node --check on the JS; widget/cache guard tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SXb4mKcAkVaxkeTb3YnAdr
This commit is contained in:
@@ -201,7 +201,7 @@ def process_schema_file(schema_path: Path) -> bool:
|
||||
def main():
|
||||
"""Main entry point."""
|
||||
project_root = Path(__file__).parent.parent
|
||||
plugins_dir = project_root / 'plugins'
|
||||
plugins_dir = project_root / 'plugin-repos'
|
||||
|
||||
if not plugins_dir.exists():
|
||||
print(f"Error: Plugins directory not found: {plugins_dir}")
|
||||
|
||||
@@ -193,7 +193,7 @@ def analyze_schema(schema_path: Path) -> Dict[str, Any]:
|
||||
def main():
|
||||
"""Main analysis function."""
|
||||
project_root = Path(__file__).parent.parent
|
||||
plugins_dir = project_root / "plugins"
|
||||
plugins_dir = project_root / "plugin-repos"
|
||||
|
||||
if not plugins_dir.exists():
|
||||
print(f"Plugins directory not found: {plugins_dir}")
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to safely remove plugin backup directories
|
||||
# These were created during the plugin-to-submodule conversion
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
PLUGINS_DIR="$PROJECT_ROOT/plugins"
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m'
|
||||
|
||||
log_info() {
|
||||
echo -e "${GREEN}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_warn() {
|
||||
echo -e "${YELLOW}[WARN]${NC} $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
# Verify submodules are working
|
||||
verify_submodules() {
|
||||
log_info "Verifying submodules are working..."
|
||||
local issues=0
|
||||
|
||||
for submod in football-scoreboard hockey-scoreboard ledmatrix-flights \
|
||||
ledmatrix-leaderboard ledmatrix-stocks ledmatrix-weather \
|
||||
mqtt-notifications; do
|
||||
if [ ! -d "$PLUGINS_DIR/$submod" ]; then
|
||||
log_error "Submodule directory missing: $submod"
|
||||
issues=$((issues + 1))
|
||||
elif [ ! -f "$PLUGINS_DIR/$submod/.git" ]; then
|
||||
log_error "Submodule .git file missing: $submod"
|
||||
issues=$((issues + 1))
|
||||
elif [ ! -f "$PLUGINS_DIR/$submod/manifest.json" ]; then
|
||||
log_warn "Submodule manifest missing: $submod (may be OK)"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $issues -eq 0 ]; then
|
||||
log_info "All submodules verified ✓"
|
||||
return 0
|
||||
else
|
||||
log_error "Found $issues issues with submodules"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Remove backup directories
|
||||
remove_backups() {
|
||||
log_info "Removing backup directories..."
|
||||
|
||||
local removed=0
|
||||
local total_size=0
|
||||
|
||||
for backup in "$PLUGINS_DIR"/*.backup*; do
|
||||
if [ -d "$backup" ]; then
|
||||
local name=$(basename "$backup")
|
||||
local size=$(du -sb "$backup" 2>/dev/null | awk '{print $1}')
|
||||
total_size=$((total_size + size))
|
||||
|
||||
log_info "Removing: $name"
|
||||
rm -rf "$backup"
|
||||
removed=$((removed + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $removed -gt 0 ]; then
|
||||
log_info "Removed $removed backup directory(ies)"
|
||||
log_info "Freed approximately $(numfmt --to=iec-i --suffix=B $total_size 2>/dev/null || echo "$total_size bytes")"
|
||||
else
|
||||
log_info "No backup directories found"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main
|
||||
main() {
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
echo "=== Plugin Backup Removal Script ==="
|
||||
echo
|
||||
|
||||
# Verify submodules first
|
||||
if ! verify_submodules; then
|
||||
log_error "Submodule verification failed. Not removing backups."
|
||||
log_warn "Please fix submodule issues before removing backups."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
log_warn "This will permanently delete backup directories:"
|
||||
ls -1d "$PLUGINS_DIR"/*.backup* 2>/dev/null | sed 's|.*/| - |' || echo " (none found)"
|
||||
echo
|
||||
|
||||
read -p "Continue? (y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
log_info "Aborted"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
remove_backups
|
||||
|
||||
log_info "Done!"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user