create-expo-stack 2.1.10 → 2.1.11

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 (34) hide show
  1. package/build/commands/create-expo-stack.js +9 -5
  2. package/build/templates/base/App.tsx.ejs +26 -2
  3. package/build/templates/base/babel.config.js.ejs +11 -1
  4. package/build/templates/base/package.json.ejs +13 -2
  5. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +16 -4
  6. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +15 -4
  7. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +20 -4
  8. package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +15 -5
  9. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +14 -4
  10. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +10 -0
  11. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +15 -4
  12. package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +22 -4
  13. package/build/templates/packages/react-navigation/App.tsx.ejs +12 -3
  14. package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +3 -3
  15. package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +10 -4
  16. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +15 -4
  17. package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +15 -4
  18. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +14 -4
  19. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +18 -4
  20. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +14 -4
  21. package/build/templates/packages/tamagui/tamagui.config.ts.ejs +102 -0
  22. package/build/types/types.d.ts +1 -1
  23. package/build/types/utilities/configureProjectFiles.d.ts +1 -1
  24. package/build/types/utilities/generateProjectFiles.d.ts +1 -1
  25. package/build/types/utilities/getPackageManager.d.ts +1 -1
  26. package/build/types.js +2 -2
  27. package/build/utilities/configureProjectFiles.js +12 -3
  28. package/build/utilities/generateProjectFiles.js +7 -4
  29. package/build/utilities/getPackageManager.js +6 -4
  30. package/build/utilities/printOutput.js +6 -1
  31. package/build/utilities/runCLI.js +17 -6
  32. package/build/utilities/runIgnite.js +4 -3
  33. package/package.json +1 -1
  34. package/readme.md +8 -17
