Skip to content

Commit 0fbb7ef

Browse files
fix (#555)
1 parent bae99c3 commit 0fbb7ef

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

apps/web/src/app/(home)/_components/stack-builder.tsx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,24 @@ const analyzeStackCompatibility = (stack: StackState): CompatibilityResult => {
10041004
}
10051005
}
10061006

1007+
if (nextStack.runtime === "workers" && nextStack.serverDeploy === "none") {
1008+
notes.runtime.notes.push(
1009+
"Cloudflare Workers runtime requires a server deployment. Wrangler will be selected.",
1010+
);
1011+
notes.serverDeploy.notes.push(
1012+
"Cloudflare Workers runtime requires a server deployment. Wrangler will be selected.",
1013+
);
1014+
notes.runtime.hasIssue = true;
1015+
notes.serverDeploy.hasIssue = true;
1016+
nextStack.serverDeploy = "wrangler";
1017+
changed = true;
1018+
changes.push({
1019+
category: "serverDeploy",
1020+
message:
1021+
"Server deployment set to 'Wrangler' (Cloudflare Workers runtime requires a server deployment)",
1022+
});
1023+
}
1024+
10071025
const webFrontendsSelected = nextStack.webFrontend.some((f) => f !== "none");
10081026
if (!webFrontendsSelected && nextStack.webDeploy !== "none") {
10091027
notes.webDeploy.notes.push(
@@ -1492,6 +1510,10 @@ const StackBuilder = () => {
14921510
category: keyof typeof TECH_OPTIONS,
14931511
techId: string,
14941512
) => {
1513+
if (!isOptionCompatible(stack, category, techId)) {
1514+
return;
1515+
}
1516+
14951517
setStack((currentStack) => {
14961518
const catKey = category as keyof StackState;
14971519
const update: Partial<StackState> = {};
@@ -1689,6 +1711,46 @@ const StackBuilder = () => {
16891711
}
16901712
}
16911713

1714+
if (
1715+
category === "backend" &&
1716+
finalStack.runtime === "workers" &&
1717+
optionId !== "hono"
1718+
) {
1719+
return false;
1720+
}
1721+
1722+
if (
1723+
category === "runtime" &&
1724+
optionId === "workers" &&
1725+
finalStack.backend !== "hono"
1726+
) {
1727+
return false;
1728+
}
1729+
1730+
if (
1731+
category === "orm" &&
1732+
finalStack.database === "none" &&
1733+
optionId !== "none"
1734+
) {
1735+
return false;
1736+
}
1737+
1738+
if (
1739+
category === "database" &&
1740+
optionId !== "none" &&
1741+
finalStack.orm === "none"
1742+
) {
1743+
return false;
1744+
}
1745+
1746+
if (
1747+
category === "serverDeploy" &&
1748+
finalStack.runtime === "workers" &&
1749+
optionId === "none"
1750+
) {
1751+
return false;
1752+
}
1753+
16921754
if (
16931755
category === "webFrontend" ||
16941756
category === "nativeFrontend" ||

0 commit comments

Comments
 (0)