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

@@ -17,12 +17,12 @@
"babel-plugin-react-compiler": "^19.1.0-rc.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"fumadocs-core": "15.2.10",
"fumadocs-mdx": "11.6.1",
"fumadocs-ui": "15.2.10",
"lucide-react": "^0.503.0",
"fumadocs-core": "15.3.0",
"fumadocs-mdx": "11.6.3",
"fumadocs-ui": "15.3.0",
"lucide-react": "^0.509.0",
"motion": "^12.10.5",
"next": "15.3.1",
"next": "15.3.2",
"next-themes": "^0.4.6",
"nuqs": "^2.4.3",
"react": "^19.1.0",
@@ -32,15 +32,15 @@
"tailwind-merge": "^3.2.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.5",
"@tailwindcss/postcss": "^4.1.6",
"@types/mdx": "^2.0.13",
"@types/node": "22.14.1",
"@types/node": "22.15.17",
"@types/react": "^19.1.3",
"@types/react-dom": "^19.1.3",
"eslint": "^9.26.0",
"eslint-config-next": "15.3.1",
"eslint-config-next": "15.3.2",
"postcss": "^8.5.3",
"tailwindcss": "^4.1.5",
"tailwindcss": "^4.1.6",
"tw-animate-css": "^1.2.9",
"typescript": "^5.8.3"
}

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: [
{