create-croissant 0.1.44 → 0.1.45

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 (38) hide show
  1. package/package.json +1 -1
  2. package/template/.expo/README.md +13 -0
  3. package/template/.expo/devices.json +3 -0
  4. package/template/apps/desktop/.eslintcache +1 -0
  5. package/template/apps/mobile/app/(tabs)/_layout.tsx +21 -14
  6. package/template/apps/mobile/app/(tabs)/account.tsx +147 -0
  7. package/template/apps/mobile/app/(tabs)/explore.tsx +334 -104
  8. package/template/apps/mobile/app/(tabs)/index.tsx +99 -97
  9. package/template/apps/mobile/app/_layout.tsx +26 -7
  10. package/template/apps/mobile/app/index.tsx +136 -0
  11. package/template/apps/mobile/app/login.tsx +135 -0
  12. package/template/apps/mobile/app/signup.tsx +144 -0
  13. package/template/apps/mobile/app.json +3 -3
  14. package/template/apps/mobile/components/ui/button.tsx +86 -0
  15. package/template/apps/mobile/components/ui/input.tsx +56 -0
  16. package/template/apps/mobile/lib/orpc.ts +23 -0
  17. package/template/apps/mobile/package.json +13 -1
  18. package/template/apps/mobile/tsconfig.json +4 -1
  19. package/template/apps/platform/package.json +2 -1
  20. package/template/apps/platform/src/components/login-form.tsx +5 -4
  21. package/template/apps/platform/src/components/signup-form.tsx +12 -16
  22. package/template/apps/platform/src/routes/__root.tsx +6 -2
  23. package/template/apps/platform/src/routes/_auth/account.tsx +13 -17
  24. package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +2 -6
  25. package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +16 -29
  26. package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +10 -14
  27. package/template/apps/platform/src/routes/api/auth/$.ts +23 -2
  28. package/template/apps/platform/src/routes/api/rpc.$.ts +18 -0
  29. package/template/package.json +2 -2
  30. package/template/packages/orpc/package.json +7 -1
  31. package/template/packages/orpc/src/lib/planets.ts +18 -18
  32. package/template/packages/orpc/src/lib/router.ts +3 -3
  33. package/template/packages/orpc/src/react/context.tsx +23 -0
  34. package/template/packages/orpc/src/react/general.ts +29 -0
  35. package/template/packages/orpc/src/react/index.ts +3 -0
  36. package/template/packages/orpc/src/react/planets.ts +90 -0
  37. package/template/tsconfig.json +2 -1
  38. package/template/apps/mobile/app/modal.tsx +0 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-croissant",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Scaffold a new project using the Croissant Stack",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,13 @@
