create-expo-stack 2.0.8 → 2.0.10
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/build/commands/create-expo-stack.js +6 -5
- package/build/templates/base/App.tsx.ejs +41 -0
- package/build/templates/base/app.json.ejs +43 -0
- package/build/templates/base/assets/adaptive-icon.png +0 -0
- package/build/templates/base/assets/favicon.png +0 -0
- package/build/templates/base/assets/icon.png +0 -0
- package/build/templates/base/assets/splash.png +0 -0
- package/build/templates/base/babel.config.js.ejs +17 -0
- package/build/templates/base/package.json.ejs +75 -0
- package/build/templates/base/tsconfig.json.ejs +16 -0
- package/build/templates/packages/expo-router/expo-env.d.ts +4 -0
- package/build/templates/packages/expo-router/index.ts +1 -0
- package/build/templates/packages/expo-router/metro.config.js +11 -0
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +56 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +58 -0
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +96 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +57 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +52 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +52 -0
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +15 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +55 -0
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +84 -0
- package/build/templates/packages/nativewind/app.d.ts +2 -0
- package/build/templates/packages/nativewind/tailwind.config.js.ejs +16 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +8 -0
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +99 -0
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +98 -0
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +62 -0
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +61 -0
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +57 -0
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +54 -0
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +97 -0
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +54 -0
- package/package.json +2 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useNavigation } from "@react-navigation/native";
|
|
2
|
+
import { StackNavigationProp } from "@react-navigation/stack";
|
|
3
|
+
<% if (props.useNativewind) { %>
|
|
4
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
5
|
+
<% } else { %>
|
|
6
|
+
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
7
|
+
<% } %>
|
|
8
|
+
import { RootStackParamList } from "../navigation";
|
|
9
|
+
|
|
10
|
+
type OverviewScreenNavigationProps = StackNavigationProp<RootStackParamList, "Overview">;
|
|
11
|
+
|
|
12
|
+
export default function Overview() {
|
|
13
|
+
const navigation = useNavigation<OverviewScreenNavigationProps>();
|
|
14
|
+
<% if (props.useNativewind) { %>
|
|
15
|
+
return (
|
|
16
|
+
<View className={styles.container}>
|
|
17
|
+
<View className={styles.main}>
|
|
18
|
+
<View>
|
|
19
|
+
<Text className={styles.title}>Hello World</Text>
|
|
20
|
+
<Text className={styles.subtitle}>This is the first page of your app.</Text>
|
|
21
|
+
</View>
|
|
22
|
+
<TouchableOpacity className={styles.button} onPress={() => navigation.navigate("Details", { name: "Dan" })}>
|
|
23
|
+
<Text className={styles.buttonText}>Show Details</Text>
|
|
24
|
+
</TouchableOpacity>
|
|
25
|
+
</View>
|
|
26
|
+
</View>
|
|
27
|
+
)
|
|
28
|
+
<% } else { %>
|
|
29
|
+
return (
|
|
30
|
+
<View style={styles.container}>
|
|
31
|
+
<View style={styles.main}>
|
|
32
|
+
<View>
|
|
33
|
+
<Text style={styles.title}>Hello World</Text>
|
|
34
|
+
<Text style={styles.subtitle}>This is the first page of your app.</Text>
|
|
35
|
+
</View>
|
|
36
|
+
<TouchableOpacity style={styles.button} onPress={() => navigation.navigate("Details", { name: "Dan" })}>
|
|
37
|
+
<Text style={styles.buttonText}>Show Details</Text>
|
|
38
|
+
</TouchableOpacity>
|
|
39
|
+
</View>
|
|
40
|
+
</View>
|
|
41
|
+
);
|
|
42
|
+
<% } %>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
<% if (props.useNativewind) { %>
|
|
46
|
+
const styles = {
|
|
47
|
+
button: "items-center bg-indigo-500 rounded-[28px] shadow-md p-4",
|
|
48
|
+
buttonText: "text-white text-lg font-semibold text-center",
|
|
49
|
+
container: "flex-1 p-6",
|
|
50
|
+
main: "flex-1 max-w-[960] justify-between",
|
|
51
|
+
title: "text-[64px] font-bold",
|
|
52
|
+
subtitle: "text-4xl text-gray-700",
|
|
53
|
+
};
|
|
54
|
+
<% } else { %>
|
|
55
|
+
const styles = StyleSheet.create({
|
|
56
|
+
button: {
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
backgroundColor: "#6366F1",
|
|
59
|
+
borderRadius: 24,
|
|
60
|
+
elevation: 5,
|
|
61
|
+
flexDirection: "row",
|
|
62
|
+
justifyContent: "center",
|
|
63
|
+
padding: 16,
|
|
64
|
+
shadowColor: "#000",
|
|
65
|
+
shadowOffset: {
|
|
66
|
+
height: 2,
|
|
67
|
+
width: 0
|
|
68
|
+
},
|
|
69
|
+
shadowOpacity: 0.25,
|
|
70
|
+
shadowRadius: 3.84
|
|
71
|
+
},
|
|
72
|
+
buttonText: {
|
|
73
|
+
color: "#FFFFFF",
|
|
74
|
+
fontSize: 16,
|
|
75
|
+
fontWeight: "600",
|
|
76
|
+
textAlign: "center",
|
|
77
|
+
},
|
|
78
|
+
container: {
|
|
79
|
+
flex: 1,
|
|
80
|
+
padding: 24,
|
|
81
|
+
},
|
|
82
|
+
main: {
|
|
83
|
+
flex: 1,
|
|
84
|
+
maxWidth: 960,
|
|
85
|
+
marginHorizontal: "auto",
|
|
86
|
+
justifyContent: "space-between",
|
|
87
|
+
},
|
|
88
|
+
title: {
|
|
89
|
+
fontSize: 64,
|
|
90
|
+
fontWeight: "bold",
|
|
91
|
+
},
|
|
92
|
+
subtitle: {
|
|
93
|
+
color: "#38434D",
|
|
94
|
+
fontSize: 36,
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
<% } %>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<% if (props.useNativewind) { %>
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
<% } else { %>
|
|
4
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
5
|
+
<% } %>
|
|
6
|
+
|
|
7
|
+
import EditScreenInfo from "../components/edit-screen-info";
|
|
8
|
+
|
|
9
|
+
export default function TabOneScreen() {
|
|
10
|
+
<% if (props.useNativewind) { %>
|
|
11
|
+
return (
|
|
12
|
+
<View className={styles.container}>
|
|
13
|
+
<Text className={styles.title}>Tab One</Text>
|
|
14
|
+
<View className={styles.separator} />
|
|
15
|
+
<EditScreenInfo path="src/screens/one.tsx" />
|
|
16
|
+
</View>
|
|
17
|
+
);
|
|
18
|
+
<% } else { %>
|
|
19
|
+
return (
|
|
20
|
+
<View style={styles.container}>
|
|
21
|
+
<Text style={styles.title}>Tab Two</Text>
|
|
22
|
+
<View style={styles.separator} />
|
|
23
|
+
<EditScreenInfo path="src/screens/two.tsx" />
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
<% } %>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
<% if (props.useNativewind) { %>
|
|
30
|
+
const styles = {
|
|
31
|
+
container: "items-center flex-1 justify-center",
|
|
32
|
+
separator: "h-[1px] my-7 w-4/5 bg-gray-200",
|
|
33
|
+
title: "text-xl font-bold"
|
|
34
|
+
};
|
|
35
|
+
<% } else { %>
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
container: {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
flex: 1,
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
},
|
|
42
|
+
separator: {
|
|
43
|
+
backgroundColor: "gray",
|
|
44
|
+
height: 1,
|
|
45
|
+
marginVertical: 30,
|
|
46
|
+
opacity: 0.25,
|
|
47
|
+
width: "80%",
|
|
48
|
+
},
|
|
49
|
+
title: {
|
|
50
|
+
fontSize: 20,
|
|
51
|
+
fontWeight: "bold",
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
<% } %>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-expo-stack",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "create-expo-stack CLI",
|
|
5
5
|
"private": false,
|
|
6
6
|
"types": "build/types/types.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"clean-build": "rm -rf ./build",
|
|
16
16
|
"compile": "tsc -p .",
|
|
17
|
-
"copy-templates": "copyfiles ./src/templates
|
|
17
|
+
"copy-templates": "copyfiles -u 2 \"./src/templates/**/*\" ./build/templates",
|
|
18
18
|
"build": "yarn clean-build && yarn compile && yarn copy-templates && yarn lint-templates",
|
|
19
19
|
"prepublishOnly": "yarn build",
|
|
20
20
|
"format": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix && prettier \"**/*.{js,jsx,ts,tsx,json}\" --write",
|