fix: Add build js command to makefile serve commands#4035
Conversation
8e22c7f to
5ba262e
Compare
Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Add js-build as a prerequisite for dev-echo for consistency with all other serve/dev targets. Update .secrets.baseline line numbers. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
226927c to
93b8fd9
Compare
crivetimihai
left a comment
There was a problem hiding this comment.
Nice contribution — this is a solid DX improvement. Having the Vite bundle built automatically before any server target prevents a common "blank UI" gotcha on fresh checkouts.
A couple of changes I made during rebase:
- Rebased onto main — the two merge commits are gone, replaced with a clean linear history.
- Dropped
.secrets.baselinefrom the original commit — the line-number shifts were artifacts of branch divergence and are handled separately. - Added
js-buildas a prerequisite todev-echo— this was the only dev/serve target missing it, and someone runningmake dev-echoon a fresh checkout would have gotten a broken frontend. Added a follow-up commit for this + the regenerated secrets baseline.
Minor note for future reference: the js-build target uses npm install while CI uses npm ci and Containerfiles use npm install --frozen-lockfile. For local dev this is fine — npm ci would be slower on repeated invocations since it wipes node_modules each time. Just worth keeping in mind if reproducibility ever becomes an issue.
LGTM — approving.
Guard the js-build target so it warns instead of failing when npm is not installed. This prevents serve/dev targets from breaking in environments without Node.js — the API server still starts, only the admin UI bundle is skipped. Also adds --no-audit --no-fund to suppress noisy npm output during server startup. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
|
Follow-up fix pushed: the This avoids introducing Node.js as a hard runtime dependency for Also added |
* fix: Add build js command to makefile serve commands Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: add js-build dep to dev-echo, update secrets baseline Add js-build as a prerequisite for dev-echo for consistency with all other serve/dev targets. Update .secrets.baseline line numbers. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: make js-build graceful when npm is not available Guard the js-build target so it warns instead of failing when npm is not installed. This prevents serve/dev targets from breaking in environments without Node.js — the API server still starts, only the admin UI bundle is skipped. Also adds --no-audit --no-fund to suppress noisy npm output during server startup. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> --------- Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
* fix: Add build js command to makefile serve commands Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: add js-build dep to dev-echo, update secrets baseline Add js-build as a prerequisite for dev-echo for consistency with all other serve/dev targets. Update .secrets.baseline line numbers. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: make js-build graceful when npm is not available Guard the js-build target so it warns instead of failing when npm is not installed. This prevents serve/dev targets from breaking in environments without Node.js — the API server still starts, only the admin UI bundle is skipped. Also adds --no-audit --no-fund to suppress noisy npm output during server startup. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> --------- Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> Co-authored-by: Mihai Criveti <crivetimihai@gmail.com> Signed-off-by: cafalchio <mcafalchio@gmail.com>
* fix: Add build js command to makefile serve commands Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: add js-build dep to dev-echo, update secrets baseline Add js-build as a prerequisite for dev-echo for consistency with all other serve/dev targets. Update .secrets.baseline line numbers. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: make js-build graceful when npm is not available Guard the js-build target so it warns instead of failing when npm is not installed. This prevents serve/dev targets from breaking in environments without Node.js — the API server still starts, only the admin UI bundle is skipped. Also adds --no-audit --no-fund to suppress noisy npm output during server startup. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> --------- Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
* fix: Add build js command to makefile serve commands Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: add js-build dep to dev-echo, update secrets baseline Add js-build as a prerequisite for dev-echo for consistency with all other serve/dev targets. Update .secrets.baseline line numbers. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: make js-build graceful when npm is not available Guard the js-build target so it warns instead of failing when npm is not installed. This prevents serve/dev targets from breaking in environments without Node.js — the API server still starts, only the admin UI bundle is skipped. Also adds --no-audit --no-fund to suppress noisy npm output during server startup. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> --------- Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
📝 Summary
Adds a js-build target to the Makefile that runs npm install and npm run vite:build, wired as a prerequisite to all non-containerised app-starting targets (serve, serve-ssl, serve-granian, serve-granian-ssl, serve-granian-http2, dev, dev-remote, run). This ensures the Vite JS bundle is always up to date before the server starts, without requiring a separate manual step.
🏷️ Type of Change
Ensuring the JS/Vite bundle is built as part of the standard server startup workflow
📓 Notes (optional)
The js-build target is declared .PHONY so it always runs. npm install is included before the build step to keep the workflow self-contained - no assumption that node_modules is already present. dev-echo was left unchanged as it is an observability diagnostic variant, not a primary entry point.