From 4f328c7e2f9329fa04e26dfe887bb970cfecab1a Mon Sep 17 00:00:00 2001 From: Sipho Mokoena Date: Fri, 27 Mar 2026 16:07:49 +0200 Subject: [PATCH] feat: enhance installation process by adding cloning and building of wokwi-libs --- .devcontainer/post-create.sh | 5 +++++ Makefile | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index cf44fe9..5f89baa 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -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" diff --git a/Makefile b/Makefile index 7b567bb..ed1a3b3 100644 --- a/Makefile +++ b/Makefile @@ -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