From 548c815c4dd09f184d8a53f42d345518c96f876b Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 17 May 2026 12:34:44 +0200 Subject: [PATCH] chore(stockholm): add dev-service-stockholm make target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compresses the local roundtrip to a single command: make build-stockholm-image # one-time make prepare-stockholm # once per zip update make dev-service-stockholm # iterative loop The target only checks that prepare-stockholm has produced stockholm/index.html (a fast file stat) — it deliberately does NOT re-run the Docker preparation step on every launch, since that takes tens of seconds and produces identical output most of the time. Fails loudly with a hint if Stockholm isn't prepared. Listed in `make help` under the existing dev-* group. Not added to .PHONY because the surrounding dev-service / dev-service-proxy targets aren't either — matching local convention rather than gold-plating. Co-Authored-By: Claude Opus 4.7 (1M context) --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index de940c8..2ce2b3c 100644 --- a/Makefile +++ b/Makefile @@ -233,6 +233,18 @@ dev-service-proxy: build-service fi PYTHON_BACKEND_URL=$(PROXY_URL) $(BUILD_DIR)/$(SERVICE_NAME) +# Run the service with the Stockholm frontend enabled. Requires that +# `make prepare-stockholm` has been run at least once (the check below +# avoids re-running the Docker container on every dev launch). +dev-service-stockholm: build-service + @if [ ! -f "$(STOCKHOLM_DIR)/index.html" ]; then \ + echo "Error: Stockholm not prepared at $(STOCKHOLM_DIR)."; \ + echo "Run 'make prepare-stockholm' first (needs stockholm_zip/stockholm.zip)."; \ + exit 1; \ + fi + @echo "Starting development service with Stockholm enabled from $(STOCKHOLM_DIR)..." + STOCKHOLM_DIR=$(STOCKHOLM_DIR) $(BUILD_DIR)/$(SERVICE_NAME) + dev-discover: build-cli @echo "Running device discovery..." $(BUILD_DIR)/$(BINARY_NAME) -discover @@ -440,6 +452,7 @@ help: @echo " dev - Build and show CLI help" @echo " dev-service - Build and run service locally" @echo " dev-service-proxy - Build and run service with proxy (PROXY_URL=url required)" + @echo " dev-service-stockholm - Build and run service with Stockholm frontend (requires prior 'make prepare-stockholm')" @echo " screenshots - Capture documentation screenshots (headless Chrome via chromedp)" @echo " dev-discover - Build and run device discovery" @echo " dev-info - Build and get device info (HOST=ip required)"