diff --git a/cli/commands/dev/handler.ts b/cli/commands/dev/handler.ts index 877e4e7fbf..41716e8ffc 100644 --- a/cli/commands/dev/handler.ts +++ b/cli/commands/dev/handler.ts @@ -60,9 +60,11 @@ export async function handleDevCommand(args: ParsedArgs): Promise { // Clear stale ESM caches to prevent module resolution issues from previous runs await clearAllLocalCaches(); - await devCommand({ + const { done } = await devCommand({ port: opts.port, projectDir, hmr: opts.hmr, }); + + await done; } diff --git a/cli/main.ts b/cli/main.ts index 5fde6192f2..eaf7798435 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -46,3 +46,8 @@ const args = getArgs(); const { parseCliArgs } = await import("./shared/args.ts"); const { routeCommand } = await import("./router.ts"); await routeCommand(parseCliArgs(args)); + +// Exit cleanly after one-shot commands. Long-running commands (dev, start, mcp) +// never return from routeCommand, so this only runs for commands like deploy, push, init, build. +const { exitProcess } = await import("./utils/index.ts"); +exitProcess(0); diff --git a/deno.json b/deno.json index a386f29bcb..5b3e4eaa87 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "veryfront", - "version": "0.1.12", + "version": "0.1.13", "nodeModulesDir": "auto", "exclude": [ "npm/",