feat: add a built-output smoke test command (`nuxt preview --smoke`)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- bun, node.js, typescript
Direzione di ricerca
Read the existing nuxt preview command and the described ~550-line Bun smoke script to map how the built server is started and checked. Then trace how the CLI resolves the .output entry and handles environment and signals across runtimes. Done means a smoke command checks HTTP expectations and shutdown, exits nonzero on failure, and leaves no server process running.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
nuxt preview starts .output/server/index.mjs, but it does not verify that the built output:
- boots with the production environment,
- serves the shell and all required assets/chunks,
- starts with the intended runtime (Bun or Node),
- runs Nitro
closehooks and exits cleanly onSIGTERM/SIGINT.
nuxt build can pass while the deploy fails at runtime: a missing secret, a wrong database path, a missing asset, a preset regression (for example the Bun preset skipping close hooks), or a shutdown that hangs. We currently maintain a ~550-line smoke script for this.
What our script does:
- reserves a free port, creates temporary SQLite databases, and applies migrations;
- builds a minimal environment instead of inheriting the developer
.env; - spawns
.output/server/index.mjswith Bun; - waits for HTTP 200 and a known shell marker, and scans captured logs for forbidden content;
- sends
SIGTERM, asserts exit within 15 seconds and clean shutdown; on Windows it records that Bun'sSIGTERMis termination-only; - is the last step of
check -> build -> built-output Playwright -> smoke.
Proposal: nuxt preview --smoke (or nuxt build --smoke) with:
--url/--expectfor a path plus expected status and optional body marker;--timeoutand--signal;--env-fileor--envfor a minimal production environment;- an assertion that the process exits after the signal, optionally checking a close-hook marker;
- a non-zero exit on failure, and no server process left behind;
- support for the current runtime and
.outputlayout without hard-coding Nitro internals.
What exists today:
nuxt previewstarts the server but makes no assertions.@nuxt/test-utilsis excellent for tests that call the server, but it does not own the built process lifecycle or shutdown assertions.- Nitro close hooks are usually tested manually or with a custom script.
This could be a module, but a CLI command is the right home because it must know the output entry, environment loading and signal semantics. Happy to contribute the command or a shared helper. Our script is Bun-specific today; cross-platform signal handling is the main design work.
Additional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
- Lingua principale
- TypeScript
- Stelle
- 402
- Fork
- 125
- Merge medio
- 2g 9h
- PR unite (30g)
- 37
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nuxt/cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
dev: false "reachable from the network" warning when `devServer.host` is a `*.localhost` subdomainForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
[Bug]: Search input loses focus while typing on the Inventory, Reservations and Locations lists (view_configurations enabled)Forse già presa @medusa-os-bot l’ha presa oggi. Apertastatus: needs triaging type: bug version: 2.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
medusajs/medusa#17886 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
marimo-team/marimo#11949 ·
I maintainer di solito rispondono entro 1 giorno
-
bug server-time v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
modelcontextprotocol/servers#5559 ·
I maintainer di solito rispondono entro 1 giorno
-
D1 Time Travel restore help advertises 30 days without a plan qualifierForse già presa @akhil9tiet l’ha presa oggi. Apertabug package:wrangler product:d1
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
cloudflare/workers-sdk#17000 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug severity:medium triage:confirmed triage:reproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Cotal-AI/Cotal#7440 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno