Repository navigation
Start dev and demo with bun run --parallel instead of the fish script - #86
Conversation
`bun run dev` and `bun run demo` are now plain package.json scripts: they set SNAPRAID_BASE_PATH (absolute, from $PWD) and, for the demo, run scripts/dev/setup.sh first and set SNAPRAID_BIN, SNAPRAID_EXTRA_ARGS and SNAPRAID_DEMO, then start `dev:server` and `dev:web` with Bun's built-in `bun run --parallel`, which stops the other script when one fails. No process supervision of our own: the terminal sends Ctrl+C, Ctrl+Z and hangup to the whole foreground process group, so Ctrl+C stops both servers, Ctrl+Z suspends both and fg resumes them. scripts/start.sh and the fish requirement are gone; README, docs and comments updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z
TDD review: 1 finding
|
bun run --parallel pipes the scripts' output for its name prefix, so Vite and the backend no longer see a TTY and Vite printed no colours, unlike scripts/start.sh, which left them on the terminal. Both scripts now set FORCE_COLOR=1 when their own stdout is a terminal; piped or redirected output stays free of escape codes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z
|
Fix pushed: cbc98ae ( Generated by Claude Code |
|
TDD-Review abgeschlossen: 1 belegtes Finding (keine Farben unter Merge per Squash. Generated by Claude Code |
Replaces the closed #85: no hand-written process supervision, and no start script at all.
bun run devandbun run demoare now plain scripts in the rootpackage.json:They behave like
scripts/start.sh: absolute paths for the data directory and the binary, and the sandbox setup runs first, so a failure there aborts.bun run --parallel(Foreman-style output) stops the other script when one fails. The terminal sends Ctrl+C, Ctrl+Z and hangup to the whole foreground process group, so nothing needs to forward them.scripts/start.shdeleted, fish removed from README anddocs/development.md; the docs describe the two scripts and Ctrl+C / Ctrl+Z /fgstart.shupdated (.gitignore,scripts/dev/setup.sh,apps/server/src/system/demo.ts,e2e/harness/demo-setup.ts)Verified in a real pty (interactive bash, Bun 1.4.4)
bun run dev: server on 8080 and web on 3000 answer; Ctrl+C: no process of the tree left, exit code 130T, the shell takes input;fg: all running again, both ports answer; Ctrl+C afterwards: nothing leftbun run dev:SNAPRAID_BASE_PATH=/…/snapraid-ui/snapraidin/proc/<pid>/environof the server and the Vite processesbun run demo: all fourSNAPRAID_*variables (absolute paths) in/proc/<pid>/environof the server and the Vite processessetup.shfailing (temporaryexit 1):demoexits with 1, no server startsbun --watchwaits for a file change instead of exiting, so the web server keeps running.start.shbehaved the same way.Checks:
bun install --frozen-lockfile, serverbun test(236 tests, 0 fail) and typecheck, web biome check, typecheck and build.Generated by Claude Code