create-expo-stack 2.4.0-next.8829c0c → 2.4.0-next.a38e81a
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.
- package/README.md +6 -0
- package/build/commands/create-expo-stack.js +10 -2
- package/build/templates/base/App.tsx.ejs +22 -0
- package/build/templates/base/package.json.ejs +4 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +23 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/news.tsx.ejs +24 -0
- package/build/templates/packages/expo-router/drawer/app/[...unmatched].tsx.ejs +26 -0
- package/build/templates/packages/expo-router/stack/app/[...unmatched].tsx.ejs +28 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +35 -0
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +50 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +23 -1
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +23 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +23 -0
- package/build/templates/packages/expo-router/tabs/app/[...unmatched].tsx.ejs +28 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +23 -0
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +36 -0
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +59 -0
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +19 -0
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +24 -1
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +33 -0
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +32 -0
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +31 -0
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +63 -2
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +31 -0
- package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
- package/build/templates/packages/unistyles/theme.ts.ejs +26 -0
- package/build/templates/packages/unistyles/unistyles.ts.ejs +28 -0
- package/build/types/types.d.ts +1 -1
- package/build/types/utilities/printOutput.d.ts +2 -2
- package/build/types.js +3 -2
- package/build/utilities/configureProjectFiles.js +11 -1
- package/build/utilities/generateProjectFiles.js +4 -1
- package/build/utilities/printOutput.js +14 -2
- package/build/utilities/runCLI.js +6 -2
- package/build/utilities/showHelp.js +2 -1
- package/package.json +1 -1
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
7
7
|
import { Platform } from 'react-native';
|
|
8
8
|
import { Box, Text } from 'theme';
|
|
9
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
10
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
11
|
+
import { Platform, Text, View } from "react-native";
|
|
9
12
|
<% } else { %>
|
|
10
13
|
import { Platform, StyleSheet, Text, View } from "react-native";
|
|
11
14
|
<% } %>
|
|
@@ -14,6 +17,9 @@ import { StatusBar } from "expo-status-bar";
|
|
|
14
17
|
import EditScreenInfo from "../components/edit-screen-info";
|
|
15
18
|
|
|
16
19
|
export default function ModalScreen() {
|
|
20
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
21
|
+
const {styles} = useStyles(stylesheet)
|
|
22
|
+
<% } %>
|
|
17
23
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
18
24
|
return (
|
|
19
25
|
<View className={styles.container}>
|
|
@@ -61,6 +67,23 @@ export default function ModalScreen() {
|
|
|
61
67
|
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
62
68
|
title: `text-xl font-bold`
|
|
63
69
|
};
|
|
70
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
71
|
+
const stylesheet = createStyleSheet({
|
|
72
|
+
container: {
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
flex: 1,
|
|
75
|
+
justifyContent: "center"
|
|
76
|
+
},
|
|
77
|
+
separator: {
|
|
78
|
+
height: 1,
|
|
79
|
+
marginVertical: 30,
|
|
80
|
+
width: "80%"
|
|
81
|
+
},
|
|
82
|
+
title: {
|
|
83
|
+
fontSize: 20,
|
|
84
|
+
fontWeight: "bold"
|
|
85
|
+
}
|
|
86
|
+
});
|
|
64
87
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
65
88
|
const styles = StyleSheet.create({
|
|
66
89
|
container: {
|
|
@@ -4,11 +4,17 @@
|
|
|
4
4
|
import { YStack, H4, Paragraph } from "tamagui"
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
6
6
|
import { Box, Text } from 'theme';
|
|
7
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
8
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
9
|
+
import { Text, View } from "react-native";
|
|
7
10
|
<% } else { %>
|
|
8
11
|
import { StyleSheet, Text, View } from "react-native";
|
|
9
12
|
<% } %>
|
|
10
13
|
|
|
11
14
|
export default function EditScreenInfo({ path }: { path: string }) {
|
|
15
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
16
|
+
const { styles } = useStyles(stylesheet);
|
|
17
|
+
<% } %>
|
|
12
18
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
13
19
|
return (
|
|
14
20
|
<View>
|
|
@@ -84,6 +90,36 @@ export default function EditScreenInfo({ path }: { path: string }) {
|
|
|
84
90
|
helpLinkText: `text-center`,
|
|
85
91
|
homeScreenFilename: `my-2`,
|
|
86
92
|
};
|
|
93
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
94
|
+
const stylesheet = createStyleSheet({
|
|
95
|
+
codeHighlightContainer: {
|
|
96
|
+
borderRadius: 3,
|
|
97
|
+
paddingHorizontal: 4
|
|
98
|
+
},
|
|
99
|
+
getStartedContainer: {
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
marginHorizontal: 50
|
|
102
|
+
},
|
|
103
|
+
getStartedText: {
|
|
104
|
+
fontSize: 17,
|
|
105
|
+
lineHeight: 24,
|
|
106
|
+
textAlign: "center"
|
|
107
|
+
},
|
|
108
|
+
helpContainer: {
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
marginHorizontal: 20,
|
|
111
|
+
marginTop: 15
|
|
112
|
+
},
|
|
113
|
+
helpLink: {
|
|
114
|
+
paddingVertical: 15
|
|
115
|
+
},
|
|
116
|
+
helpLinkText: {
|
|
117
|
+
textAlign: "center"
|
|
118
|
+
},
|
|
119
|
+
homeScreenFilename: {
|
|
120
|
+
marginVertical: 7
|
|
121
|
+
}
|
|
122
|
+
});
|
|
87
123
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
88
124
|
const styles = StyleSheet.create({
|
|
89
125
|
codeHighlightContainer: {
|
|
@@ -3,6 +3,9 @@ import React from "react";
|
|
|
3
3
|
import { Text, View } from "react-native";
|
|
4
4
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
5
5
|
import { Box, Text } from 'theme';
|
|
6
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
7
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
8
|
+
import { Text, View } from "react-native";
|
|
6
9
|
<% } else { %>
|
|
7
10
|
import { StyleSheet, Text, View } from "react-native";
|
|
8
11
|
<% } %>
|
|
@@ -52,6 +55,32 @@ import React from "react";
|
|
|
52
55
|
</Box>
|
|
53
56
|
);
|
|
54
57
|
}
|
|
58
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
59
|
+
export default function EditScreenInfo({ path }: { path: string }) {
|
|
60
|
+
const {styles} = useStyles(stylesheet)
|
|
61
|
+
return (
|
|
62
|
+
<View>
|
|
63
|
+
<View style={styles.getStartedContainer}>
|
|
64
|
+
<Text
|
|
65
|
+
style={styles.getStartedText}>
|
|
66
|
+
Open up the code for this screen:
|
|
67
|
+
</Text>
|
|
68
|
+
|
|
69
|
+
<View
|
|
70
|
+
style={[styles.codeHighlightContainer, styles.homeScreenFilename]}
|
|
71
|
+
>
|
|
72
|
+
<Text>{path}</Text>
|
|
73
|
+
</View>
|
|
74
|
+
|
|
75
|
+
<Text
|
|
76
|
+
style={styles.getStartedText}
|
|
77
|
+
>
|
|
78
|
+
Change any of the text, save the file, and your app will automatically update.
|
|
79
|
+
</Text>
|
|
80
|
+
</View>
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
55
84
|
<% } else { %>
|
|
56
85
|
export default function EditScreenInfo({ path }: { path: string }) {
|
|
57
86
|
return (
|
|
@@ -88,6 +117,36 @@ import React from "react";
|
|
|
88
117
|
helpLink: "py-4",
|
|
89
118
|
helpLinkText: "text-center"
|
|
90
119
|
};
|
|
120
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
121
|
+
const stylesheet = createStyleSheet({
|
|
122
|
+
codeHighlightContainer: {
|
|
123
|
+
borderRadius: 3,
|
|
124
|
+
paddingHorizontal: 4
|
|
125
|
+
},
|
|
126
|
+
getStartedContainer: {
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
marginHorizontal: 50
|
|
129
|
+
},
|
|
130
|
+
getStartedText: {
|
|
131
|
+
fontSize: 17,
|
|
132
|
+
lineHeight: 24,
|
|
133
|
+
textAlign: "center"
|
|
134
|
+
},
|
|
135
|
+
helpContainer: {
|
|
136
|
+
alignItems: "center",
|
|
137
|
+
marginHorizontal: 20,
|
|
138
|
+
marginTop: 15
|
|
139
|
+
},
|
|
140
|
+
helpLink: {
|
|
141
|
+
paddingVertical: 15
|
|
142
|
+
},
|
|
143
|
+
helpLinkText: {
|
|
144
|
+
textAlign: "center"
|
|
145
|
+
},
|
|
146
|
+
homeScreenFilename: {
|
|
147
|
+
marginVertical: 7
|
|
148
|
+
}
|
|
149
|
+
});
|
|
91
150
|
<% } else if (props.stylingPackage?.name !== "restyle") { %>
|
|
92
151
|
const styles = StyleSheet.create({
|
|
93
152
|
codeHighlightContainer: {
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
import { Button, Text } from "tamagui";
|
|
9
9
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
10
10
|
import { Box, Text, useTheme } from 'theme';
|
|
11
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
12
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
13
|
+
import { Text, View } from "react-native";
|
|
11
14
|
<% } else { %>
|
|
12
15
|
import { Text, View, StyleSheet } from "react-native";
|
|
13
16
|
<% } %>
|
|
@@ -26,6 +29,11 @@
|
|
|
26
29
|
<% if (props.stylingPackage?.name === "restyle") { %>
|
|
27
30
|
const { colors } = useTheme();
|
|
28
31
|
<% } %>
|
|
32
|
+
|
|
33
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
34
|
+
const { styles } = useStyles(stylesheet)
|
|
35
|
+
<% } %>
|
|
36
|
+
|
|
29
37
|
return (
|
|
30
38
|
<NavigationContainer>
|
|
31
39
|
<Stack.Navigator initialRouteName="Overview">
|
|
@@ -90,6 +98,17 @@
|
|
|
90
98
|
backButton: "flex-row",
|
|
91
99
|
backButtonText: "text-blue-500 ml-1"
|
|
92
100
|
};
|
|
101
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
102
|
+
const stylesheet = createStyleSheet({
|
|
103
|
+
backButton: {
|
|
104
|
+
flexDirection: "row",
|
|
105
|
+
paddingLeft: 20,
|
|
106
|
+
},
|
|
107
|
+
backButtonText: {
|
|
108
|
+
color: "#007AFF",
|
|
109
|
+
marginLeft: 4
|
|
110
|
+
}
|
|
111
|
+
});
|
|
93
112
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
94
113
|
const styles = StyleSheet.create({
|
|
95
114
|
backButton: {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
2
2
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
3
3
|
import { StackScreenProps } from '@react-navigation/stack';
|
|
4
|
+
<% if (props.stylingPackage?.name === "unistyles") {%>
|
|
5
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
6
|
+
import { Pressable } from "react-native";
|
|
7
|
+
<% } else { %>
|
|
4
8
|
import { Pressable, StyleSheet } from "react-native";
|
|
9
|
+
<% } %>
|
|
5
10
|
|
|
6
11
|
import { RootStackParamList } from '.';
|
|
7
12
|
import One from "../screens/one";
|
|
@@ -13,12 +18,19 @@ function TabBarIcon(props: {
|
|
|
13
18
|
name: React.ComponentProps<typeof FontAwesome>["name"];
|
|
14
19
|
color: string;
|
|
15
20
|
}) {
|
|
21
|
+
<% if (props.stylingPackage?.name === "unistyles") {%>
|
|
22
|
+
const {styles} = useStyles(stylesheet)
|
|
23
|
+
<% } %>
|
|
16
24
|
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
type Props = StackScreenProps<RootStackParamList, 'TabNavigator'>;
|
|
20
28
|
|
|
21
29
|
export default function TabLayout({ navigation }: Props) {
|
|
30
|
+
<% if (props.stylingPackage?.name === "unistyles") {%>
|
|
31
|
+
const {styles} = useStyles(stylesheet)
|
|
32
|
+
<% } %>
|
|
33
|
+
|
|
22
34
|
return (
|
|
23
35
|
<Tab.Navigator
|
|
24
36
|
screenOptions={{
|
|
@@ -56,6 +68,16 @@ export default function TabLayout({ navigation }: Props) {
|
|
|
56
68
|
);
|
|
57
69
|
}
|
|
58
70
|
|
|
71
|
+
<% if (props.stylingPackage?.name === "unistyles") {%>
|
|
72
|
+
const stylesheet = createStyleSheet({
|
|
73
|
+
headerRight: {
|
|
74
|
+
marginRight: 15
|
|
75
|
+
},
|
|
76
|
+
tabBarIcon: {
|
|
77
|
+
marginBottom: -3
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
<% } else { %>
|
|
59
81
|
const styles = StyleSheet.create({
|
|
60
82
|
headerRight: {
|
|
61
83
|
marginRight: 15
|
|
@@ -63,4 +85,5 @@ const styles = StyleSheet.create({
|
|
|
63
85
|
tabBarIcon: {
|
|
64
86
|
marginBottom: -3
|
|
65
87
|
}
|
|
66
|
-
});
|
|
88
|
+
});
|
|
89
|
+
<% } %>
|
|
@@ -6,6 +6,9 @@ import { RouteProp, useRoute } from "@react-navigation/native";
|
|
|
6
6
|
import { Container, Main, Subtitle, Title } from "../../tamagui.config";
|
|
7
7
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
8
8
|
import { Box, Text } from 'theme';
|
|
9
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
10
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
11
|
+
import { View, Text } from "react-native";
|
|
9
12
|
<% } else { %>
|
|
10
13
|
import { View, StyleSheet, Text } from "react-native";
|
|
11
14
|
<% } %>
|
|
@@ -45,6 +48,16 @@ export default function Details() {
|
|
|
45
48
|
</Text>
|
|
46
49
|
</Box>
|
|
47
50
|
</Box>
|
|
51
|
+
);
|
|
52
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
53
|
+
const {styles} = useStyles(stylesheet)
|
|
54
|
+
return (
|
|
55
|
+
<View style={styles.container}>
|
|
56
|
+
<View style={styles.main}>
|
|
57
|
+
<Text style={styles.title}>Details</Text>
|
|
58
|
+
<Text style={styles.subtitle}>Showing details for user {router.params.name}.</Text>
|
|
59
|
+
</View>
|
|
60
|
+
</View>
|
|
48
61
|
);
|
|
49
62
|
<% } else { %>
|
|
50
63
|
return (
|
|
@@ -65,6 +78,26 @@ export default function Details() {
|
|
|
65
78
|
title: "text-[64px] font-bold",
|
|
66
79
|
subtitle: "text-4xl text-gray-700",
|
|
67
80
|
};
|
|
81
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
82
|
+
const stylesheet = createStyleSheet({
|
|
83
|
+
container: {
|
|
84
|
+
flex: 1,
|
|
85
|
+
padding: 24,
|
|
86
|
+
},
|
|
87
|
+
main: {
|
|
88
|
+
flex: 1,
|
|
89
|
+
maxWidth: 960,
|
|
90
|
+
marginHorizontal: "auto",
|
|
91
|
+
},
|
|
92
|
+
title: {
|
|
93
|
+
fontSize: 64,
|
|
94
|
+
fontWeight: "bold",
|
|
95
|
+
},
|
|
96
|
+
subtitle: {
|
|
97
|
+
fontSize: 36,
|
|
98
|
+
color: "#38434D",
|
|
99
|
+
},
|
|
100
|
+
});
|
|
68
101
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
69
102
|
const styles = StyleSheet.create({
|
|
70
103
|
container: {
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
7
7
|
import { Platform } from 'react-native';
|
|
8
8
|
import { Box, Text, makeStyles } from 'theme';
|
|
9
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
10
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
11
|
+
import { Platform, Text, View } from "react-native";
|
|
9
12
|
<% } else { %>
|
|
10
13
|
import { Platform, StyleSheet, Text, View } from "react-native";
|
|
11
14
|
<% } %>
|
|
@@ -45,6 +48,16 @@ export default function Modal() {
|
|
|
45
48
|
<EditScreenInfo path="src/screens/modal.tsx" />
|
|
46
49
|
</Box>
|
|
47
50
|
);
|
|
51
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
52
|
+
const {styles} = useStyles(stylesheet)
|
|
53
|
+
return (
|
|
54
|
+
<View style={styles.container}>
|
|
55
|
+
<StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
|
|
56
|
+
<Text style={styles.title}>Modal</Text>
|
|
57
|
+
<View style={styles.separator} />
|
|
58
|
+
<EditScreenInfo path="src/screens/modal.tsx" />
|
|
59
|
+
</View>
|
|
60
|
+
);
|
|
48
61
|
<% } else { %>
|
|
49
62
|
return (
|
|
50
63
|
<View style={styles.container}>
|
|
@@ -73,6 +86,25 @@ export default function Modal() {
|
|
|
73
86
|
width: '80%',
|
|
74
87
|
},
|
|
75
88
|
}));
|
|
89
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
90
|
+
const stylesheet = createStyleSheet({
|
|
91
|
+
container: {
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
flex: 1,
|
|
94
|
+
justifyContent: "center"
|
|
95
|
+
},
|
|
96
|
+
separator: {
|
|
97
|
+
backgroundColor: "gray",
|
|
98
|
+
height: 1,
|
|
99
|
+
marginVertical: 30,
|
|
100
|
+
opacity: 0.25,
|
|
101
|
+
width: "80%",
|
|
102
|
+
},
|
|
103
|
+
title: {
|
|
104
|
+
fontSize: 20,
|
|
105
|
+
fontWeight: "bold"
|
|
106
|
+
}
|
|
107
|
+
});
|
|
76
108
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
77
109
|
const styles = StyleSheet.create({
|
|
78
110
|
container: {
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
import { YStack, H2, Separator, Theme } from "tamagui";
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
6
6
|
import { Box, Text, makeStyles } from 'theme';
|
|
7
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
8
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
9
|
+
import { Text, View } from "react-native";
|
|
7
10
|
<% } else { %>
|
|
8
11
|
import { StyleSheet, Text, View } from "react-native";
|
|
9
12
|
<% } %>
|
|
@@ -39,6 +42,15 @@ export default function TabOneScreen() {
|
|
|
39
42
|
<EditScreenInfo path="src/screens/one.tsx" />
|
|
40
43
|
</Box>
|
|
41
44
|
);
|
|
45
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
46
|
+
const { styles } = useStyles(stylesheet)
|
|
47
|
+
return (
|
|
48
|
+
<View style={styles.container}>
|
|
49
|
+
<Text style={styles.title}>Tab One</Text>
|
|
50
|
+
<View style={styles.separator} />
|
|
51
|
+
<EditScreenInfo path="src/screens/one.tsx" />
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
42
54
|
<% } else { %>
|
|
43
55
|
return (
|
|
44
56
|
<View style={styles.container}>
|
|
@@ -66,6 +78,25 @@ export default function TabOneScreen() {
|
|
|
66
78
|
width: '80%',
|
|
67
79
|
},
|
|
68
80
|
}));
|
|
81
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
82
|
+
const stylesheet = createStyleSheet({
|
|
83
|
+
container: {
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
flex: 1,
|
|
86
|
+
justifyContent: "center",
|
|
87
|
+
},
|
|
88
|
+
separator: {
|
|
89
|
+
backgroundColor: "gray",
|
|
90
|
+
height: 1,
|
|
91
|
+
marginVertical: 30,
|
|
92
|
+
opacity: 0.25,
|
|
93
|
+
width: "80%",
|
|
94
|
+
},
|
|
95
|
+
title: {
|
|
96
|
+
fontSize: 20,
|
|
97
|
+
fontWeight: "bold",
|
|
98
|
+
}
|
|
99
|
+
});
|
|
69
100
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
70
101
|
const styles = StyleSheet.create({
|
|
71
102
|
container: {
|
|
@@ -8,6 +8,9 @@ import { StackNavigationProp } from "@react-navigation/stack";
|
|
|
8
8
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
9
9
|
import { TouchableOpacity } from 'react-native';
|
|
10
10
|
import { Box, Text, makeStyles } from 'theme';
|
|
11
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
12
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
13
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
11
14
|
<% } else { %>
|
|
12
15
|
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
13
16
|
<% } %>
|
|
@@ -16,7 +19,6 @@ import { RootStackParamList } from "../navigation";
|
|
|
16
19
|
type OverviewScreenNavigationProps = StackNavigationProp<RootStackParamList, "Overview">;
|
|
17
20
|
|
|
18
21
|
export default function Overview() {
|
|
19
|
-
const styles = useStyles();
|
|
20
22
|
const navigation = useNavigation<OverviewScreenNavigationProps>();
|
|
21
23
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
22
24
|
return (
|
|
@@ -47,6 +49,7 @@ export default function Overview() {
|
|
|
47
49
|
</Container>
|
|
48
50
|
);
|
|
49
51
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
52
|
+
const styles = useStyles();
|
|
50
53
|
return (
|
|
51
54
|
<Box flex={1} padding="ml_24">
|
|
52
55
|
<Box flex={1} maxWidth={960} justifyContent="space-between">
|
|
@@ -66,7 +69,22 @@ export default function Overview() {
|
|
|
66
69
|
</Box>
|
|
67
70
|
</Box>
|
|
68
71
|
);
|
|
69
|
-
<% } else { %>
|
|
72
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
73
|
+
const {styles} = useStyles(stylesheet)
|
|
74
|
+
return (
|
|
75
|
+
<View style={styles.container}>
|
|
76
|
+
<View style={styles.main}>
|
|
77
|
+
<View>
|
|
78
|
+
<Text style={styles.title}>Hello World</Text>
|
|
79
|
+
<Text style={styles.subtitle}>This is the first page of your app.</Text>
|
|
80
|
+
</View>
|
|
81
|
+
<TouchableOpacity style={styles.button} onPress={() => navigation.navigate("Details", { name: "Dan" })}>
|
|
82
|
+
<Text style={styles.buttonText}>Show Details</Text>
|
|
83
|
+
</TouchableOpacity>
|
|
84
|
+
</View>
|
|
85
|
+
</View>
|
|
86
|
+
);
|
|
87
|
+
<% } else { %>
|
|
70
88
|
return (
|
|
71
89
|
<View style={styles.container}>
|
|
72
90
|
<View style={styles.main}>
|
|
@@ -111,6 +129,49 @@ export default function Overview() {
|
|
|
111
129
|
shadowRadius: 3.84,
|
|
112
130
|
},
|
|
113
131
|
}));
|
|
132
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
133
|
+
const stylesheet = createStyleSheet({
|
|
134
|
+
button: {
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
backgroundColor: "#6366F1",
|
|
137
|
+
borderRadius: 24,
|
|
138
|
+
elevation: 5,
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
justifyContent: "center",
|
|
141
|
+
padding: 16,
|
|
142
|
+
shadowColor: "#000",
|
|
143
|
+
shadowOffset: {
|
|
144
|
+
height: 2,
|
|
145
|
+
width: 0
|
|
146
|
+
},
|
|
147
|
+
shadowOpacity: 0.25,
|
|
148
|
+
shadowRadius: 3.84
|
|
149
|
+
},
|
|
150
|
+
buttonText: {
|
|
151
|
+
color: "#FFFFFF",
|
|
152
|
+
fontSize: 16,
|
|
153
|
+
fontWeight: "600",
|
|
154
|
+
textAlign: "center",
|
|
155
|
+
},
|
|
156
|
+
container: {
|
|
157
|
+
flex: 1,
|
|
158
|
+
padding: 24,
|
|
159
|
+
},
|
|
160
|
+
main: {
|
|
161
|
+
flex: 1,
|
|
162
|
+
maxWidth: 960,
|
|
163
|
+
marginHorizontal: "auto",
|
|
164
|
+
justifyContent: "space-between",
|
|
165
|
+
},
|
|
166
|
+
title: {
|
|
167
|
+
fontSize: 64,
|
|
168
|
+
fontWeight: "bold",
|
|
169
|
+
},
|
|
170
|
+
subtitle: {
|
|
171
|
+
color: "#38434D",
|
|
172
|
+
fontSize: 36,
|
|
173
|
+
}
|
|
174
|
+
});
|
|
114
175
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
115
176
|
const styles = StyleSheet.create({
|
|
116
177
|
button: {
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
import { YStack, H2, Separator, Theme } from "tamagui";
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
6
6
|
import { Box, Text, makeStyles } from 'theme';
|
|
7
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
8
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
9
|
+
import { Text, View } from "react-native";
|
|
7
10
|
<% } else { %>
|
|
8
11
|
import { StyleSheet, Text, View } from "react-native";
|
|
9
12
|
<% } %>
|
|
@@ -29,6 +32,15 @@ export default function TabTwoScreen() {
|
|
|
29
32
|
</YStack>
|
|
30
33
|
</Theme>
|
|
31
34
|
);
|
|
35
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
36
|
+
const { styles } = useStyles(stylesheet)
|
|
37
|
+
return (
|
|
38
|
+
<View style={styles.container}>
|
|
39
|
+
<Text style={styles.title}>Tab Two</Text>
|
|
40
|
+
<View style={styles.separator} />
|
|
41
|
+
<EditScreenInfo path="src/screens/two.tsx" />
|
|
42
|
+
</View>
|
|
43
|
+
);
|
|
32
44
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
33
45
|
const styles = useStyles();
|
|
34
46
|
|
|
@@ -66,6 +78,25 @@ export default function TabTwoScreen() {
|
|
|
66
78
|
width: '80%',
|
|
67
79
|
},
|
|
68
80
|
}));
|
|
81
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
82
|
+
const stylesheet = createStyleSheet({
|
|
83
|
+
container: {
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
flex: 1,
|
|
86
|
+
justifyContent: "center",
|
|
87
|
+
},
|
|
88
|
+
separator: {
|
|
89
|
+
backgroundColor: "gray",
|
|
90
|
+
height: 1,
|
|
91
|
+
marginVertical: 30,
|
|
92
|
+
opacity: 0.25,
|
|
93
|
+
width: "80%",
|
|
94
|
+
},
|
|
95
|
+
title: {
|
|
96
|
+
fontSize: 20,
|
|
97
|
+
fontWeight: "bold",
|
|
98
|
+
}
|
|
99
|
+
});
|
|
69
100
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
70
101
|
const styles = StyleSheet.create({
|
|
71
102
|
container: {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const lightTheme = {
|
|
2
|
+
colors: {
|
|
3
|
+
background: '#ffffff',
|
|
4
|
+
azureRadiance: '#007AFF',
|
|
5
|
+
limedSpruce: '#38434D',
|
|
6
|
+
cornflowerBlue: '#6366F1'
|
|
7
|
+
},
|
|
8
|
+
margins: {
|
|
9
|
+
sm: 2,
|
|
10
|
+
md: 4,
|
|
11
|
+
lg: 8,
|
|
12
|
+
xl: 12
|
|
13
|
+
}
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export const darkTheme = {
|
|
17
|
+
colors: {
|
|
18
|
+
// define dark theme colors here
|
|
19
|
+
},
|
|
20
|
+
margins: {
|
|
21
|
+
sm: 2,
|
|
22
|
+
md: 4,
|
|
23
|
+
lg: 8,
|
|
24
|
+
xl: 12
|
|
25
|
+
}
|
|
26
|
+
} as const;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { breakpoints } from './breakpoints';
|
|
2
|
+
import { darkTheme, lightTheme } from './theme';
|
|
3
|
+
import { UnistylesRegistry } from 'react-native-unistyles';
|
|
4
|
+
|
|
5
|
+
type AppBreakpoints = typeof breakpoints;
|
|
6
|
+
|
|
7
|
+
// if you defined themes
|
|
8
|
+
type AppThemes = {
|
|
9
|
+
light: typeof lightTheme;
|
|
10
|
+
dark: typeof darkTheme;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// override library types
|
|
14
|
+
declare module 'react-native-unistyles' {
|
|
15
|
+
export interface UnistylesBreakpoints extends AppBreakpoints {}
|
|
16
|
+
export interface UnistylesThemes extends AppThemes {}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
UnistylesRegistry.addBreakpoints(breakpoints)
|
|
20
|
+
.addThemes({
|
|
21
|
+
light: lightTheme,
|
|
22
|
+
dark: darkTheme
|
|
23
|
+
// register other themes with unique names
|
|
24
|
+
})
|
|
25
|
+
.addConfig({
|
|
26
|
+
// you can pass here optional config described below
|
|
27
|
+
adaptiveThemes: true
|
|
28
|
+
});
|
package/build/types/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface CliFlags {
|
|
|
5
5
|
importAlias: string | boolean;
|
|
6
6
|
packageManager: PackageManager;
|
|
7
7
|
}
|
|
8
|
-
export declare const availablePackages: readonly ["@react-navigation/drawer", "expo-router", "expoRouter", "firebase", "nativewind", "react-navigation", "reactNavigation", "react-native-gesture-handler", "react-native-reanimated", "reactnavigation", "stylesheet", "supabase", "tamagui", "restyle"];
|
|
8
|
+
export declare const availablePackages: readonly ["@react-navigation/drawer", "expo-router", "expoRouter", "firebase", "nativewind", "react-navigation", "reactNavigation", "react-native-gesture-handler", "react-native-reanimated", "reactnavigation", "stylesheet", "supabase", "tamagui", "restyle", "unistyles"];
|
|
9
9
|
export type NavigationTypes = 'stack' | 'tabs' | 'drawer' | undefined;
|
|
10
10
|
export type PackageManager = 'yarn' | 'npm' | 'pnpm' | 'bun';
|
|
11
11
|
export type AvailablePackages = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Toolbox } from 'gluegun/build/types/domain/toolbox';
|
|
2
|
-
import { CliResults } from '../types';
|
|
3
|
-
export declare function printOutput(cliResults: CliResults, formattedFiles: any[], toolbox: Toolbox): Promise<void>;
|
|
2
|
+
import { AvailablePackages, CliResults } from '../types';
|
|
3
|
+
export declare function printOutput(cliResults: CliResults, formattedFiles: any[], toolbox: Toolbox, stylingPackage: AvailablePackages): Promise<void>;
|
package/build/types.js
CHANGED
|
@@ -15,6 +15,7 @@ exports.availablePackages = [
|
|
|
15
15
|
'stylesheet',
|
|
16
16
|
'supabase',
|
|
17
17
|
'tamagui',
|
|
18
|
-
'restyle'
|
|
18
|
+
'restyle',
|
|
19
|
+
'unistyles'
|
|
19
20
|
];
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBU2EsUUFBQSxpQkFBaUIsR0FBRztJQUMvQiwwQkFBMEI7SUFDMUIsYUFBYTtJQUNiLFlBQVk7SUFDWixVQUFVO0lBQ1YsWUFBWTtJQUNaLGtCQUFrQjtJQUNsQixpQkFBaUI7SUFDakIsOEJBQThCO0lBQzlCLHlCQUF5QjtJQUN6QixpQkFBaUI7SUFDakIsWUFBWTtJQUNaLFVBQVU7SUFDVixTQUFTO0lBQ1QsU0FBUztJQUNULFdBQVc7Q0FDSCxDQUFDIn0=
|