From d2e7e206bcea55d55e641991ffa67fe06f494c4c Mon Sep 17 00:00:00 2001 From: tegwick Date: Sun, 17 May 2026 20:55:05 +0200 Subject: [PATCH] fix: bootstrap dashboard dependencies --- AGENTS.md | 4 +++- Makefile | 15 +++++++++++++-- README.md | 8 ++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index f347172..f3745e7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,11 +45,13 @@ make test make api make mcp-http make dashboard +make dashboard-check ``` When API routers, models, migrations, or consistency logic change, run the relevant tests before closing the session. Prefer `make test` when the database -test prerequisites are available. +test prerequisites are available. `make test` includes an Observable dashboard +build smoke check so dashboard startup regressions are not missed. ## Workplans diff --git a/Makefile b/Makefile index 2521933..0071413 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: install install-cli db db-tools migrate seed api dashboard check test clean register-project register-codex-project validate-adr add-domain rename-domain add-repo list-repos register-path cleanup-stale tunnels-up tunnels-status tunnels-check bridges install-hooks install-hooks-all gitea-inventory +.PHONY: install install-cli dashboard-install dashboard-check db db-tools migrate seed api dashboard check test test-python clean register-project register-codex-project validate-adr add-domain rename-domain add-repo list-repos register-path cleanup-stale tunnels-up tunnels-status tunnels-check bridges install-hooks install-hooks-all gitea-inventory COMPOSE = docker compose -f infra/docker-compose.yml --env-file .env @@ -13,6 +13,14 @@ start: install: uv sync +dashboard/node_modules/.bin/observable: dashboard/package.json dashboard/package-lock.json + cd dashboard && npm ci + +dashboard-install: dashboard/node_modules/.bin/observable + +dashboard-check: dashboard-install + cd dashboard && npm run build + ## Symlink the custodian CLI into ~/.local/bin so it's on PATH system-wide install-cli: install mkdir -p ~/.local/bin @@ -42,12 +50,15 @@ mcp-http: dashboard: @fuser -k 3000/tcp 2>/dev/null && echo "Stopped running dashboard" || true + $(MAKE) dashboard-install cd dashboard && npm run dev check: curl -sf http://127.0.0.1:8000/state/health | python3 -m json.tool -test: +test: test-python dashboard-check + +test-python: TEST_DATABASE_URL=postgresql+asyncpg://custodian:changeme@127.0.0.1:5432/custodian_test \ uv run pytest -x -q diff --git a/README.md b/README.md index 1e77e57..32b8221 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ make api # db + migrate + uvicorn :8000 (restarts if runnin ### Dashboard ```bash -make dashboard # Observable dev server on :3000 +make dashboard # installs dashboard deps if needed, then Observable dev server on :3000 +make dashboard-check # installs deps if needed, then runs Observable build ``` ### Start Everything @@ -111,8 +112,11 @@ custodian register-project # register cwd as a Custodian project | `make migrate` | `alembic upgrade head` | | `make seed` | Insert 6 canonical topics | | `make api` | `db` + wait + `migrate` + `uvicorn` (restarts if running) | -| `make dashboard` | Observable dev server (restarts if running) | +| `make dashboard-install` | Install dashboard npm deps from `dashboard/package-lock.json` | +| `make dashboard-check` | Build the Observable dashboard as a smoke/regression check | +| `make dashboard` | Install deps if needed, then start Observable dev server (restarts if running) | | `make check` | `curl /state/health` | +| `make test` | Python test suite plus `make dashboard-check` | | `make register-project DOMAIN=x PROJECT_PATH=y` | Register a project | | `make clean` | `docker compose down -v` (destroys DB volume) |