create-100x-mobile 0.4.10 → 0.5.0

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.
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.magicTabsLayoutTemplate = magicTabsLayoutTemplate;
4
+ function magicTabsLayoutTemplate() {
5
+ return `import { Tabs, Redirect } from "expo-router";
6
+ import { SquareCheck as CheckSquare, Settings } from "lucide-react-native";
7
+ import { Platform, StyleSheet, Text, View } from "react-native";
8
+ import { instantDb } from "@/lib/instant";
9
+
10
+ function SetupRequired() {
11
+ return (
12
+ <View style={styles.setupContainer}>
13
+ <View style={styles.setupCard}>
14
+ <Text style={styles.setupTitle}>Setup Required</Text>
15
+ <Text style={styles.setupText}>
16
+ Add EXPO_PUBLIC_INSTANT_APP_ID to your .env.local file.
17
+ </Text>
18
+ <Text style={styles.setupStep}>
19
+ You can create an app id with:\n
20
+ npx instant-cli init-without-files --title my-app
21
+ </Text>
22
+ </View>
23
+ </View>
24
+ );
25
+ }
26
+
27
+ function AuthenticatedTabsLayout({
28
+ db,
29
+ }: {
30
+ db: NonNullable<typeof instantDb>;
31
+ }) {
32
+ const { isLoading, user, error } = db.useAuth();
33
+
34
+ if (isLoading) {
35
+ return null;
36
+ }
37
+
38
+ if (error) {
39
+ return null;
40
+ }
41
+
42
+ if (!user) {
43
+ return <Redirect href="/(auth)/sign-in" />;
44
+ }
45
+
46
+ return (
47
+ <Tabs
48
+ screenOptions={{
49
+ headerShown: false,
50
+ tabBarStyle: {
51
+ backgroundColor: "#FFFFFF",
52
+ borderTopWidth: 0,
53
+ elevation: 0,
54
+ shadowOpacity: 0,
55
+ height: Platform.OS === "ios" ? 88 : 72,
56
+ paddingBottom: Platform.OS === "ios" ? 32 : 12,
57
+ paddingTop: 12,
58
+ },
59
+ tabBarActiveTintColor: "#1F2937",
60
+ tabBarInactiveTintColor: "#9CA3AF",
61
+ tabBarLabelStyle: {
62
+ fontSize: 13,
63
+ fontWeight: "500",
64
+ marginTop: 4,
65
+ },
66
+ }}
67
+ >
68
+ <Tabs.Screen
69
+ name="index"
70
+ options={{
71
+ title: "Todos",
72
+ tabBarIcon: ({ size, color }) => (
73
+ <CheckSquare size={size} color={color} strokeWidth={2} />
74
+ ),
75
+ }}
76
+ />
77
+ <Tabs.Screen
78
+ name="settings"
79
+ options={{
80
+ title: "Settings",
81
+ tabBarIcon: ({ size, color }) => (
82
+ <Settings size={size} color={color} strokeWidth={2} />
83
+ ),
84
+ }}
85
+ />
86
+ </Tabs>
87
+ );
88
+ }
89
+
90
+ export default function TabLayout() {
91
+ if (!instantDb) {
92
+ return <SetupRequired />;
93
+ }
94
+
95
+ return <AuthenticatedTabsLayout db={instantDb} />;
96
+ }
97
+
98
+ const styles = StyleSheet.create({
99
+ setupContainer: {
100
+ flex: 1,
101
+ backgroundColor: "#f5f5f5",
102
+ justifyContent: "center",
103
+ alignItems: "center",
104
+ padding: 20,
105
+ },
106
+ setupCard: {
107
+ backgroundColor: "#fff",
108
+ borderRadius: 12,
109
+ padding: 24,
110
+ maxWidth: 420,
111
+ width: "100%",
112
+ shadowColor: "#000",
113
+ shadowOffset: { width: 0, height: 2 },
114
+ shadowOpacity: 0.1,
115
+ shadowRadius: 8,
116
+ elevation: 3,
117
+ },
118
+ setupTitle: {
119
+ fontSize: 24,
120
+ fontWeight: "700",
121
+ color: "#333",
122
+ marginBottom: 16,
123
+ textAlign: "center",
124
+ },
125
+ setupText: {
126
+ fontSize: 16,
127
+ color: "#666",
128
+ marginBottom: 12,
129
+ lineHeight: 22,
130
+ textAlign: "center",
131
+ },
132
+ setupStep: {
133
+ fontSize: 14,
134
+ color: "#888",
135
+ marginTop: 16,
136
+ padding: 16,
137
+ backgroundColor: "#f8f9fa",
138
+ borderRadius: 8,
139
+ lineHeight: 20,
140
+ },
141
+ });
142
+ `;
143
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-100x-mobile",
3
- "version": "0.4.10",
3
+ "version": "0.5.0",
4
4
  "description": "Scaffold a full-stack mobile app with Expo + Convex + Clerk in seconds",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -11,7 +11,7 @@
11
11
  "build": "npm run clean && tsc",
12
12
  "dev": "tsc --watch",
13
13
  "typecheck": "tsc --noEmit",
14
- "test": "npm run build && node --test tests/**/*.test.cjs",
14
+ "test": "vitest run",
15
15
  "check": "npm run typecheck && npm test && npm pack --dry-run",
16
16
  "prepublishOnly": "npm run check"
17
17
  },
@@ -35,6 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^22.0.0",
38
- "typescript": "~5.7.0"
38
+ "typescript": "~5.7.0",
39
+ "vitest": "1.3.1"
39
40
  }
40
41
  }