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/*infullmodeWorkspaceWatcher: watchessrc/**andtypes/**, batching changes and full reload triggersbun-generated-frontend-watch.ts: runs the generated frontend host used byspaandfullbun-ssg-watch.ts: runs the SSG frontend watch sessionBackendRuntimeSupervisor: starts and restartsbuild/backend/index.jsafter successful backend builds
Responsibilities Split
- Orchestrator commands decide which helpers are needed for the workspace mode.
- 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