create-better-t-stack 3.2.22 → 3.2.23-canary.2b547ed5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/index.d.ts +4 -2
  4. package/dist/index.js +1 -1
  5. package/dist/{src-WIwtBCHf.js → src-ehteLbIu.js} +105 -65
  6. package/package.json +1 -1
  7. package/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs +5 -5
  8. package/templates/auth/better-auth/convex/backend/convex/http.ts.hbs +1 -1
  9. package/templates/auth/better-auth/convex/native/bare/components/sign-in.tsx.hbs +127 -0
  10. package/templates/auth/better-auth/convex/native/bare/components/sign-up.tsx.hbs +138 -0
  11. package/templates/auth/better-auth/convex/native/uniwind/components/sign-in.tsx.hbs +91 -0
  12. package/templates/auth/better-auth/convex/native/uniwind/components/sign-up.tsx.hbs +102 -0
  13. package/templates/auth/better-auth/native/bare/app/(drawer)/index.tsx.hbs +186 -0
  14. package/templates/auth/better-auth/native/bare/components/sign-in.tsx.hbs +131 -0
  15. package/templates/auth/better-auth/native/bare/components/sign-up.tsx.hbs +150 -0
  16. package/templates/auth/better-auth/native/unistyles/app/(drawer)/index.tsx.hbs +9 -1
  17. package/templates/auth/better-auth/native/unistyles/components/sign-in.tsx.hbs +5 -0
  18. package/templates/auth/better-auth/native/unistyles/components/sign-up.tsx.hbs +5 -0
  19. package/templates/auth/better-auth/native/uniwind/app/(drawer)/index.tsx.hbs +123 -0
  20. package/templates/auth/better-auth/native/uniwind/components/sign-in.tsx.hbs +90 -0
  21. package/templates/auth/better-auth/native/uniwind/components/sign-up.tsx.hbs +116 -0
  22. package/templates/auth/better-auth/server/base/src/index.ts.hbs +5 -5
  23. package/templates/examples/ai/native/bare/app/(drawer)/ai.tsx.hbs +287 -0
  24. package/templates/examples/ai/native/{nativewind → bare}/polyfills.js +1 -0
  25. package/templates/examples/ai/native/{nativewind → uniwind}/app/(drawer)/ai.tsx.hbs +52 -51
  26. package/templates/examples/ai/native/uniwind/polyfills.js +26 -0
  27. package/templates/examples/todo/native/bare/app/(drawer)/todos.tsx.hbs +430 -0
  28. package/templates/examples/todo/native/uniwind/app/(drawer)/todos.tsx.hbs +295 -0
  29. package/templates/extras/bunfig.toml.hbs +3 -3
  30. package/templates/frontend/native/bare/_gitignore +18 -0
  31. package/templates/frontend/native/{nativewind → bare}/app/(drawer)/(tabs)/_layout.tsx.hbs +7 -12
  32. package/templates/frontend/native/bare/app/(drawer)/(tabs)/index.tsx.hbs +43 -0
  33. package/templates/frontend/native/bare/app/(drawer)/(tabs)/two.tsx.hbs +43 -0
  34. package/templates/frontend/native/{nativewind → bare}/app/(drawer)/_layout.tsx.hbs +24 -1
  35. package/templates/frontend/native/bare/app/(drawer)/index.tsx.hbs +234 -0
  36. package/templates/frontend/native/bare/app/+not-found.tsx.hbs +65 -0
  37. package/templates/frontend/native/bare/app/_layout.tsx.hbs +163 -0
  38. package/templates/frontend/native/bare/app/modal.tsx.hbs +34 -0
  39. package/templates/frontend/native/{nativewind → bare}/app.json.hbs +1 -0
  40. package/templates/frontend/native/bare/components/container.tsx.hbs +25 -0
  41. package/templates/frontend/native/bare/components/header-button.tsx.hbs +47 -0
  42. package/templates/frontend/native/{nativewind → bare}/components/tabbar-icon.tsx.hbs +1 -0
  43. package/templates/frontend/native/{nativewind → bare}/lib/android-navigation-bar.tsx.hbs +1 -0
  44. package/templates/frontend/native/{nativewind → bare}/lib/constants.ts.hbs +1 -0
  45. package/templates/frontend/native/bare/lib/use-color-scheme.ts.hbs +20 -0
  46. package/templates/frontend/native/bare/metro.config.js.hbs +9 -0
  47. package/templates/frontend/native/{nativewind → bare}/package.json.hbs +1 -2
  48. package/templates/frontend/native/bare/tsconfig.json.hbs +11 -0
  49. package/templates/frontend/native/{nativewind → uniwind}/_gitignore +4 -8
  50. package/templates/frontend/native/uniwind/app/(drawer)/(tabs)/_layout.tsx.hbs +46 -0
  51. package/templates/frontend/native/uniwind/app/(drawer)/(tabs)/index.tsx.hbs +15 -0
  52. package/templates/frontend/native/uniwind/app/(drawer)/(tabs)/two.tsx.hbs +15 -0
  53. package/templates/frontend/native/uniwind/app/(drawer)/_layout.tsx.hbs +83 -0
  54. package/templates/frontend/native/uniwind/app/(drawer)/index.tsx.hbs +151 -0
  55. package/templates/frontend/native/uniwind/app/+not-found.tsx.hbs +32 -0
  56. package/templates/frontend/native/uniwind/app/_layout.tsx.hbs +131 -0
  57. package/templates/frontend/native/uniwind/app/modal.tsx.hbs +53 -0
  58. package/templates/frontend/native/uniwind/app.json.hbs +19 -0
  59. package/templates/frontend/native/uniwind/components/container.tsx.hbs +33 -0
  60. package/templates/frontend/native/uniwind/components/theme-toggle.tsx.hbs +35 -0
  61. package/templates/frontend/native/uniwind/contexts/app-theme-context.tsx.hbs +62 -0
  62. package/templates/frontend/native/uniwind/global.css +5 -0
  63. package/templates/frontend/native/uniwind/metro.config.js.hbs +13 -0
  64. package/templates/frontend/native/uniwind/package.json.hbs +54 -0
  65. package/templates/frontend/native/{nativewind → uniwind}/tsconfig.json.hbs +4 -8
  66. package/templates/auth/better-auth/convex/native/nativewind/components/sign-in.tsx.hbs +0 -86
  67. package/templates/auth/better-auth/convex/native/nativewind/components/sign-up.tsx.hbs +0 -97
  68. package/templates/auth/better-auth/native/nativewind/app/(drawer)/index.tsx.hbs +0 -95
  69. package/templates/auth/better-auth/native/nativewind/components/sign-in.tsx.hbs +0 -93
  70. package/templates/auth/better-auth/native/nativewind/components/sign-up.tsx.hbs +0 -104
  71. package/templates/examples/todo/native/nativewind/app/(drawer)/todos.tsx.hbs +0 -295
  72. package/templates/frontend/native/nativewind/app/(drawer)/(tabs)/index.tsx.hbs +0 -19
  73. package/templates/frontend/native/nativewind/app/(drawer)/(tabs)/two.tsx.hbs +0 -19
  74. package/templates/frontend/native/nativewind/app/(drawer)/index.tsx.hbs +0 -178
  75. package/templates/frontend/native/nativewind/app/+not-found.tsx.hbs +0 -29
  76. package/templates/frontend/native/nativewind/app/_layout.tsx.hbs +0 -175
  77. package/templates/frontend/native/nativewind/app/modal.tsx.hbs +0 -14
  78. package/templates/frontend/native/nativewind/babel.config.js.hbs +0 -14
  79. package/templates/frontend/native/nativewind/components/container.tsx.hbs +0 -8
  80. package/templates/frontend/native/nativewind/components/header-button.tsx.hbs +0 -26
  81. package/templates/frontend/native/nativewind/global.css +0 -50
  82. package/templates/frontend/native/nativewind/lib/use-color-scheme.ts.hbs +0 -12
  83. package/templates/frontend/native/nativewind/metro.config.js.hbs +0 -12
  84. package/templates/frontend/native/nativewind/tailwind.config.js.hbs +0 -59
