feat(framework): keep the app running after --serve + live preview link#177
Merged
Merged
Conversation
…w link
Once the boot-and-serve gate passes, boot the generated app once more and
leave it serving so the user can open it. The dashboard shows an 'open your
app' banner and the terminal prints the URL, live until the run is stopped
(Ctrl+C tears the app down). runFramework returns an optional preview handle
({ url, command, stop() }); persistence is opt-in via ServeConfig.keepAlive
(the CLI sets it) so a programmatic run never leaks a process.
Closes #176
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 #176 (child of #165). Follows #175 (session link).
The payoff moment: after a build, click and see your app running.
What
--serverun, the app is booted once more in the adopted runner and left serving. A newpreviewFrameworkEvent surfaces the URL: the dashboard shows an 'open your app' banner and the terminal prints it, both live until you stop the run (Ctrl+C tears the app down).runFrameworkreturns an optionalAppPreviewhandle ({ url, command, stop() }) so the caller owns the app's lifecycle.ServeConfig.keepAlive(the CLI sets it). The library default stays 'boot, check, tear down', so a programmatic caller that ignorespreviewnever leaks a process. Reuses the deps the serve gate already installed.Why the opt-in
Caught during testing: auto-keeping the app alive whenever
--serveis set left the existing gate test's server running (it ignores the return), hanging the suite. Making persistence explicit is both the correct API contract and the fix.Verify
stop()tears down; the default leaves nopreviewhandle;previewformatter unit.framework --fake --serve 'node server.js' --serve-port 8149prints▶ your app is running at http://localhost:8149, the app answershello v2, dashboard ships the#app-banner+previewSSE frame, and the app is torn down on exit.Changeset: minor.