Services
Long-running helpers that keep the Bun watch loop small and predictable.
The active implementation no longer uses the older DevService / WatchService / ChangeService class structure. Instead, the Bun orchestrator composes a small set of focused helpers.
Active Pieces
DevServer: servesbuild/frontend/**, emits SSE status/reload events, and proxies/api/*when the app has pages and a serverWorkspaceWatcher: watchessrc/**andtypes/**, batching changes and full reload triggersdocument-watch.ts: runs the frontend watch session for every app with pagesBackendRuntimeSupervisor: starts and restartsbuild/backend/index.jsafter successful backend builds
Responsibilities Split
- Orchestrator commands decide which helpers are needed from the app's layers.
- The frontend package owns incremental frontend build logic and HMR decisions.
- The Bun orchestrator owns process supervision, HTTP serving, and proxying.
Change Flow
- Frontend file changes flow through
WorkspaceWatcherto the active frontend watch session. - The frontend watch session emits diagnostics that the orchestrator turns into browser status, HMR, or reload events.
- Backend rebuild completions flow through
startBackendWatch()and triggerBackendRuntimeSupervisor.restart().
Why This Matters
This split keeps the active system simple:
- frontend logic stays in the frontend package
- backend build logic stays in the backend package
- the CLI remains a coordinator instead of a second implementation of those pipelines
Related Docs
- Engine — engine
- Dev service — devservice
- Servers — servers
- Watch workflow — watch