From 0a53126411f4c36622329727e7cfd737fe209c3c Mon Sep 17 00:00:00 2001 From: andylovescode Date: Mon, 25 Aug 2025 10:27:13 -0700 Subject: [PATCH] Vercel: Improve exit behaviour and logs --- packages/wormhole/src/build/adapters/vercel.ts | 12 ++++++++---- packages/wormhole/src/cli/entry.ts | 7 ++++++- packages/wormhole/src/cli/statusboard.tsx | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/packages/wormhole/src/build/adapters/vercel.ts b/packages/wormhole/src/build/adapters/vercel.ts index 619e402..122fe39 100644 --- a/packages/wormhole/src/build/adapters/vercel.ts +++ b/packages/wormhole/src/build/adapters/vercel.ts @@ -308,8 +308,10 @@ export function VercelAdapter(): VercelAdapter { await mkdir(functionsDir, { recursive: true }); // Build client bundle and CSS - await this.buildClientBundle(build); - await this.buildCSS(build); + const buildPromises: Promise[] = []; + + buildPromises.push(this.buildClientBundle(build)); + buildPromises.push(this.buildCSS(build)); let currentPhase: HandlePhase | null = null; let vindicatorSteps: MatchStep[] = []; @@ -318,7 +320,7 @@ export function VercelAdapter(): VercelAdapter { // Build individual route functions const routeFunctions: string[] = []; - for (const route of build.routes) { + buildPromises.push(...build.routes.map(async (route) => { const functionPath = await this.buildRouteFunction(build, route); routeFunctions.push(functionPath); @@ -361,7 +363,9 @@ export function VercelAdapter(): VercelAdapter { path: srcStr, func: destStr, }) - } + })); + + await Promise.all(buildPromises); const config = vindicate({ steps: vindicatorSteps, diff --git a/packages/wormhole/src/cli/entry.ts b/packages/wormhole/src/cli/entry.ts index 3e292b2..c8f9269 100644 --- a/packages/wormhole/src/cli/entry.ts +++ b/packages/wormhole/src/cli/entry.ts @@ -55,6 +55,9 @@ const commands = [ DevServer(state); StatusBoard(state); + + // wait forever + await new Promise(() => { }); }, "dev"), command(async ({ platform }: { platform?: string }) => { const lt = new Lifetime(); @@ -73,9 +76,11 @@ const commands = [ } const build = new Build(state, adapter); - const result = await build.run(); + await build.run(); console.log(`Successfully built for ${adapter.target}`); + + process.exit(0); }, "build", optional(positional("platform"))) ] diff --git a/packages/wormhole/src/cli/statusboard.tsx b/packages/wormhole/src/cli/statusboard.tsx index 992dd77..7c31602 100644 --- a/packages/wormhole/src/cli/statusboard.tsx +++ b/packages/wormhole/src/cli/statusboard.tsx @@ -42,6 +42,8 @@ function TaskView({ task }: { task: Task }) { } export function StatusBoard(state: Project) { + linearView.enabled = false; + const lt = state.lt; using _hlt = Lifetime.changeHookLifetime(lt); @@ -238,14 +240,26 @@ function LeftPanel() { ; } +const linearView = { + enabled: true +} + export function addTask(props: Omit): Task { const task: Task = { ...props, [Symbol.dispose]: () => { tasks.set(getImmediateValue(tasks).filter((t) => t !== task)); + + if (linearView.enabled) { + console.log(`[${task.name}]: done`); + } }, }; + if (linearView.enabled) { + console.log(`[${task.name}]: started`); + } + tasks.set([...getImmediateValue(tasks), task]); return task;