@mr.dj2u/create-expo-stack 2.21.3-mrdj.0

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 (191) hide show
  1. package/README.md +435 -0
  2. package/bin/create-expo-stack.js +2 -0
  3. package/build/cli.js +49 -0
  4. package/build/commands/create-expo-stack.js +471 -0
  5. package/build/constants.js +39 -0
  6. package/build/templates/base/.gitignore.ejs +26 -0
  7. package/build/templates/base/.npmrc.ejs +1 -0
  8. package/build/templates/base/App.tsx.ejs +66 -0
  9. package/build/templates/base/app.json.ejs +69 -0
  10. package/build/templates/base/assets/adaptive-icon.png +0 -0
  11. package/build/templates/base/assets/favicon.png +0 -0
  12. package/build/templates/base/assets/icon.png +0 -0
  13. package/build/templates/base/assets/splash.png +0 -0
  14. package/build/templates/base/babel.config.js.ejs +38 -0
  15. package/build/templates/base/components/BackButton.tsx.ejs +23 -0
  16. package/build/templates/base/components/Button.tsx.ejs +42 -0
  17. package/build/templates/base/components/Container.tsx.ejs +14 -0
  18. package/build/templates/base/components/EditScreenInfo.tsx.ejs +44 -0
  19. package/build/templates/base/components/HeaderButton.tsx.ejs +31 -0
  20. package/build/templates/base/components/ScreenContent.tsx.ejs +40 -0
  21. package/build/templates/base/components/TabBarIcon.tsx.ejs +15 -0
  22. package/build/templates/base/eslint.config.js.ejs +15 -0
  23. package/build/templates/base/package.json.ejs +191 -0
  24. package/build/templates/base/prettier.config.js.ejs +11 -0
  25. package/build/templates/base/tsconfig.json.ejs +39 -0
  26. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +40 -0
  27. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
  28. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
  29. package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +65 -0
  30. package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +15 -0
  31. package/build/templates/packages/expo-router/drawer/app/+html.tsx.ejs +49 -0
  32. package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +100 -0
  33. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +91 -0
  34. package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +21 -0
  35. package/build/templates/packages/expo-router/expo-env.d.ts +4 -0
  36. package/build/templates/packages/expo-router/index.js.ejs +4 -0
  37. package/build/templates/packages/expo-router/metro.config.js.ejs +24 -0
  38. package/build/templates/packages/expo-router/stack/app/+html.tsx.ejs +49 -0
  39. package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +113 -0
  40. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +63 -0
  41. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +56 -0
  42. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +73 -0
  43. package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +52 -0
  44. package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +37 -0
  45. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +37 -0
  46. package/build/templates/packages/expo-router/tabs/app/+html.tsx.ejs +49 -0
  47. package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +110 -0
  48. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +84 -0
  49. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +21 -0
  50. package/build/templates/packages/firebase/.env.ejs +8 -0
  51. package/build/templates/packages/firebase/metro.config.js.ejs +14 -0
  52. package/build/templates/packages/firebase/utils/firebase.ts.ejs +26 -0
  53. package/build/templates/packages/i18next/components/InternalizationExample.tsx.ejs +23 -0
  54. package/build/templates/packages/i18next/core/i18n/fallbackChecker.ts.ejs +13 -0
  55. package/build/templates/packages/i18next/core/i18n/init.ts.ejs +24 -0
  56. package/build/templates/packages/i18next/core/i18n/languageDetector.ts.ejs +13 -0
  57. package/build/templates/packages/i18next/translation/en.json.ejs +8 -0
  58. package/build/templates/packages/i18next/translation/fr.json.ejs +8 -0
  59. package/build/templates/packages/i18next/translation/index.ts.ejs +20 -0
  60. package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +22 -0
  61. package/build/templates/packages/nativewind/components/Button.tsx.ejs +21 -0
  62. package/build/templates/packages/nativewind/components/Container.tsx.ejs +13 -0
  63. package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +40 -0
  64. package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +27 -0
  65. package/build/templates/packages/nativewind/global.css +3 -0
  66. package/build/templates/packages/nativewind/metro.config.js +7 -0
  67. package/build/templates/packages/nativewind/nativewind-env.d.ts +2 -0
  68. package/build/templates/packages/nativewind/tailwind.config.js.ejs +15 -0
  69. package/build/templates/packages/nativewindui/components/Container.tsx.ejs +14 -0
  70. package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +45 -0
  71. package/build/templates/packages/nativewindui/components/HeaderButton.tsx.ejs +31 -0
  72. package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +40 -0
  73. package/build/templates/packages/nativewindui/components/TabBarIcon.tsx.ejs +15 -0
  74. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
  75. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
  76. package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
  77. package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
  78. package/build/templates/packages/nativewindui/components/nativewindui/ThemeToggle.tsx.ejs +33 -0
  79. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +28 -0
  80. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
  81. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
  82. package/build/templates/packages/nativewindui/drawer/app/(drawer)/_layout.tsx.ejs +35 -0
  83. package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +535 -0
  84. package/build/templates/packages/nativewindui/drawer/app/+html.tsx.ejs +46 -0
  85. package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +83 -0
  86. package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +75 -0
  87. package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +33 -0
  88. package/build/templates/packages/nativewindui/global.css.ejs +91 -0
  89. package/build/templates/packages/nativewindui/lib/cn.ts.ejs +6 -0
  90. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +21 -0
  91. package/build/templates/packages/nativewindui/nativewind-env.d.ts.ejs +1 -0
  92. package/build/templates/packages/nativewindui/stack/app/+html.tsx.ejs +46 -0
  93. package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +18 -0
  94. package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +78 -0
  95. package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +487 -0
  96. package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +33 -0
  97. package/build/templates/packages/nativewindui/tabs/app/(tabs)/_layout.tsx.ejs +35 -0
  98. package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +537 -0
  99. package/build/templates/packages/nativewindui/tabs/app/(tabs)/two.tsx.ejs +22 -0
  100. package/build/templates/packages/nativewindui/tabs/app/+html.tsx.ejs +46 -0
  101. package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +90 -0
  102. package/build/templates/packages/nativewindui/tabs/app/_layout.tsx.ejs +78 -0
  103. package/build/templates/packages/nativewindui/tabs/app/modal.tsx.ejs +21 -0
  104. package/build/templates/packages/nativewindui/tailwind.config.js.ejs +67 -0
  105. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +123 -0
  106. package/build/templates/packages/nativewindui/theme/index.ts.ejs +32 -0
  107. package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
  108. package/build/templates/packages/react-navigation/App.tsx.ejs +73 -0
  109. package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +31 -0
  110. package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +108 -0
  111. package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +38 -0
  112. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +41 -0
  113. package/build/templates/packages/react-navigation/screens/home.tsx.ejs +5 -0
  114. package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +20 -0
  115. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +5 -0
  116. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +54 -0
  117. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +5 -0
  118. package/build/templates/packages/restyle/components/BackButton.tsx.ejs +19 -0
  119. package/build/templates/packages/restyle/components/Button.tsx.ejs +32 -0
  120. package/build/templates/packages/restyle/components/Container.tsx.ejs +16 -0
  121. package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +38 -0
  122. package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +30 -0
  123. package/build/templates/packages/restyle/theme.ts.ejs +51 -0
  124. package/build/templates/packages/supabase/.env.ejs +2 -0
  125. package/build/templates/packages/supabase/utils/supabase.ts.ejs +14 -0
  126. package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +12 -0
  127. package/build/templates/packages/tamagui/components/Button.tsx.ejs +17 -0
  128. package/build/templates/packages/tamagui/components/Container.tsx.ejs +12 -0
  129. package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +27 -0
  130. package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +23 -0
  131. package/build/templates/packages/tamagui/tamagui.config.ts.ejs +14 -0
  132. package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
  133. package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +28 -0
  134. package/build/templates/packages/unistyles/components/Button.tsx.ejs +42 -0
  135. package/build/templates/packages/unistyles/components/Container.tsx.ejs +17 -0
  136. package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +53 -0
  137. package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +43 -0
  138. package/build/templates/packages/unistyles/theme.ts.ejs +34 -0
  139. package/build/templates/packages/unistyles/unistyles.ts.ejs +27 -0
  140. package/build/templates/packages/uniwind/global.css +2 -0
  141. package/build/templates/packages/uniwind/metro.config.js.ejs +10 -0
  142. package/build/templates/packages/vexo-analytics/.env.ejs +7 -0
  143. package/build/templates/packages/zustand/store/store.ts.ejs +15 -0
  144. package/build/types/cli.d.ts +4 -0
  145. package/build/types/commands/create-expo-stack.d.ts +3 -0
  146. package/build/types/constants.d.ts +10 -0
  147. package/build/types/types.d.ts +33 -0
  148. package/build/types/utilities/bumpVersion.d.ts +1 -0
  149. package/build/types/utilities/clearNavigationPackages.d.ts +2 -0
  150. package/build/types/utilities/clearStylingPackages.d.ts +2 -0
  151. package/build/types/utilities/configAnalytics.d.ts +18 -0
  152. package/build/types/utilities/configStorage.d.ts +8 -0
  153. package/build/types/utilities/configureProjectFiles.d.ts +3 -0
  154. package/build/types/utilities/copyBaseAssets.d.ts +2 -0
  155. package/build/types/utilities/generateNWUI.d.ts +3 -0
  156. package/build/types/utilities/generateProjectFiles.d.ts +5 -0
  157. package/build/types/utilities/getPackageManager.d.ts +8 -0
  158. package/build/types/utilities/index.d.ts +10 -0
  159. package/build/types/utilities/printOutput.d.ts +3 -0
  160. package/build/types/utilities/publishToGitHub.d.ts +2 -0
  161. package/build/types/utilities/renderTitle.d.ts +2 -0
  162. package/build/types/utilities/runCLI.d.ts +3 -0
  163. package/build/types/utilities/runEasConfigure.d.ts +3 -0
  164. package/build/types/utilities/runIgnite.d.ts +3 -0
  165. package/build/types/utilities/showHelp.d.ts +1 -0
  166. package/build/types/utilities/systemCommand.d.ts +14 -0
  167. package/build/types/utilities/usePackage.d.ts +2 -0
  168. package/build/types/utilities/validateProjectName.d.ts +4 -0
  169. package/build/types.js +39 -0
  170. package/build/utilities/bumpVersion.js +21 -0
  171. package/build/utilities/clearNavigationPackages.js +11 -0
  172. package/build/utilities/clearStylingPackages.js +11 -0
  173. package/build/utilities/configAnalytics.js +70 -0
  174. package/build/utilities/configStorage.js +50 -0
  175. package/build/utilities/configureProjectFiles.js +380 -0
  176. package/build/utilities/copyBaseAssets.js +21 -0
  177. package/build/utilities/generateNWUI.js +54 -0
  178. package/build/utilities/generateProjectFiles.js +106 -0
  179. package/build/utilities/getPackageManager.js +103 -0
  180. package/build/utilities/index.js +27 -0
  181. package/build/utilities/printOutput.js +251 -0
  182. package/build/utilities/publishToGitHub.js +173 -0
  183. package/build/utilities/renderTitle.js +55 -0
  184. package/build/utilities/runCLI.js +437 -0
  185. package/build/utilities/runEasConfigure.js +83 -0
  186. package/build/utilities/runIgnite.js +26 -0
  187. package/build/utilities/showHelp.js +85 -0
  188. package/build/utilities/systemCommand.js +40 -0
  189. package/build/utilities/usePackage.js +8 -0
  190. package/build/utilities/validateProjectName.js +42 -0
  191. package/package.json +77 -0
