patties dev
Start the local development server with hot reload, ready to use in one command.
Purpose
Start the local development server with hot reload, ready to use in one command.
Usage
patties dev [--port <n>] [--host <h>] [--cold] [--cwd <path>] [--config <path>]
Behavior
- Load the resolved config (06).
- Re-exec the dev runner under
bun --hot(the default) — modules reload in place,Bun.serveis reused across reloads, and existing WebSockets survive. See framework spec 05-dev-hmr. The first invocation detects whether it is already the hot child via an env flag (e.g.PATTIES_DEV_HOT=1) to avoid an infinite re-exec loop.--coldopts intobun --watchinstead (full process restart on each save). Useful when modules carry init-only state that doesn't reload cleanly.
- Build (incremental) the client bundle once at start; subsequent reloads reuse cached chunks where possible.
- Compile routes (framework 02) and start the server with
dev: true(framework 01). Routing goes throughBun.serve({ routes })— no HTTP framework is loaded. - Print:
▲ Patties dev ready at http://<host>:<port>and the project root. - Forward
SIGINT/SIGTERMto shut down cleanly.
Flags
--port— default from config, else3000.--host— default from config, else0.0.0.0.--cold— usebun --watch(process restart) instead ofbun --hot.--no-open— reserved for future browser-open behavior; no-op today.
Output
- One header line on boot.
- Each request:
→ GET /hotels/bali 200 12ms(color when TTY). - On error: stack with source mapped back to the user's file when possible.
Acceptance criteria
patties devin a freshbunx create-pattiesproject starts a server onhttp://localhost:3000rendering the seed page.- Editing
app/routes/index.tsxcauses the browser to reload within ~500ms. - Ctrl-C exits with code 0 and no orphaned processes.
- An error in a route file prints a usable diagnostic and keeps the server up.