From 0fbb7ef7bf4bfff0bb56e7f8436da849f0e77853 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Sun, 31 Aug 2025 17:53:17 +0530 Subject: [PATCH] fix (#555) --- .../app/(home)/_components/stack-builder.tsx | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/apps/web/src/app/(home)/_components/stack-builder.tsx b/apps/web/src/app/(home)/_components/stack-builder.tsx index 272c3e0..afb2b4b 100644 --- a/apps/web/src/app/(home)/_components/stack-builder.tsx +++ b/apps/web/src/app/(home)/_components/stack-builder.tsx @@ -1004,6 +1004,24 @@ const analyzeStackCompatibility = (stack: StackState): CompatibilityResult => { } } + if (nextStack.runtime === "workers" && nextStack.serverDeploy === "none") { + notes.runtime.notes.push( + "Cloudflare Workers runtime requires a server deployment. Wrangler will be selected.", + ); + notes.serverDeploy.notes.push( + "Cloudflare Workers runtime requires a server deployment. Wrangler will be selected.", + ); + notes.runtime.hasIssue = true; + notes.serverDeploy.hasIssue = true; + nextStack.serverDeploy = "wrangler"; + changed = true; + changes.push({ + category: "serverDeploy", + message: + "Server deployment set to 'Wrangler' (Cloudflare Workers runtime requires a server deployment)", + }); + } + const webFrontendsSelected = nextStack.webFrontend.some((f) => f !== "none"); if (!webFrontendsSelected && nextStack.webDeploy !== "none") { notes.webDeploy.notes.push( @@ -1492,6 +1510,10 @@ const StackBuilder = () => { category: keyof typeof TECH_OPTIONS, techId: string, ) => { + if (!isOptionCompatible(stack, category, techId)) { + return; + } + setStack((currentStack) => { const catKey = category as keyof StackState; const update: Partial = {}; @@ -1689,6 +1711,46 @@ const StackBuilder = () => { } } + if ( + category === "backend" && + finalStack.runtime === "workers" && + optionId !== "hono" + ) { + return false; + } + + if ( + category === "runtime" && + optionId === "workers" && + finalStack.backend !== "hono" + ) { + return false; + } + + if ( + category === "orm" && + finalStack.database === "none" && + optionId !== "none" + ) { + return false; + } + + if ( + category === "database" && + optionId !== "none" && + finalStack.orm === "none" + ) { + return false; + } + + if ( + category === "serverDeploy" && + finalStack.runtime === "workers" && + optionId === "none" + ) { + return false; + } + if ( category === "webFrontend" || category === "nativeFrontend" ||