@@ -42,7 +42,7 @@ var command = {
42
42
  name: 'create-expo-stack',
43
43
  description: 'Create a new Expo project',
44
44
  run: function (toolbox) { return __awaiter(void 0, void 0, void 0, function () {
45
- var _a, first, options, _b, info, highlight, warning, cliResults, useDefault, skipCLI, useBlankTypescript, packages, useNativewind, navigationPackage, files, formattedFiles, error_1;
45
+ var _a, first, options, _b, info, highlight, warning, cliResults, useDefault, skipCLI, useBlankTypescript, packages, navigationPackage, stylingPackage, files, formattedFiles, error_1;
46
46
  return __generator(this, function (_c) {
47
47
  switch (_c.label) {
48
48
  case 0:
@@ -103,17 +103,21 @@ var command = {
103
103
  // Add nativewind package
104
104
  cliResults.packages.push({ name: "nativewind", type: 'styling', options: {} });
105
105
  }
106
+ if (options.tamagui) {
107
+ // Add tamagui package
108
+ cliResults.packages.push({ name: "tamagui", type: 'styling', options: {} });
109
+ }
106
110
  // Destructure the results but set the projectName if the first param is passed in
107
111
  if (first) {
108
112
  cliResults.projectName = first;
109
113
  }
110
114
  packages = cliResults.packages;
111
- useNativewind = (0, utilities_1.usePackage)("nativewind", packages);
112
115
  navigationPackage = packages.find(function (p) { return p.type === "navigation"; }) || undefined;
116
+ stylingPackage = packages.find(function (p) { return p.type === "styling"; });
113
117
  files = [];
114
- files = (0, utilities_1.configureProjectFiles)(files, navigationPackage, useNativewind);
118
+ files = (0, utilities_1.configureProjectFiles)(files, navigationPackage, stylingPackage);
115
119
  formattedFiles = [];
116
- formattedFiles = (0, utilities_1.generateProjectFiles)(cliResults, files, formattedFiles, navigationPackage, toolbox, useNativewind);
120
+ formattedFiles = (0, utilities_1.generateProjectFiles)(cliResults, files, formattedFiles, navigationPackage, toolbox, stylingPackage);
117
121
  return [4 /*yield*/, (0, utilities_1.printOutput)(cliResults, formattedFiles, toolbox)];
118
122
  case 8:
119
123
  _c.sent();
@@ -133,4 +137,4 @@ var command = {
133
137
  }); },
134
138
  };
135
139
  exports.default = command;
136
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWV4cG8tc3RhY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29tbWFuZHMvY3JlYXRlLWV4cG8tc3RhY2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFQSwwQ0FTc0I7QUFDdEIsMENBQThDO0FBRzlDLElBQU0sT0FBTyxHQUFtQjtJQUM5QixJQUFJLEVBQUUsbUJBQW1CO0lBQ3pCLFdBQVcsRUFBRSwyQkFBMkI7SUFDeEMsR0FBRyxFQUFFLFVBQU8sT0FBTzs7Ozs7b0JBRWYsS0FFRSxPQUFPLFdBRnFCLEVBQWhCLEtBQUssV0FBQSxFQUFFLE9BQU8sYUFBQSxFQUM1QixLQUNFLE9BQU8sTUFEMEIsRUFBMUIsSUFBSSxVQUFBLEVBQUUsU0FBUyxlQUFBLEVBQUUsT0FBTyxhQUFBLENBQ3ZCO29CQUNaLElBQUksT0FBTyxDQUFDLElBQUksSUFBSSxPQUFPLENBQUMsQ0FBQyxFQUFFO3dCQUM3QixJQUFBLG9CQUFRLEVBQUMsSUFBSSxFQUFFLFNBQVMsRUFBRSxPQUFPLENBQUMsQ0FBQTt3QkFFbEMsc0JBQU87cUJBQ1I7Ozs7b0JBRUMscUJBQU0sSUFBQSx1QkFBVyxFQUFDLE9BQU8sQ0FBQyxFQUFBOztvQkFBMUIsU0FBMEIsQ0FBQztvQkFFM0IsMERBQTBEO29CQUMxRCw0RUFBNEU7b0JBQzVFLHFCQUFNLElBQUks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0FBYyxHQUFVLEVBQUUsQ0FBQztvQkFFL0IsY0FBYyxHQUFHLElBQUEsZ0NBQW9CLEVBQ25DLFVBQVUsRUFDVixLQUFLLEVBQ0wsY0FBYyxFQUNkLGlCQUFpQixFQUNqQixPQUFPLEVBQ1AsY0FBYyxDQUNmLENBQUM7b0JBRUYscUJBQU0sSUFBQSx1QkFBVyxFQUFDLFVBQVUsRUFBRSxjQUFjLEVBQUUsT0FBTyxDQUFDLEVBQUE7O29CQUF0RCxTQUFzRCxDQUFDOzs7OztvQkFJekQseUJBQXlCO29CQUV6QixJQUFJLENBQUMscUVBQTJELENBQUMsQ0FBQTtvQkFDakUsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFBO29CQUNSLElBQUksQ0FBQyxpQkFBVSxPQUFLLENBQUUsQ0FBQyxDQUFBO29CQUN2QixJQUFJLENBQ0YsMkhBQTJILENBQzVILENBQUE7Ozs7O1NBRUo7Q0FDRixDQUFBO0FBRUQsa0JBQWUsT0FBTyxDQUFDIn0=
@@ -1,13 +1,19 @@
1
1
  import React from 'react';
2
2
 
3
- <% if (props.useNativewind) {%>
3
+ <% if (props.stylingPackage?.name === "nativewind") {%>
4
4
  import { Text, View } from 'react-native';
5
+ <% } else if (props.stylingPackage?.name === "tamagui") {%>
6
+ import { View } from 'react-native';
7
+ import { TamaguiProvider, Text, styled } from 'tamagui';
8
+
9
+ import config from './tamagui.config'
5
10
  <% } else {%>
6
11
  import { StyleSheet, Text, View } from 'react-native';
7
12
  <% } %>
13
+
8
14
  import { StatusBar } from 'expo-status-bar';
9
15
 
10
- <% if (props.useNativewind) {%>
16
+ <% if (props.stylingPackage?.name === "nativewind") {%>
11
17
  export default function App() {
12
18
  return (
13
19
  <View className={styles.container} %>>
@@ -20,6 +26,24 @@ import { StatusBar } from 'expo-status-bar';
20
26
  const styles = {
21
27
  container: 'flex flex-1 items-center justify-center bg-white',
22
28
  };
29
+ <% } else if (props.stylingPackage?.name === "tamagui") {%>
30
+ const MyView = styled(View, {
31
+ name: "MyView",
32
+ flex: 1,
33
+ alignItems: 'center',
34
+ justifyContent: 'center',
35
+ });
36
+
37
+ export default function App() {
38
+ return (
39
+ <TamaguiProvider config={config}>
40
+ <MyView %>>
41
+ <Text>Open up App.tsx to start working on your app!</Text>
42
+ <StatusBar style="auto" />
43
+ </MyView>
44
+ </TamaguiProvider>
45
+ );
46
+ }
23
47
  <% } else {%>
24
48
  export default function App() {
25
49
  return (
@@ -2,10 +2,20 @@ module.exports = function(api) {
2
2
  api.cache(true);
3
3
  let plugins = [];
4
4
 
5
- <% if (props.useNativewind) { %>
5
+ <% if (props.stylingPackage?.name === "nativewind") { %>
6
6
  plugins.push('nativewind/babel');
7
7
  <% } %>
8
8
 
9
+ <% if (props.stylingPackage?.name === "tamagui") { %>
10
+ plugins.push([
11
+ '@tamagui/babel-plugin',
12
+ {
13
+ components: ['@my/ui', 'tamagui'],
14
+ config: './tamagui.config.ts',
15
+ },
16
+ ]);
17
+ <% } %>
18
+
9
19
  <% if (props.navigationPackage?.name === 'expo-router') { %>
10
20
  plugins.push('expo-router/babel');
11
21
  <% } %>
@@ -9,10 +9,18 @@
9
9
  "web": "expo start --web"
10
10
  },
11
11
  "dependencies": {
12
- <% if (props.useNativewind) { %>
12
+ <% if (props.stylingPackage?.name === "nativewind") { %>
13
13
  "nativewind": "^2.0.11",
14
14
  <% } %>
15
15
 
16
+ <% if (props.stylingPackage?.name === "tamagui") { %>
17
+ "tamagui": "1.74.8",
18
+ "@tamagui/font-inter": "1.74.8",
19
+ "@tamagui/shorthands": "1.74.8",
20
+ "@tamagui/themes": "1.74.8",
21
+ "@tamagui/react-native-media-driver": "1.74.8",
22
+ <% } %>
23
+
16
24
  <% if (props.navigationPackage?.type === "navigation") { %>
17
25
  "@react-navigation/native": "^6.1.7",
18
26
  "react-native-gesture-handler": "~2.12.0",
@@ -51,9 +59,12 @@
51
59
  "eslint": "^8.50.0",
52
60
  "eslint-config-universe": "^12.0.0",
53
61
  "prettier": "^3.0.3",
54
- <% if (props.useNativewind) { %>
62
+ <% if (props.stylingPackage?.name === "nativewind") { %>
55
63
  "tailwindcss": "3.3.2",
56
64
  <% } %>
65
+ <% if (props.stylingPackage?.name === "tamagui") { %>
66
+ "@tamagui/babel-plugin": "1.74.8",
67
+ <% } %>
57
68
  "typescript": "^5.1.3"
58
69
  },
59
70
  "eslintConfig": {
@@ -1,14 +1,16 @@
1
1
  import { Feather } from "@expo/vector-icons";
2
2
  import { Stack, useRouter } from "expo-router";
3
- <% if (props.useNativewind) { %>
3
+ <% if (props.stylingPackage?.name === "nativewind") { %>
4
4
  import { Text, TouchableOpacity, View } from "react-native";
5
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
6
+ import { TamaguiProvider, Button } from "tamagui";
5
7
  <% } else { %>
6
8
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
7
9
  <% } %>
8
10
 
9
11
  export default function Layout() {
10
12
  const router = useRouter();
11
- <% if (props.useNativewind) { %>
13
+ <% if (props.stylingPackage?.name === "nativewind") { %>
12
14
  const BackButton = () => (
13
15
  <TouchableOpacity onPress={router.back}>
14
16
  <View className={styles.backButton}>
@@ -17,6 +19,10 @@ export default function Layout() {
17
19
  </View>
18
20
  </TouchableOpacity>
19
21
  );
22
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
23
+ const BackButton = () => {
24
+ <Button onPress={router.back} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}>Back</Button>
25
+ }
20
26
  <% } else { %>
21
27
  const BackButton = () => (
22
28
  <TouchableOpacity onPress={router.back}>
@@ -29,21 +35,27 @@ export default function Layout() {
29
35
  <% } %>
30
36
 
31
37
  return (
38
+ <% if (props.stylingPackage?.name === "tamagui") { %>
39
+ <TamaguiProvider config={config}>
40
+ <% } %>
32
41
  <Stack>
33
42
  <Stack.Screen name="index" options={{ title: "Overview" }} />
34
43
  <Stack.Screen name="details"
35
44
  options={{ title: "Details", headerLeft: () => <BackButton /> }}
36
45
  />
37
46
  </Stack>
47
+ <% if (props.stylingPackage?.name === "tamagui") { %>
48
+ </TamaguiProvider>
49
+ <% } %>
38
50
  );
39
51
  }
40
52
 
41
- <% if (props.useNativewind) { %>
53
+ <% if (props.stylingPackage?.name === "nativewind") { %>
42
54
  const styles = {
43
55
  backButton: "flex-row",
44
56
  backButtonText: "text-blue-500 ml-1",
45
57
  };
46
- <% } else { %>
58
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
47
59
  const styles = StyleSheet.create({
48
60
  backButton: {
49
61
  flexDirection: "row",
@@ -1,5 +1,7 @@
1
- <% if (props.useNativewind) { %>
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
2
  import { View, Text } from "react-native";
3
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
+ import { YStack, H2, Paragraph } from "tamagui";
3
5
  <% } else { %>
4
6
  import { StyleSheet, View, Text } from "react-native";
5
7
  <% } %>
@@ -7,7 +9,7 @@ import { useLocalSearchParams } from "expo-router";
7
9
 
8
10
  export default function Details() {
9
11
  const { name } = useLocalSearchParams();
10
- <% if (props.useNativewind) { %>
12
+ <% if (props.stylingPackage?.name === "nativewind") { %>
11
13
  return (
12
14
  <View className={styles.container}>
13
15
  <View className={styles.main}>
@@ -16,6 +18,15 @@ export default function Details() {
16
18
  </View>
17
19
  </View>
18
20
  );
21
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
22
+ return (
23
+ <YStack flex={1} p="$2">
24
+ <YStack flex={1} maxWidth={960}>
25
+ <H2>Details</H2>
26
+ <Paragraph theme="alt1">Showing details for user {name}.</Paragraph>
27
+ </YStack>
28
+ </YStack>
29
+ );
19
30
  <% } else { %>
20
31
  return (
21
32
  <View style={styles.container}>
@@ -28,14 +39,14 @@ export default function Details() {
28
39
  <% } %>
29
40
  }
30
41
 
31
- <% if (props.useNativewind) { %>
42
+ <% if (props.stylingPackage?.name === "nativewind") { %>
32
43
  const styles = {
33
44
  container: "flex-1 p-6",
34
45
  main: "flex-1 max-w-[960]",
35
46
  title: "text-[64px] font-bold",
36
47
  subtitle: "text-4xl text-gray-700",
37
48
  };
38
- <% } else { %>
49
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
39
50
  const styles = StyleSheet.create({
40
51
  container: {
41
52
  flex: 1,
@@ -1,12 +1,14 @@
1
- <% if (props.useNativewind) { %>
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
2
  import { Text, TouchableOpacity, View } from "react-native";
3
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
+ import { YStack, H2, Paragraph } from "tamagui"
3
5
  <% } else { %>
4
6
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
5
7
  <% } %>
6
8
  import { Link } from "expo-router";
7
9
 
8
10
  export default function Page() {
9
- <% if (props.useNativewind) { %>
11
+ <% if (props.stylingPackage?.name === "nativewind") { %>
10
12
  return (
11
13
  <View className={styles.container}>
12
14
  <View className={styles.main}>
@@ -22,6 +24,20 @@ export default function Page() {
22
24
  </View>
23
25
  </View>
24
26
  );
27
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
28
+ return (
29
+ <YStack flex={1} padding="$3">
30
+ <YStack flex={1} mawidth="{960}" justifyContent="space-between">
31
+ <YStack>
32
+ <H2>Hello World</H2>
33
+ <Paragraph>This is the first page of your app.</Paragraph>
34
+ </YStack>
35
+ <Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
36
+ <Button>Show Details</Button>
37
+ </Link>
38
+ </YStack>
39
+ </YStack>
40
+ )
25
41
  <% } else { %>
26
42
  return (
27
43
  <View style={styles.container}>
@@ -41,7 +57,7 @@ export default function Page() {
41
57
  <% } %>
42
58
  }
43
59
 
44
- <% if (props.useNativewind) { %>
60
+ <% if (props.stylingPackage?.name === "nativewind") { %>
45
61
  const styles = {
46
62
  button: "items-center bg-indigo-500 rounded-[28px] shadow-md p-4",
47
63
  buttonText: "text-white text-lg font-semibold text-center",
@@ -50,7 +66,7 @@ export default function Page() {
50
66
  title: "text-[64px] font-bold",
51
67
  subtitle: "text-4xl text-gray-700",
52
68
  };
53
- <% } else { %>
69
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
54
70
  const styles = StyleSheet.create({
55
71
  button: {
56
72
  alignItems: "center",
@@ -1,5 +1,7 @@
1
- <% if (props.useNativewind) { %>
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
2
  import { Text, View } from "react-native";
3
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
+ import { YStack, H2, Separator } from "tamagui";
3
5
  <% } else { %>
4
6
  import { StyleSheet, Text, View } from "react-native";
5
7
  <% } %>
@@ -7,7 +9,7 @@
7
9
  import EditScreenInfo from "../../components/edit-screen-info";
8
10
 
9
11
  export default function TabOneScreen() {
10
- <% if (props.useNativewind) { %>
12
+ <% if (props.stylingPackage?.name === "nativewind") { %>
11
13
  return (
12
14
  <View className={styles.container}>
13
15
  <Text className={styles.title}>Tab One</Text>
@@ -15,7 +17,15 @@ export default function TabOneScreen() {
15
17
  <EditScreenInfo path="app/(tabs)/index.tsx" />
16
18
  </View>
17
19
  );
18
- <% } else { %>
20
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
21
+ return (
22
+ <YStack flex={1} alignItems="center" justifyContent="center">
23
+ <H2>Tab One</H2>
24
+ <Separator />
25
+ <EditScreenInfo path="app/(tabs)/index.tsx" />
26
+ </YStack>
27
+ );
28
+ <% } else { %>
19
29
  return (
20
30
  <View style={styles.container}>
21
31
  <Text style={styles.title}>Tab One</Text>
@@ -26,13 +36,13 @@ export default function TabOneScreen() {
26
36
  <% } %>
27
37
  }
28
38
 
29
- <% if (props.useNativewind) { %>
39
+ <% if (props.stylingPackage?.name === "nativewind") { %>
30
40
  const styles = {
31
41
  container: `items-center flex-1 justify-center`,
32
42
  separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
33
43
  title: `text-xl font-bold`
34
44
  };
35
- <% } else { %>
45
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
36
46
  const styles = StyleSheet.create({
37
47
  container: {
38
48
  alignItems: "center",
@@ -1,5 +1,7 @@
1
- <% if (props.useNativewind) { %>
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
2
  import { Text, View } from "react-native";
3
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
+ import { YStack, H2, Separator } from "tamagui";
3
5
  <% } else { %>
4
6
  import { StyleSheet, Text, View } from "react-native";
5
7
  <% } %>
@@ -7,7 +9,7 @@
7
9
  import EditScreenInfo from "../../components/edit-screen-info";
8
10
 
9
11
  export default function TabTwoScreen() {
10
- <% if (props.useNativewind) { %>
12
+ <% if (props.stylingPackage?.name === "nativewind") { %>
11
13
  return (
12
14
  <View className={styles.container}>
13
15
  <Text className={styles.title}>Tab Two</Text>
@@ -15,6 +17,14 @@ export default function TabTwoScreen() {
15
17
  <EditScreenInfo path="app/(tabs)/index.tsx" />
16
18
  </View>
17
19
  );
20
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
21
+ return (
22
+ <YStack flex={1} alignItems="center" justifyContent="center">
23
+ <H2>Tab Two</H2>
24
+ <Separator />
25
+ <EditScreenInfo path="app/(tabs)/index.tsx" />
26
+ </YStack>
27
+ );
18
28
  <% } else { %>
19
29
  return (
20
30
  <View style={styles.container}>
@@ -26,13 +36,13 @@ export default function TabTwoScreen() {
26
36
  <% } %>
27
37
  }
28
38
 
29
- <% if (props.useNativewind) { %>
39
+ <% if (props.stylingPackage?.name === "nativewind") { %>
30
40
  const styles = {
31
41
  container: `items-center flex-1 justify-center`,
32
42
  separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
33
43
  title: `text-xl font-bold`
34
44
  };
35
- <% } else { %>
45
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
36
46
  const styles = StyleSheet.create({
37
47
  container: {
38
48
  alignItems: "center",
@@ -1,4 +1,8 @@
1
1
  import { Stack } from "expo-router";
2
+ <% if (props.stylingPackage?.name === "tamagui") { %>
3
+ import { TamaguiProvider } from 'tamagui'
4
+ import { config } from './tamagui.config'
5
+ <% } %>
2
6
 
3
7
  export const unstable_settings = {
4
8
  // Ensure that reloading on `/modal` keeps a back button present.
@@ -7,9 +11,15 @@ export const unstable_settings = {
7
11
 
8
12
  export default function RootLayout() {
9
13
  return (
14
+ <% if (props.stylingPackage?.name === "tamagui") { %>
15
+ <TamaguiProvider config={config}>
16
+ <% } %>
10
17
  <Stack>
11
18
  <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
12
19
  <Stack.Screen name="modal" options={{ presentation: "modal" }} />
13
20
  </Stack>
21
+ <% if (props.stylingPackage?.name === "tamagui") { %>
22
+ </TamaguiProvider>
23
+ <% } %>
14
24
  );
15
25
  }
@@ -1,5 +1,7 @@
1
- <% if (props.useNativewind) { %>
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
2
  import { Platform, Text, View } from "react-native";
3
+ <% } else if (props.stylingPackage?.name === "nativewind") { %>
4
+ import { YStack, Paragraph, Separator } from "tamagui";
3
5
  <% } else { %>
4
6
  import { Platform, StyleSheet, Text, View } from "react-native";
5
7
  <% } %>
@@ -8,7 +10,7 @@ import { StatusBar } from "expo-status-bar";
8
10
  import EditScreenInfo from "../components/edit-screen-info";
9
11
 
10
12
  export default function ModalScreen() {
11
- <% if (props.useNativewind) { %>
13
+ <% if (props.stylingPackage?.name === "nativewind") { %>
12
14
  return (
13
15
  <View className={styles.container}>
14
16
  <StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
@@ -17,6 +19,15 @@ export default function ModalScreen() {
17
19
  <EditScreenInfo path="app/modal.tsx" />
18
20
  </View>
19
21
  );
22
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
23
+ return (
24
+ <YStack flex={1} alignItems="center" justifyContent="center">
25
+ <StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
26
+ <Paragraph>Modal</Paragraph>
27
+ <Separator />
28
+ <EditScreenInfo path="app/modal.tsx" />
29
+ </YStack>
30
+ );
20
31
  <% } else { %>
21
32
  return (
22
33
  <View style={styles.container}>
@@ -29,13 +40,13 @@ export default function ModalScreen() {
29
40
  <% } %>
30
41
  }
31
42
 
32
- <% if (props.useNativewind) { %>
43
+ <% if (props.stylingPackage?.name === "nativewind") { %>
33
44
  const styles = {
34
45
  container: `items-center flex-1 justify-center`,
35
46
  separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
36
47
  title: `text-xl font-bold`
37
48
  };
38
- <% } else { %>
49
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
39
50
  const styles = StyleSheet.create({
40
51
  container: {
41
52
  alignItems: "center",
@@ -1,12 +1,14 @@
1
1
  import React from "react";
2
- <% if (props.useNativewind) { %>
2
+ <% if (props.stylingPackage?.name === "nativewind") { %>
3
3
  import { Text, View } from "react-native";
4
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
5
+ import { YStack, H4, Paragraph } from "tamagui"
4
6
  <% } else { %>
5
7
  import { StyleSheet, Text, View } from "react-native";
6
8
  <% } %>
7
9
 
8
10
  export default function EditScreenInfo({ path }: { path: string }) {
9
- <% if (props.useNativewind) { %>
11
+ <% if (props.stylingPackage?.name === "nativewind") { %>
10
12
  return (
11
13
  <View>
12
14
  <View className={styles.getStartedContainer}>
@@ -22,6 +24,22 @@ export default function EditScreenInfo({ path }: { path: string }) {
22
24
  </View>
23
25
  </View>
24
26
  );
27
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
28
+ return (
29
+ <YStack>
30
+ <YStack alignItems="center" mx="$6">
31
+ <H4>
32
+ Open up the code for this screen:
33
+ </H4>
34
+ <YStack borderRadius="$3" my="$1">
35
+ <Paragraph>{path}</Paragraph>
36
+ </YStack>
37
+ <Paragraph>
38
+ Change any of the text, save the file, and your app will automatically update.
39
+ </Paragraph>
40
+ </YStack>
41
+ </YStack>
42
+ );
25
43
  <% } else { %>
26
44
  return (
27
45
  <View>
@@ -41,7 +59,7 @@ export default function EditScreenInfo({ path }: { path: string }) {
41
59
  <% } %>
42
60
  }
43
61
 
44
- <% if (props.useNativewind) { %>
62
+ <% if (props.stylingPackage?.name === "nativewind") { %>
45
63
  const styles = {
46
64
  codeHighlightContainer: `rounded-md px-1`,
47
65
  getStartedContainer: `items-center mx-12`,
@@ -51,7 +69,7 @@ export default function EditScreenInfo({ path }: { path: string }) {
51
69
  helpLinkText: `text-center`,
52
70
  homeScreenFilename: `my-2`,
53
71
  };
54
- <% } else { %>
72
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
55
73
  const styles = StyleSheet.create({
56
74
  codeHighlightContainer: {
57
75
  borderRadius: 3,
@@ -1,8 +1,17 @@
1
1
  import "react-native-gesture-handler";
2
2
  import RootStack from "./src/navigation";
3
-
3
+ <% if (props.stylingPackage?.name === "tamagui") { %>
4
+ import { TamaguiProvider } from 'tamagui'
5
+ import { config } from './tamagui.config'
6
+ <% } %>
4
7
  export default function App() {
5
8
  return (
6
- <RootStack />
9
+ <% if (props.stylingPackage?.name === "tamagui") { %>
10
+ <TamaguiProvider config={config}>
11
+ <% } %>
12
+ <RootStack />
13
+ <% if (props.stylingPackage?.name === "tamagui") { %>
14
+ </TamaguiProvider>
15
+ <% } %>
7
16
  );
8
- }
17
+ }
@@ -1,11 +1,11 @@
1
1
  import React from "react";
2
- <% if (props.useNativewind) { %>
2
+ <% if (props.stylingPackage?.name === "nativewind") { %>
3
3
  import { Text, View } from "react-native";
4
4
  <% } else { %>
5
5
  import { StyleSheet, Text, View } from "react-native";
6
6
  <% } %>
7
7
 
8
- <% if (props.useNativewind) { %>
8
+ <% if (props.stylingPackage?.name === "nativewind") { %>
9
9
  export default function EditScreenInfo({ path }: { path: string }) {
10
10
  return (
11
11
  <View>
@@ -57,7 +57,7 @@ import React from "react";
57
57
  }
58
58
  <% } %>
59
59
 
60
- <% if (props.useNativewind) { %>
60
+ <% if (props.stylingPackage?.name === "nativewind") { %>
61
61
  const styles = {
62
62
  codeHighlightContainer: "rounded-md px-1 my-2",
63
63
  getStartedContainer: "items-center mx-12",
@@ -2,7 +2,7 @@
2
2
  import { Feather } from "@expo/vector-icons";
3
3
  import { NavigationContainer } from "@react-navigation/native";
4
4
  import { createStackNavigator } from "@react-navigation/stack";
5
- <% if (props.useNativewind) { %>
5
+ <% if (props.stylingPackage?.name === "nativewind") { %>
6
6
  import { Text, View } from "react-native";
7
7
  <% } else { %>
8
8
  import { Text, View, StyleSheet } from "react-native";
@@ -26,7 +26,7 @@
26
26
  <Stack.Screen
27
27
  name="Details"
28
28
  component={Details}
29
- <% if (props.useNativewind) { %>
29
+ <% if (props.stylingPackage?.name === "nativewind") { %>
30
30
  options={({ navigation }) => ({
31
31
  headerLeft: () => (
32
32
  <View className={styles.backButton}>
@@ -35,6 +35,12 @@
35
35
  </View>
36
36
  )
37
37
  })}
38
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
39
+ options={({ navigation }) => ({
40
+ headerLeft: () => (
41
+ <Button onPress={navigation.goBack} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}>Back</Button>
42
+ )
43
+ })}
38
44
  <% } else { %>
39
45
  options={({ navigation }) => ({
40
46
  headerLeft: () => (
@@ -50,12 +56,12 @@
50
56
  </NavigationContainer>
51
57
  );
52
58
  }
53
- <% if (props.useNativewind) { %>
59
+ <% if (props.stylingPackage?.name === "nativewind") { %>
54
60
  const styles = {
55
61
  backButton: "flex-row",
56
62
  backButtonText: "text-blue-500 ml-1"
57
63
  };
58
- <% } else { %>
64
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
59
65
  const styles = StyleSheet.create({
60
66
  backButton: {
61
67
  flexDirection: "row"