@@ -1,175 +0,0 @@
1
- {{#if (includes examples "ai")}}
2
- import "@/polyfills";
3
- {{/if}}
4
- {{#if (eq backend "convex")}}
5
- {{#if (eq auth "better-auth")}}
6
- import { ConvexReactClient } from "convex/react";
7
- import { ConvexBetterAuthProvider } from "@convex-dev/better-auth/react";
8
- import { authClient } from "@/lib/auth-client";
9
- {{else}}
10
- import { ConvexProvider, ConvexReactClient } from "convex/react";
11
- {{/if}}
12
- {{#if (eq auth "clerk")}}
13
- import { ClerkProvider, useAuth } from "@clerk/clerk-expo";
14
- import { ConvexProviderWithClerk } from "convex/react-clerk";
15
- import { tokenCache } from "@clerk/clerk-expo/token-cache";
16
- {{/if}}
17
- {{else}}
18
- {{#unless (eq api "none")}}
19
- import { QueryClientProvider } from "@tanstack/react-query";
20
- {{/unless}}
21
- {{/if}}
22
- import { Stack } from "expo-router";
23
- import {
24
- DarkTheme,
25
- DefaultTheme,
26
- type Theme,
27
- ThemeProvider,
28
- } from "@react-navigation/native";
29
- import { StatusBar } from "expo-status-bar";
30
- import { GestureHandlerRootView } from "react-native-gesture-handler";
31
- import "../global.css";
32
- {{#if (eq api "trpc")}}
33
- import { queryClient } from "@/utils/trpc";
34
- {{/if}}
35
- {{#if (eq api "orpc")}}
36
- import { queryClient } from "@/utils/orpc";
37
- {{/if}}
38
- import { NAV_THEME } from "@/lib/constants";
39
- import React, { useRef } from "react";
40
- import { useColorScheme } from "@/lib/use-color-scheme";
41
- import { Platform } from "react-native";
42
- import { setAndroidNavigationBar } from "@/lib/android-navigation-bar";
43
-
44
- const LIGHT_THEME: Theme = {
45
- ...DefaultTheme,
46
- colors: NAV_THEME.light,
47
- };
48
- const DARK_THEME: Theme = {
49
- ...DarkTheme,
50
- colors: NAV_THEME.dark,
51
- };
52
-
53
- export const unstable_settings = {
54
- initialRouteName: "(drawer)",
55
- };
56
-
57
- {{#if (eq backend "convex")}}
58
- const convex = new ConvexReactClient(process.env.EXPO_PUBLIC_CONVEX_URL!, {
59
- unsavedChangesWarning: false,
60
- });
61
- {{/if}}
62
-
63
- export default function RootLayout() {
64
- const hasMounted = useRef(false);
65
- const { colorScheme, isDarkColorScheme } = useColorScheme();
66
- const [isColorSchemeLoaded, setIsColorSchemeLoaded] = React.useState(false);
67
-
68
- useIsomorphicLayoutEffect(() => {
69
- if (hasMounted.current) {
70
- return;
71
- }
72
-
73
- if (Platform.OS === "web") {
74
- document.documentElement.classList.add("bg-background");
75
- }
76
- setAndroidNavigationBar(colorScheme);
77
- setIsColorSchemeLoaded(true);
78
- hasMounted.current = true;
79
- }, []);
80
-
81
- if (!isColorSchemeLoaded) {
82
- return null;
83
- }
84
- return (
85
- {{#if (eq backend "convex")}}
86
- {{#if (eq auth "clerk")}}
87
- <ClerkProvider
88
- tokenCache={tokenCache}
89
- publishableKey={process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY}
90
- >
91
- <ConvexProviderWithClerk client={convex} useAuth={useAuth}>
92
- <ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
93
- <StatusBar style={isDarkColorScheme ? "light" : "dark"} />
94
- <GestureHandlerRootView style=\{{ flex: 1 }}>
95
- <Stack>
96
- <Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
97
- <Stack.Screen name="(auth)" options=\{{ headerShown: false }} />
98
- <Stack.Screen
99
- name="modal"
100
- options=\{{ title: "Modal", presentation: "modal" }}
101
- />
102
- </Stack>
103
- </GestureHandlerRootView>
104
- </ThemeProvider>
105
- </ConvexProviderWithClerk>
106
- </ClerkProvider>
107
- {{else if (eq auth "better-auth")}}
108
- <ConvexBetterAuthProvider client={convex} authClient={authClient}>
109
- <ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
110
- <StatusBar style={isDarkColorScheme ? "light" : "dark"} />
111
- <GestureHandlerRootView style=\{{ flex: 1 }}>
112
- <Stack>
113
- <Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
114
- <Stack.Screen
115
- name="modal"
116
- options=\{{ title: "Modal", presentation: "modal" }}
117
- />
118
- </Stack>
119
- </GestureHandlerRootView>
120
- </ThemeProvider>
121
- </ConvexBetterAuthProvider>
122
- {{else}}
123
- <ConvexProvider client={convex}>
124
- <ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
125
- <StatusBar style={isDarkColorScheme ? "light" : "dark"} />
126
- <GestureHandlerRootView style=\{{ flex: 1 }}>
127
- <Stack>
128
- <Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
129
- <Stack.Screen
130
- name="modal"
131
- options=\{{ title: "Modal", presentation: "modal" }}
132
- />
133
- </Stack>
134
- </GestureHandlerRootView>
135
- </ThemeProvider>
136
- </ConvexProvider>
137
- {{/if}}
138
- {{else}}
139
- {{#unless (eq api "none")}}
140
- <QueryClientProvider client={queryClient}>
141
- <ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
142
- <StatusBar style={isDarkColorScheme ? "light" : "dark"} />
143
- <GestureHandlerRootView style=\{{ flex: 1 }}>
144
- <Stack>
145
- <Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
146
- <Stack.Screen
147
- name="modal"
148
- options=\{{ title: "Modal", presentation: "modal" }}
149
- />
150
- </Stack>
151
- </GestureHandlerRootView>
152
- </ThemeProvider>
153
- </QueryClientProvider>
154
- {{else}}
155
- <ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
156
- <StatusBar style={isDarkColorScheme ? "light" : "dark"} />
157
- <GestureHandlerRootView style=\{{ flex: 1 }}>
158
- <Stack>
159
- <Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
160
- <Stack.Screen
161
- name="modal"
162
- options=\{{ title: "Modal", presentation: "modal" }}
163
- />
164
- </Stack>
165
- </GestureHandlerRootView>
166
- </ThemeProvider>
167
- {{/unless}}
168
- {{/if}}
169
- );
170
- }
171
-
172
- const useIsomorphicLayoutEffect =
173
- Platform.OS === "web" && typeof window === "undefined"
174
- ? React.useEffect
175
- : React.useLayoutEffect;
@@ -1,14 +0,0 @@
1
- import { Container } from "@/components/container";
2
- import { Text, View } from "react-native";
3
-
4
- export default function Modal() {
5
- return (
6
- <Container>
7
- <View className="flex-1 p-6">
8
- <View className="flex-row items-center justify-between mb-8">
9
- <Text className="text-2xl font-bold text-foreground">Modal</Text>
10
- </View>
11
- </View>
12
- </Container>
13
- );
14
- }
@@ -1,14 +0,0 @@
1
- module.exports = (api) => {
2
- api.cache(true);
3
- const plugins = [];
4
-
5
- plugins.push("react-native-worklets/plugin");
6
-
7
- return {
8
- presets: [
9
- ["babel-preset-expo", { jsxImportSource: "nativewind" }],
10
- "nativewind/babel",
11
- ],
12
- plugins,
13
- };
14
- };
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { SafeAreaView } from "react-native-safe-area-context";
3
-
4
- export const Container = ({ children }: { children: React.ReactNode }) => {
5
- return (
6
- <SafeAreaView className="flex-1 bg-background">{children}</SafeAreaView>
7
- );
8
- };
@@ -1,26 +0,0 @@
1
- import FontAwesome from "@expo/vector-icons/FontAwesome";
2
- import { forwardRef } from "react";
3
- import { Pressable } from "react-native";
4
-
5
- export const HeaderButton = forwardRef<
6
- typeof Pressable,
7
- { onPress?: () => void }
8
- >(({ onPress }, ref) => {
9
- return (
10
- <Pressable
11
- onPress={onPress}
12
- className="p-2 mr-2 rounded-lg bg-secondary/50 active:bg-secondary"
13
- >
14
- {({ pressed }) => (
15
- <FontAwesome
16
- name="info-circle"
17
- size={20}
18
- className="text-secondary-foreground"
19
- style=\{{
20
- opacity: pressed ? 0.7 : 1,
21
- }}
22
- />
23
- )}
24
- </Pressable>
25
- );
26
- });
@@ -1,50 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- @layer base {
6
- :root {
7
- --background: 0 0% 100%;
8
- --foreground: 222.2 84% 4.9%;
9
- --card: 0 0% 100%;
10
- --card-foreground: 222.2 84% 4.9%;
11
- --popover: 0 0% 100%;
12
- --popover-foreground: 222.2 84% 4.9%;
13
- --primary: 221.2 83.2% 53.3%;
14
- --primary-foreground: 210 40% 98%;
15
- --secondary: 210 40% 96%;
16
- --secondary-foreground: 222.2 84% 4.9%;
17
- --muted: 210 40% 96%;
18
- --muted-foreground: 215.4 16.3% 40%;
19
- --accent: 210 40% 96%;
20
- --accent-foreground: 222.2 84% 4.9%;
21
- --destructive: 0 84.2% 60.2%;
22
- --destructive-foreground: 210 40% 98%;
23
- --border: 214.3 31.8% 91.4%;
24
- --input: 214.3 31.8% 91.4%;
25
- --ring: 221.2 83.2% 53.3%;
26
- --radius: 8px;
27
- }
28
-
29
- .dark:root {
30
- --background: 222.2 84% 4.9%;
31
- --foreground: 210 40% 98%;
32
- --card: 222.2 84% 4.9%;
33
- --card-foreground: 210 40% 98%;
34
- --popover: 222.2 84% 4.9%;
35
- --popover-foreground: 210 40% 98%;
36
- --primary: 217.2 91.2% 59.8%;
37
- --primary-foreground: 222.2 84% 4.9%;
38
- --secondary: 217.2 32.6% 17.5%;
39
- --secondary-foreground: 210 40% 98%;
40
- --muted: 217.2 32.6% 17.5%;
41
- --muted-foreground: 215 20.2% 70%;
42
- --accent: 217.2 32.6% 17.5%;
43
- --accent-foreground: 210 40% 98%;
44
- --destructive: 0 72% 51%;
45
- --destructive-foreground: 210 40% 98%;
46
- --border: 217.2 32.6% 17.5%;
47
- --input: 217.2 32.6% 17.5%;
48
- --ring: 224.3 76.3% 94.1%;
49
- }
50
- }
@@ -1,12 +0,0 @@
1
- import { useColorScheme as useNativewindColorScheme } from "nativewind";
2
-
3
- export function useColorScheme() {
4
- const { colorScheme, setColorScheme, toggleColorScheme } =
5
- useNativewindColorScheme();
6
- return {
7
- colorScheme: colorScheme ?? "dark",
8
- isDarkColorScheme: colorScheme === "dark",
9
- setColorScheme,
10
- toggleColorScheme,
11
- };
12
- }
@@ -1,12 +0,0 @@
1
- // Learn more https://docs.expo.io/guides/customizing-metro
2
- const { getDefaultConfig } = require("expo/metro-config");
3
- const { withNativeWind } = require("nativewind/metro");
4
-
5
- const config = withNativeWind(getDefaultConfig(__dirname), {
6
- input: "./global.css",
7
- configPath: "./tailwind.config.js",
8
- });
9
-
10
- config.resolver.unstable_enablePackageExports = true;
11
-
12
- module.exports = config;
@@ -1,59 +0,0 @@
1
- import { hairlineWidth } from "nativewind/theme";
2
-
3
- /** @type {import('tailwindcss').Config} */
4
- export const darkMode = "class";
5
- export const content = [
6
- "./app/**/*.{js,ts,tsx}",
7
- "./components/**/*.{js,ts,tsx}",
8
- ];
9
- export const presets = [require("nativewind/preset")];
10
- export const theme = {
11
- extend: {
12
- colors: {
13
- background: "hsl(var(--background))",
14
- foreground: "hsl(var(--foreground))",
15
- card: {
16
- DEFAULT: "hsl(var(--card))",
17
- foreground: "hsl(var(--card-foreground))",
18
- },
19
- popover: {
20
- DEFAULT: "hsl(var(--popover))",
21
- foreground: "hsl(var(--popover-foreground))",
22
- },
23
- primary: {
24
- DEFAULT: "hsl(var(--primary))",
25
- foreground: "hsl(var(--primary-foreground))",
26
- },
27
- secondary: {
28
- DEFAULT: "hsl(var(--secondary))",
29
- foreground: "hsl(var(--secondary-foreground))",
30
- },
31
- muted: {
32
- DEFAULT: "hsl(var(--muted))",
33
- foreground: "hsl(var(--muted-foreground))",
34
- },
35
- accent: {
36
- DEFAULT: "hsl(var(--accent))",
37
- foreground: "hsl(var(--accent-foreground))",
38
- },
39
- destructive: {
40
- DEFAULT: "hsl(var(--destructive))",
41
- foreground: "hsl(var(--destructive-foreground))",
42
- },
43
- border: "hsl(var(--border))",
44
- input: "hsl(var(--input))",
45
- ring: "hsl(var(--ring))",
46
- radius: "var(--radius)",
47
- },
48
- borderRadius: {
49
- xl: "calc(var(--radius) + 4px)",
50
- lg: "var(--radius)",
51
- md: "calc(var(--radius) - 2px)",
52
- sm: "calc(var(--radius) - 4px)",
53
- },
54
- borderWidth: {
55
- hairline: hairlineWidth(),
56
- },
57
- },
58
- };
59
- export const plugins = [];