Skip to content

Commit 16eb4db

Browse files
feat(web): allow convex + better-auth + native combinations
1 parent 95b5120 commit 16eb4db

File tree

1 file changed

+31
-15
lines changed
  • apps/web/src/app/(home)/new/_components

1 file changed

+31
-15
lines changed

apps/web/src/app/(home)/new/_components/utils.ts

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,13 @@ export const analyzeStackCompatibility = (
108108
["native-nativewind", "native-unistyles"].includes(f),
109109
);
110110

111-
const hasBetterAuthCompatibleFrontend = nextStack.webFrontend.some((f) =>
112-
["tanstack-router", "tanstack-start", "next"].includes(f),
113-
);
111+
const hasBetterAuthCompatibleFrontend =
112+
nextStack.webFrontend.some((f) =>
113+
["tanstack-router", "tanstack-start", "next"].includes(f),
114+
) ||
115+
nextStack.nativeFrontend.some((f) =>
116+
["native-nativewind", "native-unistyles"].includes(f),
117+
);
114118

115119
if (nextStack.auth === "clerk" && !hasClerkCompatibleFrontend) {
116120
convexOverrides.auth = "none";
@@ -919,13 +923,17 @@ export const analyzeStackCompatibility = (
919923
}
920924

921925
if (nextStack.backend === "convex" && nextStack.auth === "better-auth") {
922-
const hasBetterAuthCompatibleFrontend = nextStack.webFrontend.some(
923-
(f) => ["tanstack-router", "tanstack-start", "next"].includes(f),
924-
);
926+
const hasBetterAuthCompatibleFrontend =
927+
nextStack.webFrontend.some((f) =>
928+
["tanstack-router", "tanstack-start", "next"].includes(f),
929+
) ||
930+
nextStack.nativeFrontend.some((f) =>
931+
["native-nativewind", "native-unistyles"].includes(f),
932+
);
925933

926934
if (!hasBetterAuthCompatibleFrontend) {
927935
notes.auth.notes.push(
928-
"Better-Auth with Convex requires TanStack Router, TanStack Start, or Next.js frontend. Auth will be set to 'None'.",
936+
"Better-Auth with Convex requires TanStack Router, TanStack Start, Next.js, or React Native (NativeWind/Unistyles). Auth will be set to 'None'.",
929937
);
930938
notes.backend.notes.push(
931939
"Convex backend with Better-Auth requires compatible frontend. Auth will be disabled.",
@@ -1299,12 +1307,16 @@ export const getDisabledReason = (
12991307
return "Convex backend requires DB Setup to be 'None'. Convex handles database setup automatically.";
13001308
}
13011309
if (category === "auth" && optionId === "better-auth") {
1302-
const hasBetterAuthCompatibleFrontend = currentStack.webFrontend.some(
1303-
(f) => ["tanstack-router", "tanstack-start", "next"].includes(f),
1304-
);
1310+
const hasBetterAuthCompatibleFrontend =
1311+
currentStack.webFrontend.some((f) =>
1312+
["tanstack-router", "tanstack-start", "next"].includes(f),
1313+
) ||
1314+
currentStack.nativeFrontend.some((f) =>
1315+
["native-nativewind", "native-unistyles"].includes(f),
1316+
);
13051317

13061318
if (!hasBetterAuthCompatibleFrontend) {
1307-
return "Better-Auth with Convex requires TanStack Router, TanStack Start, or Next.js frontend.";
1319+
return "Better-Auth with Convex requires TanStack Router, TanStack Start, Next.js, or React Native (NativeWind/Unistyles).";
13081320
}
13091321
}
13101322
}
@@ -1402,12 +1414,16 @@ export const getDisabledReason = (
14021414

14031415
if (category === "auth" && optionId === "better-auth") {
14041416
if (finalStack.backend === "convex") {
1405-
const hasBetterAuthCompatibleFrontend = finalStack.webFrontend.some((f) =>
1406-
["tanstack-router", "tanstack-start", "next"].includes(f),
1407-
);
1417+
const hasBetterAuthCompatibleFrontend =
1418+
finalStack.webFrontend.some((f) =>
1419+
["tanstack-router", "tanstack-start", "next"].includes(f),
1420+
) ||
1421+
finalStack.nativeFrontend.some((f) =>
1422+
["native-nativewind", "native-unistyles"].includes(f),
1423+
);
14081424

14091425
if (!hasBetterAuthCompatibleFrontend) {
1410-
return "Better-Auth with Convex requires TanStack Router, TanStack Start, or Next.js frontend.";
1426+
return "Better-Auth with Convex requires TanStack Router, TanStack Start, Next.js, or React Native (NativeWind/Unistyles).";
14111427
}
14121428
}
14131429
}

0 commit comments

Comments
 (0)