feat(framework): bare framework foregrounds the dashboard; --daemon backgrounds it#459
Merged
Merged
Conversation
…d; `--daemon` backgrounds it Closes #456. Bare `framework` now serves the dashboard in the foreground so its logs and server-thrown errors are visible and Ctrl+C stops it. `framework --daemon` does what bare `framework` used to: run detached in the background and return after printing the convenience commands. The detached child's server entry moved to an internal `--daemon-serve` flag (the background path spawns it), and bare `framework` defers to an already-running background daemon instead of fighting for the port. runDaemon gained an onListening hook for the foreground banner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #456.
Rom's ask: bare
frameworkshould just spin up the (Telefunc) server in the foreground so Ctrl+C terminates it and the server's logs/errors are visible;framework --daemonshould do what happens today (background it).What
frameworknow runs the dashboard in the foreground (runForegroundDaemonCmd): prints◆ dashboard running: <url>+Ctrl+C to stop. Server logs stream below., serves in-process, and stops cleanly on SIGINT/SIGTERM. If a background daemon already owns the port, it reports the URL and defers instead of fighting for the bind.framework --daemonnow does what bareframeworkused to:ensureDaemonspawns the detached background server and prints the convenience commands, then returns.--daemonto an internal--daemon-serveflag (undocumented; the background path spawns it), so--daemonno longer re-serves.runDaemongained anonListening(state)hook for the foreground banner (fires after the port binds + state is written, before it blocks).Verify (real daemon, driven end-to-end)
framework --daemon-> background child serving HTTP 200, convenience printed, exit 0.frameworkwhile one runs ->already running in the background: <url>, exit 0 (defers, no port fight).framework stop-> stops it, port closes.frameworkwith none running -> foreground banner, serves HTTP 200, SIGINT stops it cleanly and frees the port.--daemon-serve; bare-framework foreground-defer routing;--daemonbackground routing.