Skip to content

Commit 8ae2727

Browse files
committed
build(ui): fail fast when Admin UI build prerequisites are missing
Make `make build-ui` exit non-zero with an actionable message when npm is absent (with a SKIP_UI_BUILD=1 escape hatch for headless deployments), so `make install-dev` surfaces missing prerequisites at install time instead of leaving /admin to fail at runtime with "No bundle-*.js found". Provision Node via the official devcontainers feature so Codespaces / devcontainer setup still completes end-to-end under the new fail-fast behavior, and document the prerequisite + bypass in the building guide. Signed-off-by: Jonathan Springer <jps@s390x.com>
1 parent dd34050 commit 8ae2727

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"dockerfile": "Dockerfile",
55
"context": ".."
66
},
7-
"features": {},
7+
"features": {
8+
"ghcr.io/devcontainers/features/node:1": {
9+
"version": "lts"
10+
}
11+
},
812
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
913
"customizations": {
1014
"vscode": {

docs/docs/development/building.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,24 @@ npm install # install frontend dev dependencies
103103

104104
### Building the Admin UI Bundle
105105

106-
The Admin UI JavaScript is bundled with Vite. The bundle is not committed to the repository — it is built locally during `make install-dev` (which calls `make build-ui`). Rebuild after any changes to files under `mcpgateway/admin_ui/`.
106+
The Admin UI JavaScript is bundled with Vite. The bundle is **not committed** to the repository — it must be built locally. `make install-dev` invokes `make build-ui` automatically, and the step is required: without a bundle, `/admin` will fail to load at runtime with `No bundle-*.js found`. Rebuild after any changes to files under `mcpgateway/admin_ui/`.
107+
108+
**Node.js is a prerequisite.** If `npm` is missing, `make build-ui` (and therefore `make install-dev`) fails fast rather than leaving a broken install. Install Node.js from <https://nodejs.org> before running setup.
107109

108110
```bash
109111
make build-ui # build mcpgateway/static/bundle-<hash>.js (requires npm)
110112
```
111113

112-
Or manually:
114+
If you genuinely do not need the Admin UI (for example, a headless API-only deployment where `MCPGATEWAY_UI_ENABLED=false`), bypass the step with:
115+
116+
```bash
117+
SKIP_UI_BUILD=1 make install-dev
118+
```
119+
120+
Or build manually:
113121

114122
```bash
115-
npm ci # install dependencies from lockfile (if not already done)
123+
npm ci # install dependencies from lockfile (falls back to `npm install` if lockfile absent)
116124
npm run vite:build # produce mcpgateway/static/bundle-<hash>.js
117125
```
118126

0 commit comments

Comments
 (0)