From e03a2fed89d9e2c993bc445acc9432119a12ce92 Mon Sep 17 00:00:00 2001 From: archipelago Date: Thu, 20 Aug 2026 05:24:37 -0400 Subject: [PATCH] fix(release): surface frontend build failures instead of hiding them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `npm run build 2>&1 | tail -3` threw away npm's exit status, so a failed build was indistinguishable from a good one. The run continued and blamed the next check instead — "the frontend build no-opped or its output is stale" — which points at a stale dist rather than at the build error that actually happened, and cost a diagnosis cycle today. Success still prints the same quiet 3 lines; a failure now prints the real error, keeps the full log, and aborts on the spot. Verified both branches with a stubbed npm. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/create-release.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/create-release.sh b/scripts/create-release.sh index 7bb3f094..8ea85e45 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -155,7 +155,18 @@ cd "$PROJECT_ROOT" echo "[4/8] Building frontend..." cd "$PROJECT_ROOT/neode-ui" -npm run build 2>&1 | tail -3 +# `| tail -3` discards npm's exit status, so a FAILED build looked identical +# to a successful one and the run marched on to report the far more +# confusing "build no-opped or its output is stale" a few lines later. +# Keep the quiet 3-line output, but surface the real error when it breaks. +build_log=$(mktemp -t neode-build.XXXXXX.log) +if npm run build >"$build_log" 2>&1; then + tail -3 "$build_log"; rm -f "$build_log" +else + echo "Error: the frontend build FAILED — full log kept at $build_log" >&2 + tail -40 "$build_log" >&2 + exit 1 +fi cd "$PROJECT_ROOT" # npm run build wipes web/dist — fold AIUI straight back in. The OTA tarball