feat: enhance installation process by adding cloning and building of wokwi-libs

pull/74/head
Sipho Mokoena 2026-03-27 16:07:49 +02:00
parent 9e5b08ee49
commit 4f328c7e2f
2 changed files with 17 additions and 0 deletions

View File

@ -54,6 +54,10 @@ fi
# - For full ESP32 support, see: docs/ESP32_EMULATION.md
# - Backend auto-detects and falls back to UART-only mode if libs are missing
echo "==> Installing root dependencies (tsx, typescript for build scripts)..."
HUSKY=0 npm install &
ROOT_PID=$!
echo "==> Setting up Python virtual environment (base layer)..."
(cd backend
python3 -m venv venv
@ -86,6 +90,7 @@ npm run build) &
ELEMENTS_PID=$!
echo " -> Waiting for all parallel builds to complete..."
wait $ROOT_PID && echo " ✓ Root deps installed"
wait $BACKEND_PID && echo " ✓ Backend deps installed"
wait $FRONTEND_PID && echo " ✓ Frontend deps installed"
wait $AVR_PID && echo " ✓ avr8js built"

View File

@ -21,10 +21,22 @@ dev-frontend: ## Start frontend (port 5173)
install: ## Install dependencies
@echo "Installing root dependencies (tsx, typescript for build scripts)..."
@npm install
@echo "Cloning wokwi-libs (shallow)..."
@for lib in avr8js rp2040js wokwi-elements; do \
if [ ! -d "wokwi-libs/$$lib/.git" ]; then \
rm -rf "wokwi-libs/$$lib"; \
git clone --depth=1 "https://github.com/wokwi/$$lib.git" "wokwi-libs/$$lib"; \
fi; \
done
@echo "Installing backend dependencies..."
@cd backend && python3 -m venv venv && . venv/bin/activate && pip install -r requirements.txt
@echo "Installing frontend dependencies..."
@cd frontend && npm install
@echo "Building wokwi-libs..."
@for lib in avr8js rp2040js wokwi-elements; do \
echo "Building $$lib..."; \
cd "wokwi-libs/$$lib" && npm install && npm run build && cd ../..; \
done
@echo "✓ All dependencies installed"
clean: ## Remove venv and node_modules