@idealyst/cli 1.0.52 → 1.0.54

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 (31) hide show
  1. package/dist/generators/fullstack.js +0 -11
  2. package/dist/generators/fullstack.js.map +1 -1
  3. package/dist/generators/utils.js +3 -2
  4. package/dist/generators/utils.js.map +1 -1
  5. package/dist/templates/native/src/App-with-trpc-and-shared.tsx +36 -0
  6. package/dist/templates/native/src/App-with-trpc.tsx +3 -26
  7. package/dist/templates/native/src/App.tsx +5 -10
  8. package/dist/templates/native/src/navigation/AppRouter.tsx +121 -0
  9. package/dist/templates/shared/src/index.ts +3 -0
  10. package/dist/templates/shared/src/navigation/AppRouter.tsx +93 -0
  11. package/dist/templates/web/src/App-with-trpc-and-shared.tsx +32 -10
  12. package/dist/templates/web/src/App-with-trpc.tsx +4 -33
  13. package/dist/templates/web/src/App.tsx +2 -2
  14. package/dist/templates/web/src/navigation/AppRouter.tsx +121 -0
  15. package/dist/templates/web/src/navigation/AppRouterWithTrpc.tsx +117 -0
  16. package/dist/templates/web/vite.config.ts +10 -2
  17. package/package.json +1 -1
  18. package/templates/native/src/App-with-trpc-and-shared.tsx +31 -0
  19. package/templates/native/src/App-with-trpc.tsx +14 -42
  20. package/templates/native/src/App.tsx +5 -10
  21. package/templates/native/src/navigation/AppRouter.tsx +121 -0
  22. package/templates/shared/package.json +2 -1
  23. package/templates/shared/src/index.ts +3 -0
  24. package/templates/shared/src/navigation/AppRouter.tsx +93 -0
  25. package/templates/shared/src/trpc/client.ts +12 -7
  26. package/templates/web/src/App-with-trpc-and-shared.tsx +27 -10
  27. package/templates/web/src/App-with-trpc.tsx +14 -48
  28. package/templates/web/src/App.tsx +2 -2
  29. package/templates/web/src/navigation/AppRouter.tsx +121 -0
  30. package/templates/web/src/navigation/AppRouterWithTrpc.tsx +117 -0
  31. package/templates/web/vite.config.ts +10 -2
