dont allow examples when api is none (#243)

This commit is contained in:
Aman Varshney
2025-05-10 22:28:05 +05:30
committed by GitHub
parent 2924b817a3
commit 6a339bca1f
12 changed files with 188 additions and 241 deletions

View File

@@ -299,17 +299,8 @@ const analyzeStackCompatibility = (stack: StackState): CompatibilityResult => {
message: "Runtime set to 'Bun' (None is only for Convex)",
});
}
if (nextStack.api === "none") {
notes.api.notes.push(
"API 'None' is only for Convex. Defaulting to 'tRPC'.",
);
notes.api.hasIssue = true;
nextStack.api = DEFAULT_STACK.api;
changed = true;
changes.push({
category: "api",
message: "API set to 'tRPC' (None is only for Convex)",
});
if (nextStack.api === "none" && (isConvex || isBackendNone)) {
} else if (nextStack.api === "none" && !(isConvex || isBackendNone)) {
}
if (nextStack.database === "none") {
@@ -1047,11 +1038,13 @@ const StackArchitect = () => {
}
if (catKey === "api") {
if (techId === "none" && !rules.isConvex) {
if (techId !== "none" && (rules.isConvex || rules.isBackendNone)) {
addRule(
category,
techId,
"Disabled: API 'None' is only available with Convex backend.",
rules.isConvex
? "Disabled: Convex backend requires API to be 'None'."
: "Disabled: No backend requires API to be 'None'.",
);
}
if (techId === "trpc" && rules.hasNuxtOrSvelteOrSolid) {

View File

@@ -15,6 +15,13 @@ export const TECH_OPTIONS = {
icon: "/icon/orpc.svg",
color: "from-indigo-400 to-indigo-600",
},
{
id: "none",
name: "No API",
description: "No API layer (API routes disabled)",
icon: "🚫",
color: "from-gray-400 to-gray-600",
},
],
frontend: [
{