1
+ > Why do I have a folder named ".expo" in my project?
2
+
3
+ The ".expo" folder is created when an Expo project is started using "expo start" command.
4
+
5
+ > What do the files contain?
6
+
7
+ - "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
8
+ - "settings.json": contains the server configuration that is used to serve the application manifest.
9
+
10
+ > Should I commit the ".expo" folder?
11
+
12
+ No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
13
+ Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
@@ -0,0 +1,3 @@
1
+ {
2
+ "devices": []
3
+ }
@@ -0,0 +1 @@
1
+ [{"/Users/sam/Dev/croissant-stack/apps/desktop/electron.vite.config.ts":"1","/Users/sam/Dev/croissant-stack/apps/desktop/src/main/index.ts":"2","/Users/sam/Dev/croissant-stack/apps/desktop/src/preload/index.d.ts":"3","/Users/sam/Dev/croissant-stack/apps/desktop/src/preload/index.ts":"4","/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/App.tsx":"5","/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/components/Versions.tsx":"6","/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/env.d.ts":"7","/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/main.tsx":"8","/Users/sam/Dev/croissant-stack/apps/desktop/out/main/index.js":"9","/Users/sam/Dev/croissant-stack/apps/desktop/out/preload/index.js":"10","/Users/sam/Dev/croissant-stack/apps/desktop/eslint.config.ts":"11","/Users/sam/Dev/croissant-stack/apps/desktop/prettier.config.ts":"12"},{"size":318,"mtime":1777164701886,"results":"13","hashOfConfig":"14"},{"size":2424,"mtime":1777164701886,"results":"15","hashOfConfig":"14"},{"size":149,"mtime":1777164701886,"results":"16","hashOfConfig":"14"},{"size":611,"mtime":1777163425865,"results":"17","hashOfConfig":"14"},{"size":1047,"mtime":1777163425865,"results":"18","hashOfConfig":"14"},{"size":428,"mtime":1777163425866,"results":"19","hashOfConfig":"14"},{"size":38,"mtime":1777163425866,"results":"20","hashOfConfig":"14"},{"size":232,"mtime":1777163425866,"results":"21","hashOfConfig":"14"},{"size":1579,"mtime":1777164321368,"results":"22","hashOfConfig":"23"},{"size":477,"mtime":1777164321388,"results":"24","hashOfConfig":"23"},{"size":239,"mtime":1777245470570,"results":"25","hashOfConfig":"14"},{"size":71,"mtime":1777165267271,"results":"26","hashOfConfig":"14"},{"filePath":"27","messages":"28","suppressedMessages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"19x1ah4",{"filePath":"30","messages":"31","suppressedMessages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","suppressedMessages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","suppressedMessages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","suppressedMessages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","suppressedMessages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","suppressedMessages":"53","errorCount":1,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"7zths6",{"filePath":"54","messages":"55","suppressedMessages":"56","errorCount":1,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"57","messages":"58","suppressedMessages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","suppressedMessages":"62","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/sam/Dev/croissant-stack/apps/desktop/electron.vite.config.ts",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/src/main/index.ts",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/src/preload/index.d.ts",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/src/preload/index.ts",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/App.tsx",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/components/Versions.tsx",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/env.d.ts",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/src/renderer/src/main.tsx",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/out/main/index.js",["63"],[],"/Users/sam/Dev/croissant-stack/apps/desktop/out/preload/index.js",["64"],[],"/Users/sam/Dev/croissant-stack/apps/desktop/eslint.config.ts",[],[],"/Users/sam/Dev/croissant-stack/apps/desktop/prettier.config.ts",[],[],{"ruleId":null,"nodeType":null,"fatal":true,"severity":2,"message":"65"},{"ruleId":null,"nodeType":null,"fatal":true,"severity":2,"message":"66"},"Parsing error: /Users/sam/Dev/croissant-stack/apps/desktop/out/main/index.js was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.\nallowDefaultProject is set to [\"*.js\",\"*.mjs\"], which does not match 'out/main/index.js'.","Parsing error: /Users/sam/Dev/croissant-stack/apps/desktop/out/preload/index.js was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.\nallowDefaultProject is set to [\"*.js\",\"*.mjs\"], which does not match 'out/preload/index.js'."]
@@ -1,34 +1,41 @@
1
- import { Tabs } from "expo-router";
2
1
  import React from "react";
3
-
4
- import { HapticTab } from "@/components/haptic-tab";
5
- import { IconSymbol } from "@/components/ui/icon-symbol";
6
- import { Colors } from "@/constants/theme";
7
- import { useColorScheme } from "@/hooks/use-color-scheme";
2
+ import { Tabs } from "expo-router";
3
+ import { Ionicons } from "@expo/vector-icons";
8
4
 
9
5
  export default function TabLayout() {
10
- const colorScheme = useColorScheme();
11
-
12
6
  return (
13
7
  <Tabs
14
8
  screenOptions={{
15
- tabBarActiveTintColor: Colors[colorScheme ?? "light"].tint,
16
- headerShown: false,
17
- tabBarButton: HapticTab,
9
+ tabBarActiveTintColor: "#000",
10
+ tabBarInactiveTintColor: "#888",
11
+ headerShown: true,
18
12
  }}
19
13
  >
20
14
  <Tabs.Screen
21
15
  name="index"
22
16
  options={{
23
- title: "Home",
24
- tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
17
+ title: "Dashboard",
18
+ tabBarIcon: ({ color, size }) => (
19
+ <Ionicons name="home" size={size} color={color} />
20
+ ),
25
21
  }}
26
22
  />
27
23
  <Tabs.Screen
28
24
  name="explore"
29
25
  options={{
30
26
  title: "Explore",
31
- tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
27
+ tabBarIcon: ({ color, size }) => (
28
+ <Ionicons name="planet" size={size} color={color} />
29
+ ),
30
+ }}
31
+ />
32
+ <Tabs.Screen
33
+ name="account"
34
+ options={{
35
+ title: "Account",
36
+ tabBarIcon: ({ color, size }) => (
37
+ <Ionicons name="person" size={size} color={color} />
38
+ ),
32
39
  }}
33
40
  />
34
41
  </Tabs>
@@ -0,0 +1,147 @@
1
+ import { useState, useEffect } from "react";
2
+ import { View, Text, StyleSheet, ScrollView, Alert, ActivityIndicator } from "react-native";
3
+ import { useRouter } from "expo-router";
4
+ import { authClient } from "@/lib/auth-client";
5
+ import { Button } from "@/components/ui/button";
6
+ import { Input } from "@/components/ui/input";
7
+
8
+ export default function AccountScreen() {
9
+ const router = useRouter();
10
+ const { data: session, isPending } = authClient.useSession();
11
+ const [updating, setUpdating] = useState(false);
12
+
13
+ // Form states
14
+ const [name, setName] = useState("");
15
+ const [email, setEmail] = useState("");
16
+
17
+ useEffect(() => {
18
+ if (!isPending && !session) {
19
+ router.replace("/login");
20
+ return;
21
+ }
22
+
23
+ if (session) {
24
+ setName(session.user.name);
25
+ setEmail(session.user.email);
26
+ }
27
+ }, [session, isPending, router]);
28
+
29
+ const handleUpdateProfile = async () => {
30
+ if (!name) {
31
+ Alert.alert("Error", "Name is required");
32
+ return;
33
+ }
34
+
35
+ setUpdating(true);
36
+ try {
37
+ const { error } = await authClient.updateUser({
38
+ name,
39
+ });
40
+
41
+ if (error) {
42
+ Alert.alert("Error", error.message || "Failed to update profile");
43
+ } else {
44
+ Alert.alert("Success", "Profile updated successfully");
45
+ }
46
+ } catch (err) {
47
+ Alert.alert("Error", "An unexpected error occurred");
48
+ } finally {
49
+ setUpdating(false);
50
+ }
51
+ };
52
+
53
+ if (isPending) {
54
+ return (
55
+ <View style={styles.center}>
56
+ <ActivityIndicator size="large" color="#000" />
57
+ </View>
58
+ );
59
+ }
60
+
61
+ return (
62
+ <ScrollView style={styles.container} contentContainerStyle={styles.content}>
63
+ <Text style={styles.title}>Account Settings</Text>
64
+
65
+ <View style={styles.section}>
66
+ <Text style={styles.sectionTitle}>Profile Information</Text>
67
+ <View style={styles.form}>
68
+ <Input
69
+ label="Name"
70
+ value={name}
71
+ onChangeText={setName}
72
+ placeholder="Your name"
73
+ />
74
+ <Input
75
+ label="Email"
76
+ value={email}
77
+ editable={false}
78
+ style={styles.disabledInput}
79
+ />
80
+ <Button
81
+ onPress={handleUpdateProfile}
82
+ loading={updating}
83
+ style={styles.button}
84
+ >
85
+ Update Profile
86
+ </Button>
87
+ </View>
88
+ </View>
89
+
90
+ <View style={styles.section}>
91
+ <Text style={styles.sectionTitle}>Security</Text>
92
+ <Text style={styles.infoText}>
93
+ Password management and other security settings are currently available on the web platform.
94
+ </Text>
95
+ </View>
96
+ </ScrollView>
97
+ );
98
+ }
99
+
100
+ const styles = StyleSheet.create({
101
+ container: {
102
+ flex: 1,
103
+ backgroundColor: "#fff",
104
+ },
105
+ content: {
106
+ padding: 24,
107
+ },
108
+ center: {
109
+ flex: 1,
110
+ justifyContent: "center",
111
+ alignItems: "center",
112
+ },
113
+ title: {
114
+ fontSize: 28,
115
+ fontWeight: "bold",
116
+ marginBottom: 24,
117
+ },
118
+ section: {
119
+ marginBottom: 32,
120
+ },
121
+ sectionTitle: {
122
+ fontSize: 18,
123
+ fontWeight: "600",
124
+ marginBottom: 16,
125
+ color: "#333",
126
+ },
127
+ form: {
128
+ gap: 16,
129
+ },
130
+ disabledInput: {
131
+ backgroundColor: "#f5f5f5",
132
+ color: "#888",
133
+ },
134
+ button: {
135
+ marginTop: 8,
136
+ },
137
+ infoText: {
138
+ fontSize: 14,
139
+ color: "#666",
140
+ lineHeight: 20,
141
+ backgroundColor: "#f9f9f9",
142
+ padding: 16,
143
+ borderRadius: 8,
144
+ borderWidth: 1,
145
+ borderColor: "#eee",
146
+ },
147
+ });