Skip to content

Build robustness + a real test net#7

Open
miguelrisero wants to merge 3 commits into
fix/build-safetyfrom
fix/build-robustness-and-tests
Open

Build robustness + a real test net#7
miguelrisero wants to merge 3 commits into
fix/build-safetyfrom
fix/build-robustness-and-tests

Conversation

@miguelrisero

Copy link
Copy Markdown
Contributor

Stack 3 of 5 (base: fix/build-safety). Council P0/P1 — robustness and the missing safety net.

Robustness / correctness (build.mjs)

  • npm ci for lockfile projects (was npm install) → reproducible builds.
  • run() error handler + double-settle guard → a failed spawn rejects instead of hanging.
  • Bounded concurrency (mapLimit) instead of unbounded Promise.allSettled.
  • Skip failed projects in assembly/index/config → no partial/empty output in the deploy.
  • Fail-fast on multi-segment dynamic [param] entries (they silently 404'd before).

Dev server (dev.mjs)

  • CRON_SECRET fallback refuses to apply in CI/prod; serve-path log now matches reality.

Tests (new)

  • node --test (11 tests) covering escaping, slug validation, and buildVercelConfig (static / [id] / catchAll / multi-segment reject / nuxt-server ordering / crons) + collectCronEntries. Wired into CI via a new npm test step. This exercises the routing/cron logic the two example projects never hit.

npm test + npm run build both green locally.

⚠️ Stacked — merge after #6. Order: 1→5.

- detectInstallCmd uses `npm ci` for package-lock projects (was `npm install`,
  which floats deps) — matches build-node-functions.mjs.
- run() gains a child 'error' handler + double-settle guard so a failed spawn
  rejects instead of hanging the build forever.
- Bounded build concurrency (mapLimit) instead of unbounded Promise.allSettled.
- Assembly, landing index, and config now use only successfully-built projects,
  so a failed project can't leak partial/empty output into the deployment.
- Extract pure buildVercelConfig() (fail-fast on multi-segment dynamic [param]
  entries that would silently 404), and export pure helpers + guard main() so
  the orchestrator can be unit-tested.
…ve path

Refuse the 'local-dev-cron-secret' fallback when CI/VERCEL/NODE_ENV=production,
and report the actual served directory (.vercel/output/static, dist fallback)
instead of the stale 'Serving from: dist'.
node --test coverage for escapeHtml, safeHref, slug validation, and
buildVercelConfig (static, dynamic [id], catchAll, multi-segment reject,
nuxt-server ordering, crons) + collectCronEntries. Adds `npm test` and a CI
test step — exercises the routing/cron logic that the example projects don't.
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
templates Ready Ready Preview, Comment Jun 3, 2026 9:41am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant