add cloudflare workers support (#326)

This commit is contained in:
Aman Varshney
2025-06-16 22:55:26 +05:30
committed by GitHub
parent 5fc1ba164e
commit b34e94a09e
34 changed files with 556 additions and 538 deletions

View File

@@ -17,20 +17,34 @@ export async function getRuntimeChoice(
return "node";
}
const runtimeOptions: Array<{
value: Runtime;
label: string;
hint: string;
}> = [
{
value: "bun",
label: "Bun",
hint: "Fast all-in-one JavaScript runtime",
},
{
value: "node",
label: "Node.js",
hint: "Traditional Node.js runtime",
},
];
if (backend === "hono") {
runtimeOptions.push({
value: "workers",
label: "Cloudflare Workers (beta)",
hint: "Edge runtime on Cloudflare's global network",
});
}
const response = await select<Runtime>({
message: "Select runtime",
options: [
{
value: "bun",
label: "Bun",
hint: "Fast all-in-one JavaScript runtime",
},
{
value: "node",
label: "Node.js",
hint: "Traditional Node.js runtime",
},
],
options: runtimeOptions,
initialValue: DEFAULT_CONFIG.runtime,
});