Skip to content

feat(framework): keep the app running after --serve + live preview link#177

Merged
suleimansh merged 1 commit into
mainfrom
suleimansh/feat/framework-app-preview
Jul 3, 2026
Merged

feat(framework): keep the app running after --serve + live preview link#177
suleimansh merged 1 commit into
mainfrom
suleimansh/feat/framework-app-preview

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #176 (child of #165). Follows #175 (session link).

The payoff moment: after a build, click and see your app running.

What

  • After a successful --serve run, the app is booted once more in the adopted runner and left serving. A new preview FrameworkEvent 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).
  • runFramework returns an optional AppPreview handle ({ url, command, stop() }) so the caller owns the app's lifecycle.
  • Persistence is opt-in via ServeConfig.keepAlive (the CLI sets it). The library default stays 'boot, check, tear down', so a programmatic caller that ignores preview never leaks a process. Reuses the deps the serve gate already installed.

Why the opt-in

Caught during testing: auto-keeping the app alive whenever --serve is 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

  • 50 tests / 50 pass / 0 fail, and the suite self-exits (no leaked process); typecheck + build clean. New tests: preview boots + serves + stop() tears down; the default leaves no preview handle; preview formatter unit.
  • Live CLI smoke (fresh build): framework --fake --serve 'node server.js' --serve-port 8149 prints ▶ your app is running at http://localhost:8149, the app answers hello v2, dashboard ships the #app-banner + preview SSE frame, and the app is torn down on exit.

Changeset: minor.

…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
@suleimansh suleimansh added enhancement New feature or request priority: medium Worth doing, not urgent labels Jul 3, 2026
@suleimansh suleimansh self-assigned this Jul 3, 2026
@suleimansh suleimansh merged commit 3006a91 into main Jul 3, 2026
2 checks passed
@suleimansh suleimansh deleted the suleimansh/feat/framework-app-preview branch July 3, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: medium Worth doing, not urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard: keep the generated app running + show a live preview link

1 participant