@idealyst/cli 1.0.62 → 1.0.64

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.
@@ -21,7 +21,8 @@
21
21
  "@trpc/react-query": "^11.5.1",
22
22
  "@trpc/server": "^11.5.1",
23
23
  "react": "^18.2.0",
24
- "react-native": "^0.73.0"
24
+ "react-native": "^0.73.0",
25
+ "react-native-svg": "^15.8.0"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@babel/core": "^7.20.0",
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { NavigatorProvider } from '@idealyst/navigation';
4
- import { trpc, createTRPCClient } from './utils/trpc';
5
- import { AppRouter } from '@{{workspaceScope}}/shared';
4
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
6
5
 
7
6
  // Create tRPC client using shared factory
8
7
  const queryClient = new QueryClient();
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { NavigatorProvider } from '@idealyst/navigation';
4
- import { trpc, createTRPCClient } from './utils/trpc';
5
- import AppRouter from './navigation/AppRouter';
4
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
6
5
 
7
6
  // Create tRPC client using shared factory
8
7
  const queryClient = new QueryClient();
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { NavigatorProvider } from '@idealyst/navigation';
3
- import AppRouter from './navigation/AppRouter';
3
+ import { AppRouter } from '{{workspaceScope}}/shared';
4
4
 
5
5
  function App() {
6
6
  return (
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@idealyst/components": "^1.0.21",
23
+ "@idealyst/navigation": "^1.0.21",
23
24
  "@idealyst/theme": "^1.0.21",
24
25
  "@tanstack/react-query": "^5.83.0",
25
26
  "@trpc/client": "^11.5.1",
@@ -36,6 +37,7 @@
36
37
  },
37
38
  "devDependencies": {
38
39
  "@idealyst/components": "^1.0.21",
40
+ "@idealyst/navigation": "^1.0.21",
39
41
  "@idealyst/theme": "^1.0.21",
40
42
  "@tanstack/react-query": "^5.83.0",
41
43
  "@trpc/client": "^11.5.1",
@@ -2,8 +2,7 @@ import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { BrowserRouter } from 'react-router-dom';
4
4
  import { NavigatorProvider } from '@idealyst/navigation';
5
- import { trpc, createTRPCClient } from './utils/trpc';
6
- import { AppRouter } from '@{{workspaceScope}}/shared';
5
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
7
6
 
8
7
  // Create tRPC client using shared factory
9
8
  const queryClient = new QueryClient();
@@ -2,8 +2,7 @@ import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { BrowserRouter } from 'react-router-dom';
4
4
  import { NavigatorProvider } from '@idealyst/navigation';
5
- import { trpc, createTRPCClient } from './utils/trpc';
6
- import AppRouterWithTrpc from './navigation/AppRouterWithTrpc';
5
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
7
6
 
8
7
  // Create tRPC client using shared factory
9
8
  const queryClient = new QueryClient();
@@ -23,7 +22,7 @@ function App() {
23
22
  <trpc.Provider client={trpcClient} queryClient={queryClient}>
24
23
  <QueryClientProvider client={queryClient}>
25
24
  <BrowserRouter>
26
- <NavigatorProvider route={AppRouterWithTrpc} />
25
+ <NavigatorProvider route={AppRouter} />
27
26
  </BrowserRouter>
28
27
  </QueryClientProvider>
29
28
  </trpc.Provider>
@@ -1,6 +1,6 @@
1
1
  import { BrowserRouter } from 'react-router-dom';
2
2
  import { NavigatorProvider } from '@idealyst/navigation';
3
- import AppRouter from './navigation/AppRouter';
3
+ import { AppRouter } from '{{workspaceScope}}/shared';
4
4
 
5
5
  function App() {
6
6
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/cli",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "description": "CLI tool for generating Idealyst Framework projects",
5
5
  "readme": "README.md",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,8 @@
21
21
  "@trpc/react-query": "^11.5.1",
22
22
  "@trpc/server": "^11.5.1",
23
23
  "react": "^18.2.0",
24
- "react-native": "^0.73.0"
24
+ "react-native": "^0.73.0",
25
+ "react-native-svg": "^15.8.0"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@babel/core": "^7.20.0",
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { NavigatorProvider } from '@idealyst/navigation';
4
- import { trpc, createTRPCClient } from './utils/trpc';
5
- import { AppRouter } from '@{{workspaceScope}}/shared';
4
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
6
5
 
7
6
  // Create tRPC client using shared factory
8
7
  const queryClient = new QueryClient();
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { NavigatorProvider } from '@idealyst/navigation';
4
- import { trpc, createTRPCClient } from './utils/trpc';
5
- import AppRouter from './navigation/AppRouter';
4
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
6
5
 
7
6
  // Create tRPC client using shared factory
8
7
  const queryClient = new QueryClient();
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { NavigatorProvider } from '@idealyst/navigation';
3
- import AppRouter from './navigation/AppRouter';
3
+ import { AppRouter } from '{{workspaceScope}}/shared';
4
4
 
5
5
  function App() {
6
6
  return (
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@idealyst/components": "^1.0.21",
23
+ "@idealyst/navigation": "^1.0.21",
23
24
  "@idealyst/theme": "^1.0.21",
24
25
  "@tanstack/react-query": "^5.83.0",
25
26
  "@trpc/client": "^11.5.1",
@@ -36,6 +37,7 @@
36
37
  },
37
38
  "devDependencies": {
38
39
  "@idealyst/components": "^1.0.21",
40
+ "@idealyst/navigation": "^1.0.21",
39
41
  "@idealyst/theme": "^1.0.21",
40
42
  "@tanstack/react-query": "^5.83.0",
41
43
  "@trpc/client": "^11.5.1",
@@ -2,8 +2,7 @@ import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { BrowserRouter } from 'react-router-dom';
4
4
  import { NavigatorProvider } from '@idealyst/navigation';
5
- import { trpc, createTRPCClient } from './utils/trpc';
6
- import { AppRouter } from '@{{workspaceScope}}/shared';
5
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
7
6
 
8
7
  // Create tRPC client using shared factory
9
8
  const queryClient = new QueryClient();
@@ -2,8 +2,7 @@ import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { BrowserRouter } from 'react-router-dom';
4
4
  import { NavigatorProvider } from '@idealyst/navigation';
5
- import { trpc, createTRPCClient } from './utils/trpc';
6
- import AppRouterWithTrpc from './navigation/AppRouterWithTrpc';
5
+ import { trpc, createTRPCClient, AppRouter } from '{{workspaceScope}}/shared';
7
6
 
8
7
  // Create tRPC client using shared factory
9
8
  const queryClient = new QueryClient();
@@ -23,7 +22,7 @@ function App() {
23
22
  <trpc.Provider client={trpcClient} queryClient={queryClient}>
24
23
  <QueryClientProvider client={queryClient}>
25
24
  <BrowserRouter>
26
- <NavigatorProvider route={AppRouterWithTrpc} />
25
+ <NavigatorProvider route={AppRouter} />
27
26
  </BrowserRouter>
28
27
  </QueryClientProvider>
29
28
  </trpc.Provider>
@@ -1,6 +1,6 @@
1
1
  import { BrowserRouter } from 'react-router-dom';
2
2
  import { NavigatorProvider } from '@idealyst/navigation';
3
- import AppRouter from './navigation/AppRouter';
3
+ import { AppRouter } from '{{workspaceScope}}/shared';
4
4
 
5
5
  function App() {
6
6
  return (
@@ -1,126 +0,0 @@
1
- import React from 'react';
2
- import { NavigatorParam } 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: NavigatorParam = {
83
- type: 'navigator',
84
- path: '/',
85
- layout: 'tab',
86
- routes: [
87
- {
88
- type: 'screen',
89
- path: '/',
90
- component: HomeScreen,
91
- options: {
92
- title: 'Home',
93
- tabBarLabel: 'Home',
94
- tabBarIcon: ({ focused, size }) => (
95
- <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
96
- ),
97
- },
98
- },
99
- {
100
- type: 'screen',
101
- path: '/profile',
102
- component: ProfileScreen,
103
- options: {
104
- title: 'Profile',
105
- tabBarLabel: 'Profile',
106
- tabBarIcon: ({ focused, size }) => (
107
- <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
108
- ),
109
- },
110
- },
111
- {
112
- type: 'screen',
113
- path: '/settings',
114
- component: SettingsScreen,
115
- options: {
116
- title: 'Settings',
117
- tabBarLabel: 'Settings',
118
- tabBarIcon: ({ focused, size }) => (
119
- <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
120
- ),
121
- },
122
- },
123
- ],
124
- };
125
-
126
- export default AppRouter;
@@ -1,126 +0,0 @@
1
- import React from 'react';
2
- import { NavigatorParam } 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: NavigatorParam = {
83
- type: 'navigator',
84
- path: '/',
85
- layout: 'tab',
86
- routes: [
87
- {
88
- type: 'screen',
89
- path: '/',
90
- component: HomeScreen,
91
- options: {
92
- title: 'Home',
93
- tabBarLabel: 'Home',
94
- tabBarIcon: ({ focused, size }) => (
95
- <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
96
- ),
97
- },
98
- },
99
- {
100
- type: 'screen',
101
- path: '/profile',
102
- component: ProfileScreen,
103
- options: {
104
- title: 'Profile',
105
- tabBarLabel: 'Profile',
106
- tabBarIcon: ({ focused, size }) => (
107
- <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
108
- ),
109
- },
110
- },
111
- {
112
- type: 'screen',
113
- path: '/settings',
114
- component: SettingsScreen,
115
- options: {
116
- title: 'Settings',
117
- tabBarLabel: 'Settings',
118
- tabBarIcon: ({ focused, size }) => (
119
- <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
120
- ),
121
- },
122
- },
123
- ],
124
- };
125
-
126
- export default AppRouter;
@@ -1,122 +0,0 @@
1
- import React from 'react';
2
- import { NavigatorParam } 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: NavigatorParam = {
79
- type: 'navigator',
80
- path: '/',
81
- layout: 'tab',
82
- routes: [
83
- {
84
- type: 'screen',
85
- path: '/',
86
- component: HomeScreen,
87
- options: {
88
- title: 'Home',
89
- tabBarLabel: 'Home',
90
- tabBarIcon: ({ focused, size }) => (
91
- <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
92
- ),
93
- },
94
- },
95
- {
96
- type: 'screen',
97
- path: '/profile',
98
- component: ProfileScreen,
99
- options: {
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
- type: 'screen',
109
- path: '/settings',
110
- component: SettingsScreen,
111
- options: {
112
- title: 'Settings',
113
- tabBarLabel: 'Settings',
114
- tabBarIcon: ({ focused, size }) => (
115
- <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
116
- ),
117
- },
118
- },
119
- ],
120
- };
121
-
122
- export default AppRouterWithTrpc;
@@ -1,126 +0,0 @@
1
- import React from 'react';
2
- import { NavigatorParam } 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: NavigatorParam = {
83
- type: 'navigator',
84
- path: '/',
85
- layout: 'tab',
86
- routes: [
87
- {
88
- type: 'screen',
89
- path: '/',
90
- component: HomeScreen,
91
- options: {
92
- title: 'Home',
93
- tabBarLabel: 'Home',
94
- tabBarIcon: ({ focused, size }) => (
95
- <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
96
- ),
97
- },
98
- },
99
- {
100
- type: 'screen',
101
- path: '/profile',
102
- component: ProfileScreen,
103
- options: {
104
- title: 'Profile',
105
- tabBarLabel: 'Profile',
106
- tabBarIcon: ({ focused, size }) => (
107
- <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
108
- ),
109
- },
110
- },
111
- {
112
- type: 'screen',
113
- path: '/settings',
114
- component: SettingsScreen,
115
- options: {
116
- title: 'Settings',
117
- tabBarLabel: 'Settings',
118
- tabBarIcon: ({ focused, size }) => (
119
- <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
120
- ),
121
- },
122
- },
123
- ],
124
- };
125
-
126
- export default AppRouter;
@@ -1,126 +0,0 @@
1
- import React from 'react';
2
- import { NavigatorParam } 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: NavigatorParam = {
83
- type: 'navigator',
84
- path: '/',
85
- layout: 'tab',
86
- routes: [
87
- {
88
- type: 'screen',
89
- path: '/',
90
- component: HomeScreen,
91
- options: {
92
- title: 'Home',
93
- tabBarLabel: 'Home',
94
- tabBarIcon: ({ focused, size }) => (
95
- <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
96
- ),
97
- },
98
- },
99
- {
100
- type: 'screen',
101
- path: '/profile',
102
- component: ProfileScreen,
103
- options: {
104
- title: 'Profile',
105
- tabBarLabel: 'Profile',
106
- tabBarIcon: ({ focused, size }) => (
107
- <Icon name="account" color={focused ? 'blue' : 'gray'} size={size || 24} />
108
- ),
109
- },
110
- },
111
- {
112
- type: 'screen',
113
- path: '/settings',
114
- component: SettingsScreen,
115
- options: {
116
- title: 'Settings',
117
- tabBarLabel: 'Settings',
118
- tabBarIcon: ({ focused, size }) => (
119
- <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
120
- ),
121
- },
122
- },
123
- ],
124
- };
125
-
126
- export default AppRouter;
@@ -1,122 +0,0 @@
1
- import React from 'react';
2
- import { NavigatorParam } 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: NavigatorParam = {
79
- type: 'navigator',
80
- path: '/',
81
- layout: 'tab',
82
- routes: [
83
- {
84
- type: 'screen',
85
- path: '/',
86
- component: HomeScreen,
87
- options: {
88
- title: 'Home',
89
- tabBarLabel: 'Home',
90
- tabBarIcon: ({ focused, size }) => (
91
- <Icon name="home" color={focused ? 'blue' : 'gray'} size={size || 24} />
92
- ),
93
- },
94
- },
95
- {
96
- type: 'screen',
97
- path: '/profile',
98
- component: ProfileScreen,
99
- options: {
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
- type: 'screen',
109
- path: '/settings',
110
- component: SettingsScreen,
111
- options: {
112
- title: 'Settings',
113
- tabBarLabel: 'Settings',
114
- tabBarIcon: ({ focused, size }) => (
115
- <Icon name="cog" color={focused ? 'blue' : 'gray'} size={size || 24} />
116
- ),
117
- },
118
- },
119
- ],
120
- };
121
-
122
- export default AppRouterWithTrpc;