@@ -0,0 +1,65 @@
1
+ import { Ionicons, MaterialIcons } from '@expo/vector-icons';
2
+ import { Link } from 'expo-router';
3
+ import { Drawer } from 'expo-router/drawer';
4
+ <% if (props.stylingPackage?.name === "unistyles") { %>
5
+ import { useUnistyles } from "react-native-unistyles";
6
+ <% } %>
7
+
8
+ import { HeaderButton } from '../../components/HeaderButton';
9
+
10
+ const DrawerLayout = () => {
11
+ <% if (props.stylingPackage?.name === "unistyles") { %>
12
+ const { theme } = useUnistyles();
13
+ <% } %>
14
+
15
+ return (
16
+ <% if (props.stylingPackage?.name === "unistyles") { %>
17
+ <Drawer
18
+ screenOptions={{
19
+ headerStyle: {
20
+ backgroundColor: theme.colors.background,
21
+ },
22
+ headerTitleStyle: {
23
+ color: theme.colors.typography,
24
+ },
25
+ headerTintColor: theme.colors.typography,
26
+ drawerStyle: {
27
+ backgroundColor: theme.colors.background,
28
+ },
29
+ drawerLabelStyle: {
30
+ color: theme.colors.typography,
31
+ },
32
+ drawerInactiveTintColor: theme.colors.typography,
33
+ }}
34
+ >
35
+ <% } else { %>
36
+ <Drawer>
37
+ <% } %>
38
+ <Drawer.Screen
39
+ name="index"
40
+ options={{
41
+ headerTitle: 'Home',
42
+ drawerLabel: 'Home',
43
+ drawerIcon: ({ size, color }) => <Ionicons name="home-outline" size={size} color={color} />,
44
+ }}
45
+ />
46
+ <Drawer.Screen
47
+ name="(tabs)"
48
+ options={{
49
+ headerTitle: 'Tabs',
50
+ drawerLabel: 'Tabs',
51
+ drawerIcon: ({ size, color }) => (
52
+ <MaterialIcons name="border-bottom" size={size} color={color} />
53
+ ),
54
+ headerRight: () => (
55
+ <Link href="/modal" asChild>
56
+ <HeaderButton />
57
+ </Link>
58
+ ),
59
+ }}
60
+ />
61
+ </Drawer>
62
+ );
63
+ }
64
+
65
+ export default DrawerLayout;
@@ -0,0 +1,15 @@
1
+ import { Stack } from 'expo-router';
2
+
3
+ import { Container } from '@/components/Container';
4
+ import { ScreenContent } from '@/components/ScreenContent';
5
+
6
+ export default function Home() {
7
+ return (
8
+ <>
9
+ <Stack.Screen options={{ title: 'Home' }} />
10
+ <Container>
11
+ <ScreenContent path="app/(drawer)/index.tsx" title="Home" />
12
+ </Container>
13
+ </>
14
+ );
15
+ }
@@ -0,0 +1,49 @@
1
+ import { ScrollViewStyleReset } from 'expo-router/html';
2
+ <% if (props.stylingPackage?.name === "unistyles") { %>
3
+ import '../unistyles';
4
+ <% } %>
5
+
6
+ // This file is web-only and used to configure the root HTML for every
7
+ // web page during static rendering.
8
+ // The contents of this function only run in Node.js environments and
9
+ // do not have access to the DOM or browser APIs.
10
+ export default function Root({ children }: { children: React.ReactNode }) {
11
+ return (
12
+ <html lang="en">
13
+ <head>
14
+ <meta charSet="utf-8" />
15
+ <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
16
+
17
+ {/*
18
+ This viewport disables scaling which makes the mobile website act more like a native app.
19
+ However this does reduce built-in accessibility. If you want to enable scaling, use this instead:
20
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
21
+ */}
22
+ <meta
23
+ name="viewport"
24
+ content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"
25
+ />
26
+ {/*
27
+ Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
28
+ However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
29
+ */}
30
+ <ScrollViewStyleReset />
31
+
32
+ {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
33
+ <style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
34
+ {/* Add any additional <head> elements that you want globally available on web... */}
35
+ </head>
36
+ <body>{children}</body>
37
+ </html>
38
+ );
39
+ }
40
+
41
+ const responsiveBackground = `
42
+ body {
43
+ background-color: #fff;
44
+ }
45
+ @media (prefers-color-scheme: dark) {
46
+ body {
47
+ background-color: #000;
48
+ }
49
+ }`;
@@ -0,0 +1,100 @@
1
+ import { Link, Stack } from 'expo-router';
2
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") {%>
3
+ import { Text } from 'react-native';
4
+
5
+ import { Container } from '@/components/Container';
6
+ <% } else if (props.stylingPackage?.name === "restyle" || props.stylingPackage?.name === "tamagui") { %>
7
+ import { StyleSheet, Text } from 'react-native';
8
+
9
+ import { Container } from '@/components/Container';
10
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
11
+ import { StyleSheet } from 'react-native-unistyles'
12
+ import { Text } from 'react-native';
13
+
14
+ import { Container } from '@/components/Container';
15
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
16
+ import { StyleSheet, Text } from 'react-native';
17
+
18
+ import { Container } from '@/components/Container';
19
+ <% } %>
20
+
21
+ export default function NotFoundScreen() {
22
+
23
+ return (
24
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") {%>
25
+ <>
26
+ <Stack.Screen options={{ title: "Oops!" }} />
27
+ <Container>
28
+ <Text className={styles.title}>{"This screen doesn't exist."}</Text>
29
+ <Link href="/" className={styles.link}>
30
+ <Text className={styles.linkText}>Go to home screen!</Text>
31
+ </Link>
32
+ </Container>
33
+ </>
34
+ <% } else { %>
35
+ <>
36
+ <Stack.Screen options={{ title: "Oops!" }} />
37
+ <Container>
38
+ <Text style={styles.title}>{"This screen doesn't exist."}</Text>
39
+ <Link href="/" style={styles.link}>
40
+ <Text style={styles.linkText}>Go to home screen!</Text>
41
+ </Link>
42
+ </Container>
43
+ </>
44
+ <% } %>
45
+ );
46
+ }
47
+
48
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
49
+ const styles = {
50
+ title: `text-xl font-bold`,
51
+ link: `mt-4 pt-4`,
52
+ linkText: `text-base text-[#2e78b7]`,
53
+ };
54
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
55
+ const styles = StyleSheet.create((theme) => ({
56
+ title: {
57
+ fontSize: 20,
58
+ fontWeight: 'bold',
59
+ color: theme.colors.typography,
60
+ },
61
+ link: {
62
+ marginTop: 16,
63
+ paddingVertical: 16,
64
+ },
65
+ linkText: {
66
+ fontSize: 14,
67
+ color: theme.colors.astral,
68
+ },
69
+ }));
70
+ <% } else if (props.stylingPackage?.name === "restyle" || props.stylingPackage?.name === "tamagui") { %>
71
+ const styles = StyleSheet.create({
72
+ title: {
73
+ fontSize: 20,
74
+ fontWeight: 'bold',
75
+ },
76
+ link: {
77
+ marginTop: 16,
78
+ paddingVertical: 16,
79
+ },
80
+ linkText: {
81
+ fontSize: 14,
82
+ color: '#2e78b7',
83
+ },
84
+ });
85
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
86
+ const styles = StyleSheet.create({
87
+ title: {
88
+ fontSize: 20,
89
+ fontWeight: 'bold',
90
+ },
91
+ link: {
92
+ marginTop: 16,
93
+ paddingVertical: 16,
94
+ },
95
+ linkText: {
96
+ fontSize: 14,
97
+ color: '#2e78b7',
98
+ },
99
+ });
100
+ <% } %>
@@ -0,0 +1,91 @@
1
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
2
+ import '../global.css';
3
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
4
+ <% } else if (props.stylingPackage?.name === "nativewinui") { %>
5
+ import '../global.css';
6
+ import 'expo-dev-client';
7
+ <% } %>
8
+
9
+ <% if (props.internalizationPackage?.name === "i18next") { %>
10
+ import '../translation';
11
+ <% } %>
12
+
13
+ import 'react-native-gesture-handler';
14
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
15
+ import { Stack } from 'expo-router';
16
+
17
+ <% if (props.stylingPackage?.name === "unistyles") { %>
18
+ import { useUnistyles } from "react-native-unistyles";
19
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
20
+ import { ThemeProvider } from '@shopify/restyle';
21
+ import { theme } from '../theme';
22
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
23
+ import { TamaguiProvider } from 'tamagui';
24
+ import config from '../tamagui.config';
25
+ <% } %>
26
+
27
+ <% if (props.analyticsPackage?.name === "vexo-analytics") { %>
28
+ import { vexo } from 'vexo-analytics';
29
+
30
+ const vexoApiKey = process.env.EXPO_PUBLIC_VEXO_API_KEY;
31
+ if (vexoApiKey) {
32
+ vexo(vexoApiKey);
33
+ }
34
+ <% } %>
35
+
36
+ export const unstable_settings = {
37
+ // Ensure that reloading on `/modal` keeps a back button present.
38
+ initialRouteName: "(drawer)",
39
+ };
40
+
41
+ export default function RootLayout() {
42
+ <% if (props.stylingPackage?.name === "unistyles") { %>
43
+ const { theme } = useUnistyles();
44
+ <% } %>
45
+
46
+ return (
47
+ <% if (props.stylingPackage?.name === "restyle") { %>
48
+ <ThemeProvider theme={theme}>
49
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
50
+ <TamaguiProvider config={config}>
51
+ <% } %>
52
+ <GestureHandlerRootView style={{ flex: 1 }}>
53
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
54
+ <SafeAreaProvider>
55
+ <% } %>
56
+ <% if (props.stylingPackage?.name === "unistyles") { %>
57
+ <Stack
58
+ screenOptions={{
59
+ headerStyle: {
60
+ backgroundColor: theme.colors.background,
61
+ },
62
+ headerTitleStyle: {
63
+ color: theme.colors.typography,
64
+ },
65
+ headerTintColor: theme.colors.typography,
66
+ drawerStyle: {
67
+ backgroundColor: theme.colors.background,
68
+ },
69
+ drawerLabelStyle: {
70
+ color: theme.colors.typography,
71
+ },
72
+ drawerInactiveTintColor: theme.colors.typography,
73
+ }}
74
+ >
75
+ <% } else { %>
76
+ <Stack>
77
+ <% } %>
78
+ <Stack.Screen name="(drawer)" options={{ headerShown: false }} />
79
+ <Stack.Screen name="modal" options={{ title: 'Modal', presentation: 'modal' }} />
80
+ </Stack>
81
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
82
+ </SafeAreaProvider>
83
+ <% } %>
84
+ </GestureHandlerRootView>
85
+ <% if (props.stylingPackage?.name === "restyle") { %>
86
+ </ThemeProvider>
87
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
88
+ </TamaguiProvider>
89
+ <% } %>
90
+ );
91
+ }
@@ -0,0 +1,21 @@
1
+ import { StatusBar } from 'expo-status-bar';
2
+ import { Platform } from 'react-native';
3
+
4
+ import { ScreenContent } from '@/components/ScreenContent';
5
+
6
+ <% if (props.internalizationPackage?.name === "i18next") { %>
7
+ import { InternalizationExample } from 'components/InternalizationExample';
8
+ <% } %>
9
+
10
+ export default function Modal() {
11
+ return (
12
+ <>
13
+ <ScreenContent path="app/modal.tsx" title="Modal">
14
+ <% if (props.internalizationPackage?.name === "i18next") { %>
15
+ <InternalizationExample />
16
+ <% } %>
17
+ </ScreenContent>
18
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
19
+ </>
20
+ );
21
+ }
@@ -0,0 +1,4 @@
1
+ // @ts-ignore
2
+ /// <reference types="expo-router/types" />
3
+
4
+ // NOTE: This file should not be edited and should be in your git ignore
@@ -0,0 +1,4 @@
1
+ <% if (props.stylingPackage?.name === 'unistyles') { %>
2
+ import 'expo-router/entry';
3
+ import './unistyles';
4
+ <% } %>
@@ -0,0 +1,24 @@
1
+ // Learn more https://docs.expo.io/guides/customizing-metro
2
+ const { getDefaultConfig } = require('expo/metro-config');
3
+ <% if (["nativewind", "nativewindui"].includes(props.stylingPackage?.name)) { %>
4
+ const { withNativeWind } = require("nativewind/metro");
5
+ <% } else if (props.stylingPackage?.name === "uniwind") { %>
6
+ const { withUniwindConfig } = require("uniwind/metro");
7
+ <% } %>
8
+
9
+ /** @type {import('expo/metro-config').MetroConfig} */
10
+ // eslint-disable-next-line no-undef
11
+ const config = getDefaultConfig(__dirname);
12
+
13
+ <% if (props.stylingPackage?.name === "nativewind") { %>
14
+ module.exports = withNativeWind(config, { input: "./global.css" });
15
+ <% } else if (props.stylingPackage?.name === "nativewindui") { %>
16
+ module.exports = withNativeWind(config, { input: "./global.css", inlineRem: 16 });
17
+ <% } else if (props.stylingPackage?.name === "uniwind") { %>
18
+ module.exports = withUniwindConfig(config, {
19
+ cssEntryFile: "./global.css",
20
+ dtsFile: "./uniwind-types.d.ts"
21
+ });
22
+ <% } else { %>
23
+ module.exports = config;
24
+ <% } %>
@@ -0,0 +1,49 @@
1
+ import { ScrollViewStyleReset } from 'expo-router/html';
2
+ <% if (props.stylingPackage?.name === "unistyles") { %>
3
+ import '../unistyles';
4
+ <% } %>
5
+
6
+ // This file is web-only and used to configure the root HTML for every
7
+ // web page during static rendering.
8
+ // The contents of this function only run in Node.js environments and
9
+ // do not have access to the DOM or browser APIs.
10
+ export default function Root({ children }: { children: React.ReactNode }) {
11
+ return (
12
+ <html lang="en">
13
+ <head>
14
+ <meta charSet="utf-8" />
15
+ <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
16
+
17
+ {/*
18
+ This viewport disables scaling which makes the mobile website act more like a native app.
19
+ However this does reduce built-in accessibility. If you want to enable scaling, use this instead:
20
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
21
+ */}
22
+ <meta
23
+ name="viewport"
24
+ content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"
25
+ />
26
+ {/*
27
+ Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
28
+ However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
29
+ */}
30
+ <ScrollViewStyleReset />
31
+
32
+ {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
33
+ <style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
34
+ {/* Add any additional <head> elements that you want globally available on web... */}
35
+ </head>
36
+ <body>{children}</body>
37
+ </html>
38
+ );
39
+ }
40
+
41
+ const responsiveBackground = `
42
+ body {
43
+ background-color: #fff;
44
+ }
45
+ @media (prefers-color-scheme: dark) {
46
+ body {
47
+ background-color: #000;
48
+ }
49
+ }`;
@@ -0,0 +1,113 @@
1
+ import { Link, Stack } from 'expo-router';
2
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") {%>
3
+ import { Text, View } from 'react-native';
4
+
5
+ import { Container } from '@/components/Container';
6
+ <% } else if (props.stylingPackage?.name === "restyle" || props.stylingPackage?.name === "tamagui") { %>
7
+ import { StyleSheet, Text, View } from 'react-native';
8
+
9
+ import { Container } from '@/components/Container';
10
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
11
+ import { StyleSheet } from 'react-native-unistyles'
12
+ import { Text, View } from 'react-native';
13
+
14
+ import { Container } from '@/components/Container';
15
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
16
+ import { StyleSheet, Text, View } from 'react-native';
17
+
18
+ import { Container } from '@/components/Container';
19
+ <% } %>
20
+
21
+ export default function NotFoundScreen() {
22
+
23
+ return (
24
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
25
+ <View className={styles.container}>
26
+ <Stack.Screen options={{ title: "Oops!" }} />
27
+ <Container>
28
+ <Text className={styles.title}>{"This screen doesn't exist."}</Text>
29
+ <Link href="/" className={styles.link}>
30
+ <Text className={styles.linkText}>Go to home screen!</Text>
31
+ </Link>
32
+ </Container>
33
+ </View>
34
+ <% } else { %>
35
+ <View style={styles.container}>
36
+ <Stack.Screen options={{ title: "Oops!" }} />
37
+ <Container>
38
+ <Text style={styles.title}>{"This screen doesn't exist."}</Text>
39
+ <Link href="/" style={styles.link}>
40
+ <Text style={styles.linkText}>Go to home screen!</Text>
41
+ </Link>
42
+ </Container>
43
+ </View>
44
+ <% } %>
45
+ );
46
+ }
47
+
48
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
49
+ const styles = {
50
+ container: `flex flex-1 bg-white`,
51
+ title: `text-xl font-bold`,
52
+ link: `mt-4 pt-4`,
53
+ linkText: `text-base text-[#2e78b7]`,
54
+ };
55
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
56
+ const styles = StyleSheet.create((theme) => ({
57
+ container: {
58
+ flex: 1,
59
+ backgroundColor: 'white',
60
+ },
61
+ title: {
62
+ fontSize: 20,
63
+ fontWeight: 'bold',
64
+ color: theme.colors.typography,
65
+ },
66
+ link: {
67
+ marginTop: 16,
68
+ paddingVertical: 16,
69
+ },
70
+ linkText: {
71
+ fontSize: 14,
72
+ color: theme.colors.astral
73
+ },
74
+ }));
75
+ <% } else if (props.stylingPackage?.name === "restyle" || props.stylingPackage?.name === "tamagui") { %>
76
+ const styles = StyleSheet.create({
77
+ container: {
78
+ flex: 1,
79
+ backgroundColor: 'white',
80
+ },
81
+ title: {
82
+ fontSize: 20,
83
+ fontWeight: 'bold',
84
+ },
85
+ link: {
86
+ marginTop: 16,
87
+ paddingVertical: 16,
88
+ },
89
+ linkText: {
90
+ fontSize: 14,
91
+ color: '#2e78b7',
92
+ },
93
+ });
94
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
95
+ const styles = StyleSheet.create({
96
+ container: {
97
+ flex: 1,
98
+ backgroundColor: 'white',
99
+ },
100
+ title: {
101
+ fontSize: 20,
102
+ fontWeight: 'bold',
103
+ },
104
+ link: {
105
+ marginTop: 16,
106
+ paddingVertical: 16,
107
+ },
108
+ linkText: {
109
+ fontSize: 14,
110
+ color: '#2e78b7',
111
+ },
112
+ });
113
+ <% } %>
@@ -0,0 +1,63 @@
1
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
2
+ import '../global.css';
3
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
4
+ <% } %>
5
+
6
+ <% if (props.stylingPackage?.name === "unistyles") { %>
7
+ import { useUnistyles } from "react-native-unistyles";
8
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
9
+ import { ThemeProvider } from '@shopify/restyle';
10
+ import { theme } from '../theme';
11
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
12
+ import { TamaguiProvider } from 'tamagui';
13
+ import config from '../tamagui.config';
14
+ <% } %>
15
+ <% if (props.internalizationPackage?.name === "i18next") { %>
16
+ import '../translation';
17
+ <% } %>
18
+ import { Stack } from "expo-router";
19
+
20
+ <% if (props.analyticsPackage?.name === "vexo-analytics") { %>
21
+ import { vexo } from 'vexo-analytics';
22
+
23
+ const vexoApiKey = process.env.EXPO_PUBLIC_VEXO_API_KEY;
24
+ if (vexoApiKey) {
25
+ vexo(vexoApiKey);
26
+ }
27
+ <% } %>
28
+
29
+ export default function Layout() {
30
+ <% if (props.stylingPackage?.name === "unistyles") { %>
31
+ const { theme } = useUnistyles();
32
+ <% } %>
33
+
34
+ return (
35
+ <% if (props.stylingPackage?.name === "unistyles") { %>
36
+ <Stack
37
+ screenOptions={{
38
+ headerStyle: {
39
+ backgroundColor: theme.colors.background,
40
+ },
41
+ headerTitleStyle: {
42
+ color: theme.colors.typography,
43
+ },
44
+ headerTintColor: theme.colors.typography
45
+ }}
46
+ />
47
+ <% } else if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
48
+ <SafeAreaProvider>
49
+ <Stack />
50
+ </SafeAreaProvider>
51
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
52
+ <ThemeProvider theme={theme}>
53
+ <Stack />
54
+ </ThemeProvider>
55
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
56
+ <TamaguiProvider config={config}>
57
+ <Stack />
58
+ </TamaguiProvider>
59
+ <% } else { %>
60
+ <Stack />
61
+ <% } %>
62
+ );
63
+ }
@@ -0,0 +1,56 @@
1
+ <% if (props.stylingPackage?.name === "stylesheet" || props.stylingPackage?.name === "restyle" || props.stylingPackage?.name === "tamagui") { %>
2
+ import { StyleSheet, View } from 'react-native';
3
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
4
+ import { StyleSheet } from 'react-native-unistyles';
5
+ import { View } from 'react-native';
6
+ <% } else { %>
7
+ import { View } from 'react-native';
8
+ <% } %>
9
+ import { Stack, useLocalSearchParams } from 'expo-router';
10
+
11
+ import { Container } from '@/components/Container';
12
+ import { ScreenContent } from '@/components/ScreenContent';
13
+
14
+ export default function Details() {
15
+ const { name } = useLocalSearchParams();
16
+
17
+ return (
18
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
19
+ <View className={styles.container}>
20
+ <% } else { %>
21
+ <View style={styles.container}>
22
+ <% } %>
23
+ <Stack.Screen options={{ title: 'Details' }} />
24
+ <Container>
25
+ <ScreenContent path="screens/details.tsx" title={`Showing details for user ${name}`} />
26
+ </Container>
27
+ </View>
28
+ );
29
+ }
30
+
31
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "uniwind") { %>
32
+ const styles = {
33
+ container: "flex flex-1 bg-white",
34
+ }
35
+ <% } else if (props.stylingPackage?.name === "restyle" || props.stylingPackage?.name === "tamagui") { %>
36
+ const styles = StyleSheet.create({
37
+ container: {
38
+ flex: 1,
39
+ backgroundColor: 'white',
40
+ },
41
+ });
42
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
43
+ const styles = StyleSheet.create({
44
+ container: {
45
+ flex: 1,
46
+ backgroundColor: 'white',
47
+ },
48
+ });
49
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
50
+ const styles = StyleSheet.create((theme) => ({
51
+ container: {
52
+ flex: 1,
53
+ backgroundColor: 'white',
54
+ },
55
+ }));
56
+ <% } %>