@@ -0,0 +1,121 @@
1
+ import React from 'react';
2
+ import { RouteParam } from '@idealyst/navigation';
3
+ import { Screen, Text, View, Icon } from '@idealyst/components';
4
+
5
+ // Simple API test component for web-only projects
6
+ const ApiTest = () => {
7
+ const [result, setResult] = React.useState<string>('Click to test API');
8
+
9
+ const testApi = async () => {
10
+ try {
11
+ setResult('Testing...');
12
+ // Simple fetch test - replace with actual API endpoint
13
+ const response = await fetch('/api/test');
14
+ if (response.ok) {
15
+ setResult('✅ API connection successful!');
16
+ } else {
17
+ setResult('❌ API connection failed');
18
+ }
19
+ } catch (error) {
20
+ setResult('❌ API connection failed');
21
+ }
22
+ };
23
+
24
+ return (
25
+ <View spacing="sm">
26
+ <Text size="small">{result}</Text>
27
+ <button onClick={testApi} style={{ padding: '8px 16px', marginTop: '8px' }}>
28
+ Test API
29
+ </button>
30
+ </View>
31
+ );
32
+ };
33
+
34
+ const HomeScreen = () => (
35
+ <Screen>
36
+ <View spacing="lg">
37
+ <Text size="xlarge" weight="bold">Home</Text>
38
+ <Text size="medium">Welcome to your {{projectName}} app!</Text>
39
+ <View spacing="md" style={{ marginTop: 24 }}>
40
+ <Text size="small">
41
+ This app uses tab navigation. Navigate between tabs using the top bar or menu.
42
+ </Text>
43
+ </View>
44
+
45
+ {/* API Testing Component */}
46
+ <View spacing="md" style={{ marginTop: 32 }}>
47
+ <Text size="medium" weight="semibold">API Test</Text>
48
+ <ApiTest />
49
+ </View>
50
+ </View>
51
+ </Screen>
52
+ );
53
+
54
+ const ProfileScreen = () => (
55
+ <Screen>
56
+ <View spacing="lg">
57
+ <Text size="xlarge" weight="bold">Profile</Text>
58
+ <Text size="medium">User profile and account settings</Text>
59
+ <View spacing="md" style={{ marginTop: 24 }}>
60
+ <Text size="small">
61
+ Manage your account details and preferences here.
62
+ </Text>
63
+ </View>
64
+ </View>
65
+ </Screen>
66
+ );
67
+
68
+ const SettingsScreen = () => (
69
+ <Screen>
70
+ <View spacing="lg">
71
+ <Text size="xlarge" weight="bold">Settings</Text>
72
+ <Text size="medium">App configuration and preferences</Text>
73
+ <View spacing="md" style={{ marginTop: 24 }}>
74
+ <Text size="small">
75
+ Customize your app experience with various settings and options.
76
+ </Text>
77
+ </View>
78
+ </View>
79
+ </Screen>
80
+ );
81
+
82
+ const AppRouter: RouteParam = {
83
+ path: "/",
84
+ component: HomeScreen,
85
+ layout: {
86
+ type: "tab",
87
+ },
88
+ screenOptions: {
89
+ title: 'Home',
90
+ tabBarLabel: 'Home',
91
+ tabBarIcon: ({ focused, size }) => (
92
+ <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
93
+ ),
94
+ },
95
+ routes: [
96
+ {
97
+ path: "profile",
98
+ component: ProfileScreen,
99
+ screenOptions: {
100
+ title: 'Profile',
101
+ tabBarLabel: 'Profile',
102
+ tabBarIcon: ({ focused, size }) => (
103
+ <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
104
+ ),
105
+ },
106
+ },
107
+ {
108
+ path: "settings",
109
+ component: SettingsScreen,
110
+ screenOptions: {
111
+ title: 'Settings',
112
+ tabBarLabel: 'Settings',
113
+ tabBarIcon: ({ focused, size }) => (
114
+ <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
115
+ ),
116
+ },
117
+ },
118
+ ],
119
+ };
120
+
121
+ export default AppRouter;
@@ -0,0 +1,117 @@
1
+ import React from 'react';
2
+ import { RouteParam } from '@idealyst/navigation';
3
+ import { Screen, Text, View, Icon, Button } from '@idealyst/components';
4
+ import { trpc } from '../utils/trpc';
5
+
6
+ const HomeScreen = () => {
7
+ // Example tRPC usage
8
+ const [name, setName] = React.useState('{{projectName}}');
9
+ const { data, isLoading, error, refetch } = trpc.hello.useQuery({ name });
10
+
11
+ return (
12
+ <Screen>
13
+ <View spacing="lg">
14
+ <Text size="xlarge" weight="bold">Home</Text>
15
+ <Text size="medium">Welcome to your {{projectName}} app!</Text>
16
+ <View spacing="md" style={{ marginTop: 24 }}>
17
+ <Text size="small">
18
+ This app uses tab navigation with tRPC integration. Navigate between tabs using the top bar or menu.
19
+ </Text>
20
+
21
+ {/* tRPC API Test */}
22
+ <View spacing="sm" style={{ marginTop: 20 }}>
23
+ <Text size="medium" weight="semibold">API Test (tRPC):</Text>
24
+ <View spacing="xs">
25
+ <input
26
+ type="text"
27
+ value={name}
28
+ onChange={(e) => setName(e.target.value)}
29
+ placeholder="Enter your name"
30
+ style={{ padding: '8px', border: '1px solid #ccc', borderRadius: '4px' }}
31
+ />
32
+ <Button variant="outlined" onPress={() => refetch()} size="small">
33
+ Test tRPC API
34
+ </Button>
35
+ </View>
36
+
37
+ {/* Results */}
38
+ <View style={{ marginTop: 12 }}>
39
+ {isLoading && <Text size="small">Loading...</Text>}
40
+ {error && <Text size="small" color="error">Error: {error.message}</Text>}
41
+ {data && <Text size="small">✅ {data.greeting}</Text>}
42
+ </View>
43
+ </View>
44
+ </View>
45
+ </View>
46
+ </Screen>
47
+ );
48
+ };
49
+
50
+ const ProfileScreen = () => (
51
+ <Screen>
52
+ <View spacing="lg">
53
+ <Text size="xlarge" weight="bold">Profile</Text>
54
+ <Text size="medium">User profile and account settings</Text>
55
+ <View spacing="md" style={{ marginTop: 24 }}>
56
+ <Text size="small">
57
+ Manage your account details and preferences here.
58
+ </Text>
59
+ </View>
60
+ </View>
61
+ </Screen>
62
+ );
63
+
64
+ const SettingsScreen = () => (
65
+ <Screen>
66
+ <View spacing="lg">
67
+ <Text size="xlarge" weight="bold">Settings</Text>
68
+ <Text size="medium">App configuration and preferences</Text>
69
+ <View spacing="md" style={{ marginTop: 24 }}>
70
+ <Text size="small">
71
+ Customize your app experience with various settings and options.
72
+ </Text>
73
+ </View>
74
+ </View>
75
+ </Screen>
76
+ );
77
+
78
+ const AppRouterWithTrpc: RouteParam = {
79
+ path: "/",
80
+ component: HomeScreen,
81
+ layout: {
82
+ type: "tab",
83
+ },
84
+ screenOptions: {
85
+ title: 'Home',
86
+ tabBarLabel: 'Home',
87
+ tabBarIcon: ({ focused, size }) => (
88
+ <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
89
+ ),
90
+ },
91
+ routes: [
92
+ {
93
+ path: "profile",
94
+ component: ProfileScreen,
95
+ screenOptions: {
96
+ title: 'Profile',
97
+ tabBarLabel: 'Profile',
98
+ tabBarIcon: ({ focused, size }) => (
99
+ <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
100
+ ),
101
+ },
102
+ },
103
+ {
104
+ path: "settings",
105
+ component: SettingsScreen,
106
+ screenOptions: {
107
+ title: 'Settings',
108
+ tabBarLabel: 'Settings',
109
+ tabBarIcon: ({ focused, size }) => (
110
+ <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
111
+ ),
112
+ },
113
+ },
114
+ ],
115
+ };
116
+
117
+ export default AppRouterWithTrpc;
@@ -7,7 +7,7 @@ import path from 'path'
7
7
  export default defineConfig({
8
8
  plugins: [
9
9
  babel({
10
- filter: (id) => id.includes('node_modules/@idealyst/') && /\.(js|jsx|ts|tsx)$/.test(id),
10
+ filter: (id) => id.includes("node_modules/@idealyst/"),
11
11
  babelConfig: {
12
12
  presets: [
13
13
  ['@babel/preset-typescript', {
@@ -59,8 +59,16 @@ export default defineConfig({
59
59
  '@idealyst/components',
60
60
  '@idealyst/navigation',
61
61
  '@idealyst/theme',
62
- '@testproject/shared',
62
+ '@{{workspaceScope}}/shared',
63
63
  ],
64
+ esbuildOptions: {
65
+ loader: {
66
+ '.tsx': 'tsx',
67
+ '.ts': 'ts',
68
+ '.jsx': 'jsx',
69
+ '.js': 'jsx' // Important: treat .js files as JSX for React Native compatibility
70
+ }
71
+ }
64
72
  },
65
73
  server: {
66
74
  host: '0.0.0.0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/cli",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "CLI tool for generating Idealyst Framework projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
+ import { NavigatorProvider } from '@idealyst/navigation';
4
+ import { trpc, createTRPCClient } from './utils/trpc';
5
+ import { AppRouter } from '@{{workspaceScope}}/shared';
6
+
7
+ // Create tRPC client using shared factory
8
+ const queryClient = new QueryClient();
9
+
10
+ const trpcClient = createTRPCClient({
11
+ apiUrl: 'http://localhost:3000/trpc', // Update this to your API URL
12
+ // For device testing, you might need: 'http://192.168.1.xxx:3000/trpc'
13
+ // Optional: Add headers for authentication
14
+ // headers() {
15
+ // return {
16
+ // authorization: getAuthToken(),
17
+ // };
18
+ // },
19
+ });
20
+
21
+ function App() {
22
+ return (
23
+ <trpc.Provider client={trpcClient} queryClient={queryClient}>
24
+ <QueryClientProvider client={queryClient}>
25
+ <NavigatorProvider route={AppRouter} />
26
+ </QueryClientProvider>
27
+ </trpc.Provider>
28
+ );
29
+ }
30
+
31
+ export default App;
@@ -1,56 +1,28 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
- import { httpBatchLink } from '@trpc/client';
4
- import { Screen, Text, View } from '@idealyst/components';
5
- import { trpc } from './utils/trpc';
3
+ import { NavigatorProvider } from '@idealyst/navigation';
4
+ import { trpc, createTRPCClient } from './utils/trpc';
5
+ import AppRouter from './navigation/AppRouter';
6
6
 
7
- // Create tRPC client
7
+ // Create tRPC client using shared factory
8
8
  const queryClient = new QueryClient();
9
9
 
10
- const trpcClient = trpc.createClient({
11
- links: [
12
- httpBatchLink({
13
- url: 'http://localhost:3000/trpc', // Update this to your API URL
14
- // For device testing, you might need: 'http://192.168.1.xxx:3000/trpc'
15
- // Optional: Add headers for authentication
16
- // headers() {
17
- // return {
18
- // authorization: getAuthToken(),
19
- // };
20
- // },
21
- }),
22
- ],
10
+ const trpcClient = createTRPCClient({
11
+ apiUrl: 'http://localhost:3000/trpc', // Update this to your API URL
12
+ // For device testing, you might need: 'http://192.168.1.xxx:3000/trpc'
13
+ // Optional: Add headers for authentication
14
+ // headers() {
15
+ // return {
16
+ // authorization: getAuthToken(),
17
+ // };
18
+ // },
23
19
  });
24
20
 
25
21
  function App() {
26
- // Example tRPC usage
27
- const { data, isLoading, error } = trpc.hello.useQuery({ name: 'React Native' });
28
-
29
22
  return (
30
23
  <trpc.Provider client={trpcClient} queryClient={queryClient}>
31
24
  <QueryClientProvider client={queryClient}>
32
- <Screen>
33
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', padding: 20 }}>
34
- <Text variant="h1" style={{ textAlign: 'center', marginBottom: 20 }}>
35
- Welcome to {{appName}}!
36
- </Text>
37
- <Text variant="body" style={{ textAlign: 'center', marginBottom: 20 }}>
38
- This is a React Native app built with the Idealyst Framework
39
- </Text>
40
-
41
- {/* tRPC Example */}
42
- <View style={{ marginTop: 20, alignItems: 'center' }}>
43
- <Text variant="h3" style={{ marginBottom: 10 }}>tRPC Example:</Text>
44
- {isLoading && <Text>Loading...</Text>}
45
- {error && <Text>Error: {error.message}</Text>}
46
- {data && <Text style={{ textAlign: 'center' }}>{data.greeting}</Text>}
47
- </View>
48
-
49
- <Text variant="caption" style={{ textAlign: 'center', marginTop: 30 }}>
50
- Edit src/App.tsx to get started
51
- </Text>
52
- </View>
53
- </Screen>
25
+ <NavigatorProvider route={AppRouter} />
54
26
  </QueryClientProvider>
55
27
  </trpc.Provider>
56
28
  );
@@ -1,16 +1,11 @@
1
1
  import React from 'react';
2
- import { App } from '@{{workspaceScope}}/shared';
2
+ import { NavigatorProvider } from '@idealyst/navigation';
3
+ import AppRouter from './navigation/AppRouter';
3
4
 
4
- // Main App component using shared App wrapper
5
- function AppWithShared() {
5
+ function App() {
6
6
  return (
7
- <App
8
- apiUrl="http://localhost:3000/trpc"
9
- name="{{projectName}} Developer"
10
- platform="mobile"
11
- projectName="{{projectName}}"
12
- />
7
+ <NavigatorProvider route={AppRouter} />
13
8
  );
14
9
  }
15
10
 
16
- export default AppWithShared;
11
+ export default App;
@@ -0,0 +1,121 @@
1
+ import React from 'react';
2
+ import { RouteParam } from '@idealyst/navigation';
3
+ import { Screen, Text, View, Icon, Button } from '@idealyst/components';
4
+
5
+ // Simple API test component for native-only projects
6
+ const ApiTest = () => {
7
+ const [result, setResult] = React.useState<string>('Tap to test API');
8
+
9
+ const testApi = async () => {
10
+ try {
11
+ setResult('Testing...');
12
+ // Simple fetch test - replace with actual API endpoint
13
+ const response = await fetch('http://localhost:3000/api/test');
14
+ if (response.ok) {
15
+ setResult('✅ API connection successful!');
16
+ } else {
17
+ setResult('❌ API connection failed');
18
+ }
19
+ } catch (error) {
20
+ setResult('❌ API connection failed');
21
+ }
22
+ };
23
+
24
+ return (
25
+ <View spacing="sm">
26
+ <Text size="small">{result}</Text>
27
+ <Button variant="outlined" onPress={testApi} size="small">
28
+ Test API
29
+ </Button>
30
+ </View>
31
+ );
32
+ };
33
+
34
+ const HomeScreen = () => (
35
+ <Screen>
36
+ <View spacing="lg">
37
+ <Text size="xlarge" weight="bold">Home</Text>
38
+ <Text size="medium">Welcome to {{appName}}!</Text>
39
+ <View spacing="md" style={{ marginTop: 24 }}>
40
+ <Text size="small">
41
+ This app uses tab navigation. Navigate between tabs using the bottom bar.
42
+ </Text>
43
+ </View>
44
+
45
+ {/* API Testing Component */}
46
+ <View spacing="md" style={{ marginTop: 32 }}>
47
+ <Text size="medium" weight="semibold">API Test</Text>
48
+ <ApiTest />
49
+ </View>
50
+ </View>
51
+ </Screen>
52
+ );
53
+
54
+ const ProfileScreen = () => (
55
+ <Screen>
56
+ <View spacing="lg">
57
+ <Text size="xlarge" weight="bold">Profile</Text>
58
+ <Text size="medium">User profile and account settings</Text>
59
+ <View spacing="md" style={{ marginTop: 24 }}>
60
+ <Text size="small">
61
+ Manage your account details and preferences here.
62
+ </Text>
63
+ </View>
64
+ </View>
65
+ </Screen>
66
+ );
67
+
68
+ const SettingsScreen = () => (
69
+ <Screen>
70
+ <View spacing="lg">
71
+ <Text size="xlarge" weight="bold">Settings</Text>
72
+ <Text size="medium">App configuration and preferences</Text>
73
+ <View spacing="md" style={{ marginTop: 24 }}>
74
+ <Text size="small">
75
+ Customize your app experience with various settings and options.
76
+ </Text>
77
+ </View>
78
+ </View>
79
+ </Screen>
80
+ );
81
+
82
+ const AppRouter: RouteParam = {
83
+ path: "/",
84
+ component: HomeScreen,
85
+ layout: {
86
+ type: "tab",
87
+ },
88
+ screenOptions: {
89
+ title: 'Home',
90
+ tabBarLabel: 'Home',
91
+ tabBarIcon: ({ focused, size }) => (
92
+ <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
93
+ ),
94
+ },
95
+ routes: [
96
+ {
97
+ path: "profile",
98
+ component: ProfileScreen,
99
+ screenOptions: {
100
+ title: 'Profile',
101
+ tabBarLabel: 'Profile',
102
+ tabBarIcon: ({ focused, size }) => (
103
+ <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
104
+ ),
105
+ },
106
+ },
107
+ {
108
+ path: "settings",
109
+ component: SettingsScreen,
110
+ screenOptions: {
111
+ title: 'Settings',
112
+ tabBarLabel: 'Settings',
113
+ tabBarIcon: ({ focused, size }) => (
114
+ <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
115
+ ),
116
+ },
117
+ },
118
+ ],
119
+ };
120
+
121
+ export default AppRouter;
@@ -26,7 +26,8 @@
26
26
  "@trpc/react-query": "^11.5.1",
27
27
  "@trpc/server": "^11.5.1",
28
28
  "react": "^19.1.0",
29
- "react-native": "^0.80.1"
29
+ "react-native": "^0.80.1",
30
+ "{{workspaceScope}}/api": "*"
30
31
  },
31
32
  "peerDependenciesMeta": {
32
33
  "react-native": {
@@ -1,6 +1,9 @@
1
1
  // Export the unified App component
2
2
  export { App } from './components';
3
3
 
4
+ // Export navigation router
5
+ export { default as AppRouter } from './navigation/AppRouter';
6
+
4
7
  // Export tRPC client utilities
5
8
  export { trpc, createTRPCClient, createVanillaTRPCClient } from './trpc/client';
6
9
  export type { TRPCClientConfig, AppRouter } from './trpc/client';
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ import { RouteParam } from '@idealyst/navigation';
3
+ import { Screen, Text, View, Icon } from '@idealyst/components';
4
+ import { HelloWorld } from '../components/HelloWorld';
5
+
6
+ const HomeScreen = () => (
7
+ <Screen>
8
+ <View spacing="lg">
9
+ <Text size="xlarge" weight="bold">Home</Text>
10
+ <Text size="medium">Welcome to your {{projectName}} app!</Text>
11
+ <View spacing="md" style={{ marginTop: 24 }}>
12
+ <Text size="small">
13
+ This app uses tab navigation. Navigate between tabs using the bottom bar on mobile or the top tabs on web.
14
+ </Text>
15
+ </View>
16
+
17
+ {/* API Testing Component */}
18
+ <View spacing="md" style={{ marginTop: 32 }}>
19
+ <Text size="medium" weight="semibold">API Test</Text>
20
+ <HelloWorld name="{{projectName}}" />
21
+ </View>
22
+ </View>
23
+ </Screen>
24
+ );
25
+
26
+ const ProfileScreen = () => (
27
+ <Screen>
28
+ <View spacing="lg">
29
+ <Text size="xlarge" weight="bold">Profile</Text>
30
+ <Text size="medium">User profile and account settings</Text>
31
+ <View spacing="md" style={{ marginTop: 24 }}>
32
+ <Text size="small">
33
+ Manage your account details and preferences here.
34
+ </Text>
35
+ </View>
36
+ </View>
37
+ </Screen>
38
+ );
39
+
40
+ const SettingsScreen = () => (
41
+ <Screen>
42
+ <View spacing="lg">
43
+ <Text size="xlarge" weight="bold">Settings</Text>
44
+ <Text size="medium">App configuration and preferences</Text>
45
+ <View spacing="md" style={{ marginTop: 24 }}>
46
+ <Text size="small">
47
+ Customize your app experience with various settings and options.
48
+ </Text>
49
+ </View>
50
+ </View>
51
+ </Screen>
52
+ );
53
+
54
+ const AppRouter: RouteParam = {
55
+ path: "/",
56
+ component: HomeScreen,
57
+ layout: {
58
+ type: "tab",
59
+ },
60
+ screenOptions: {
61
+ title: 'Home',
62
+ tabBarLabel: 'Home',
63
+ tabBarIcon: ({ focused, size }) => (
64
+ <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
65
+ ),
66
+ },
67
+ routes: [
68
+ {
69
+ path: "profile",
70
+ component: ProfileScreen,
71
+ screenOptions: {
72
+ title: 'Profile',
73
+ tabBarLabel: 'Profile',
74
+ tabBarIcon: ({ focused, size }) => (
75
+ <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
76
+ ),
77
+ },
78
+ },
79
+ {
80
+ path: "settings",
81
+ component: SettingsScreen,
82
+ screenOptions: {
83
+ title: 'Settings',
84
+ tabBarLabel: 'Settings',
85
+ tabBarIcon: ({ focused, size }) => (
86
+ <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
87
+ ),
88
+ },
89
+ },
90
+ ],
91
+ };
92
+
93
+ export default AppRouter;
@@ -1,9 +1,10 @@
1
- import { createTRPCReact } from '@trpc/react-query';
2
- import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
3
- import type { AppRouter } from '@{{workspaceScope}}/api';
1
+ import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
2
+ import { createTRPCReact } from "@trpc/react-query";
3
+ import type { AppRouter } from "@{{workspaceScope}}/api";
4
4
 
5
5
  // Create the tRPC React hooks with full type safety
6
- export const trpc = createTRPCReact<AppRouter>();
6
+ export const trpc: ReturnType<typeof createTRPCReact<AppRouter>> =
7
+ createTRPCReact<AppRouter>();
7
8
 
8
9
  // Configuration for tRPC client
9
10
  export interface TRPCClientConfig {
@@ -12,7 +13,9 @@ export interface TRPCClientConfig {
12
13
  }
13
14
 
14
15
  // Create tRPC client factory
15
- export function createTRPCClient(config: TRPCClientConfig) {
16
+ export function createTRPCClient(
17
+ config: TRPCClientConfig
18
+ ): ReturnType<typeof trpc.createClient> {
16
19
  return trpc.createClient({
17
20
  links: [
18
21
  httpBatchLink({
@@ -24,7 +27,9 @@ export function createTRPCClient(config: TRPCClientConfig) {
24
27
  }
25
28
 
26
29
  // Create a vanilla client (for use outside of React components)
27
- export function createVanillaTRPCClient(config: TRPCClientConfig) {
30
+ export function createVanillaTRPCClient(
31
+ config: TRPCClientConfig
32
+ ): ReturnType<typeof createTRPCProxyClient<AppRouter>> {
28
33
  return createTRPCProxyClient<AppRouter>({
29
34
  links: [
30
35
  httpBatchLink({
@@ -36,4 +41,4 @@ export function createVanillaTRPCClient(config: TRPCClientConfig) {
36
41
  }
37
42
 
38
43
  // Export types
39
- export type { AppRouter } from '@{{workspaceScope}}/api';
44
+ export type { AppRouter } from "@{{workspaceScope}}/api";