Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/wormhole/src/build/adapters/vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>[] = [];

buildPromises.push(this.buildClientBundle(build));
buildPromises.push(this.buildCSS(build));

let currentPhase: HandlePhase | null = null;
let vindicatorSteps: MatchStep[] = [];
Expand All @@ -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);

Expand Down Expand Up @@ -361,7 +363,9 @@ export function VercelAdapter(): VercelAdapter {
path: srcStr,
func: destStr,
})
}
}));

await Promise.all(buildPromises);

const config = vindicate({
steps: vindicatorSteps,
Expand Down
7 changes: 6 additions & 1 deletion packages/wormhole/src/cli/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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")))
]

Expand Down
14 changes: 14 additions & 0 deletions packages/wormhole/src/cli/statusboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -238,14 +240,26 @@ function LeftPanel() {
</Frame>;
}

const linearView = {
enabled: true
}

export function addTask(props: Omit<Task, typeof Symbol.dispose>): 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;
Expand Down