create-expo-stack 2.6.5 → 2.7.0-next.2960d96

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 (43) hide show
  1. package/README.md +23 -9
  2. package/build/templates/base/App.tsx.ejs +3 -0
  3. package/build/templates/base/babel.config.js.ejs +1 -1
  4. package/build/templates/base/package.json.ejs +40 -3
  5. package/build/templates/base/prettier.config.js.ejs +1 -1
  6. package/build/templates/base/tsconfig.json.ejs +10 -6
  7. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +4 -1
  8. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +4 -1
  9. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +4 -1
  10. package/build/templates/packages/nativewindui/app/+not-found.tsx.ejs +18 -0
  11. package/build/templates/packages/nativewindui/app/_layout.tsx.ejs +85 -0
  12. package/build/templates/packages/nativewindui/app/index.tsx.ejs +652 -0
  13. package/build/templates/packages/nativewindui/app/modal.tsx.ejs +32 -0
  14. package/build/templates/packages/nativewindui/components/nativewind-ui/ActivityIndicator.tsx.ejs +10 -0
  15. package/build/templates/packages/nativewindui/components/nativewind-ui/Avatar.tsx.ejs +139 -0
  16. package/build/templates/packages/nativewindui/components/nativewind-ui/DatePicker.android.tsx.ejs +66 -0
  17. package/build/templates/packages/nativewindui/components/nativewind-ui/DatePicker.tsx.ejs +10 -0
  18. package/build/templates/packages/nativewindui/components/nativewind-ui/Picker.tsx.ejs +39 -0
  19. package/build/templates/packages/nativewindui/components/nativewind-ui/ProgressIndicator.tsx.ejs +95 -0
  20. package/build/templates/packages/nativewindui/components/nativewind-ui/SegmentedControl.tsx.ejs +22 -0
  21. package/build/templates/packages/nativewindui/components/nativewind-ui/Sheet.tsx.ejs +59 -0
  22. package/build/templates/packages/nativewindui/components/nativewind-ui/Slider.tsx.ejs +28 -0
  23. package/build/templates/packages/nativewindui/components/nativewind-ui/Text.tsx.ejs +55 -0
  24. package/build/templates/packages/nativewindui/components/nativewind-ui/ThemeToggle.tsx.ejs +39 -0
  25. package/build/templates/packages/nativewindui/components/nativewind-ui/Toggle.tsx.ejs +17 -0
  26. package/build/templates/packages/nativewindui/expo-env.d.ts.ejs +3 -0
  27. package/build/templates/packages/nativewindui/global.css.ejs +91 -0
  28. package/build/templates/packages/nativewindui/lib/cn.ts.ejs +6 -0
  29. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +14 -0
  30. package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +31 -0
  31. package/build/templates/packages/nativewindui/metro.config.js.ejs +10 -0
  32. package/build/templates/packages/nativewindui/nativewind-env.d.ts.ejs +1 -0
  33. package/build/templates/packages/nativewindui/tailwind.config.js.ejs +66 -0
  34. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +71 -0
  35. package/build/templates/packages/nativewindui/theme/index.ts.ejs +29 -0
  36. package/build/templates/packages/react-navigation/App.tsx.ejs +4 -1
  37. package/build/types/types.d.ts +4 -2
  38. package/build/types.js +2 -1
  39. package/build/utilities/configureProjectFiles.js +265 -197
  40. package/build/utilities/generateProjectFiles.js +18 -13
  41. package/build/utilities/printOutput.js +5 -5
  42. package/build/utilities/runCLI.js +99 -22
  43. package/package.json +67 -67
package/README.md CHANGED
@@ -157,6 +157,13 @@ Thanks go to these wonderful people:
157
157
  <sub><b>Finn Bayer</b></sub>
158
158
  </a>
159
159
  </td>
160
+ <td align="center">
161
+ <a href="https://github.com/mrzachnugent">
162
+ <img src="https://avatars.githubusercontent.com/u/63797719?v=4" width="100;" alt="mrzachnugent"/>
163
+ <br />
164
+ <sub><b>Zach Nugent</b></sub>
165
+ </a>
166
+ </td>
160
167
  <td align="center">
161
168
  <a href="https://github.com/saimon24">
162
169
  <img src="https://avatars.githubusercontent.com/u/2514208?v=4" width="100;" alt="saimon24"/>
@@ -170,15 +177,15 @@ Thanks go to these wonderful people:
170
177
  <br />
171
178
  <sub><b>Daniel Williams</b></sub>
172
179
  </a>
173
- </td>
180
+ </td></tr>
181
+ <tr>
174
182
  <td align="center">
175
183
  <a href="https://github.com/todevmilen">
176
184
  <img src="https://avatars.githubusercontent.com/u/78319110?v=4" width="100;" alt="todevmilen"/>
177
185
  <br />
178
186
  <sub><b>Milen Todev</b></sub>
179
187
  </a>
180
- </td></tr>
181
- <tr>
188
+ </td>
182
189
  <td align="center">
183
190
  <a href="https://github.com/alitnk">
184
191
  <img src="https://avatars.githubusercontent.com/u/35243344?v=4" width="100;" alt="alitnk"/>
@@ -213,15 +220,15 @@ Thanks go to these wonderful people:
213
220
  <br />
214
221
  <sub><b>Andrew Levy</b></sub>
215
222
  </a>
216
- </td>
223
+ </td></tr>
224
+ <tr>
217
225
  <td align="center">
218
226
  <a href="https://github.com/gialencar">
219
227
  <img src="https://avatars.githubusercontent.com/u/11895696?v=4" width="100;" alt="gialencar"/>
220
228
  <br />
221
229
  <sub><b>Gilson Alencar</b></sub>
222
230
  </a>
223
- </td></tr>
224
- <tr>
231
+ </td>
225
232
  <td align="center">
226
233
  <a href="https://github.com/mwarger">
227
234
  <img src="https://avatars.githubusercontent.com/u/686823?v=4" width="100;" alt="mwarger"/>
@@ -256,15 +263,15 @@ Thanks go to these wonderful people:
256
263
  <br />
257
264
  <sub><b>Joar Karlsson</b></sub>
258
265
  </a>
259
- </td>
266
+ </td></tr>
267
+ <tr>
260
268
  <td align="center">
261
269
  <a href="https://github.com/Joehoel">
262
270
  <img src="https://avatars.githubusercontent.com/u/31251240?v=4" width="100;" alt="Joehoel"/>
263
271
  <br />
264
272
  <sub><b>Joël Kuijper</b></sub>
265
273
  </a>
266
- </td></tr>
267
- <tr>
274
+ </td>
268
275
  <td align="center">
269
276
  <a href="https://github.com/asapMaki">
270
277
  <img src="https://avatars.githubusercontent.com/u/30200380?v=4" width="100;" alt="asapMaki"/>
@@ -279,6 +286,13 @@ Thanks go to these wonderful people:
279
286
  <sub><b>Sean Boult</b></sub>
280
287
  </a>
281
288
  </td>
289
+ <td align="center">
290
+ <a href="https://github.com/YounessHassoune">
291
+ <img src="https://avatars.githubusercontent.com/u/36106440?v=4" width="100;" alt="YounessHassoune"/>
292
+ <br />
293
+ <sub><b>YOUNESS HASSOUNE</b></sub>
294
+ </a>
295
+ </td>
282
296
  <td align="center">
283
297
  <a href="https://github.com/bautistaaa">
284
298
  <img src="https://avatars.githubusercontent.com/u/3660667?v=4" width="100;" alt="bautistaaa"/>
@@ -8,6 +8,9 @@ import { StatusBar } from 'expo-status-bar';
8
8
 
9
9
  <% if (props.stylingPackage?.name === "nativewind") { %>
10
10
  import './global.css';
11
+ <% } else if (props.stylingPackage?.name === "nativewinui") { %>
12
+ import './global.css';
13
+ import 'expo-dev-client';
11
14
  <% } else if (props.stylingPackage?.name === "restyle") { %>
12
15
  import { ThemeProvider } from '@shopify/restyle';
13
16
  import { theme } from 'theme';
@@ -17,7 +17,7 @@ module.exports = function(api) {
17
17
  <% } %>
18
18
 
19
19
  return {
20
- <% if (props.stylingPackage?.name === "nativewind") { %>
20
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "nativewindui") { %>
21
21
  presets: [
22
22
  ['babel-preset-expo', { jsxImportSource: 'nativewind' }],
23
23
  'nativewind/babel',
@@ -16,9 +16,46 @@
16
16
  "web": "expo start --web"
17
17
  },
18
18
  "dependencies": {
19
- <% if (props.stylingPackage?.name === "nativewind") { %>
19
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "nativewindui") { %>
20
20
  "nativewind": "^4.0.1",
21
21
  <% } %>
22
+ <% if (props.stylingPackage?.name === "nativewindui") { %>
23
+ "@roninoss/icons": "^0.0.3",
24
+ "@shopify/flash-list": "1.6.3",
25
+ "class-variance-authority": "^0.7.0",
26
+ "clsx": "^2.1.0",
27
+ "expo-dev-client": "~3.3.8",
28
+ "tailwind-merge": "^2.2.1",
29
+ "react-native-uitextview": "^1.1.4",
30
+ "react-native-pager-view": "6.2.3",
31
+ <% if (props.stylingPackage?.options.selectedComponents.includes('date-picker')) { %>
32
+ "@react-native-community/datetimepicker": "7.6.1",
33
+ <% } %>
34
+ <% if (props.stylingPackage?.options.selectedComponents.includes('segmented-control')) { %>
35
+ "@react-native-segmented-control/segmented-control": "2.4.1",
36
+ <% } %>
37
+ <% if (props.stylingPackage?.options.selectedComponents.includes('picker')) { %>
38
+ "@react-native-picker/picker": "^2.6.1",
39
+ <% } %>
40
+ <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
41
+ "@gorhom/bottom-sheet": "^4",
42
+ <% } %>
43
+ <% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
44
+ "@expo/react-native-action-sheet": "^4.0.1",
45
+ <% } %>
46
+ <% if (props.stylingPackage?.options.selectedComponents.includes('context-menu') || props.stylingPackage?.options.selectedComponents.includes('dropdown-menu')) { %>
47
+ "zeego": "^1.9.1",
48
+ "react-native-ios-context-menu": "^2.5.0",
49
+ "react-native-ios-utilities": "^4.4.0",
50
+ "@react-native-menu/menu": "^0.9.1",
51
+ <% } %>
52
+ <% if (props.stylingPackage?.options.selectedComponents.includes('ratings-indicator')) { %>
53
+ "expo-store-review": "~6.8.3",
54
+ <% } %>
55
+ <% if (props.stylingPackage?.options.selectedComponents.includes('slider')) { %>
56
+ "@react-native-community/slider": "4.4.2",
57
+ <% } %>
58
+ <% } %>
22
59
 
23
60
  <% if (props.stylingPackage?.name === "restyle") { %>
24
61
  "@shopify/restyle": "^2.4.2",
@@ -112,7 +149,7 @@
112
149
  "eslint": "^8.50.0",
113
150
  "eslint-config-universe": "^12.0.0",
114
151
  "prettier": "^3.2.5",
115
- <% if (props.stylingPackage?.name === "nativewind") { %>
152
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "nativewindui") { %>
116
153
  "tailwindcss": "^3.4.0",
117
154
  "prettier-plugin-tailwindcss": "^0.5.11",
118
155
  <% } %>
@@ -124,7 +161,7 @@
124
161
  "eslintConfig": {
125
162
  "extends": "universe/native"
126
163
  },
127
- <% if (props.navigationPackage?.name === 'expo-router') { %>
164
+ <% if (props.navigationPackage?.name === "expo-router") { %>
128
165
  "resolutions": {
129
166
  "expo-modules-core": "~1.11.0"
130
167
  },
@@ -4,7 +4,7 @@ module.exports = {
4
4
  singleQuote: true,
5
5
  bracketSameLine: true,
6
6
  trailingComma: 'es5',
7
- <% if (props.stylingPackage?.name === "nativewind") { %>
7
+ <% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "nativewindui") { %>
8
8
  plugins: [require.resolve("prettier-plugin-tailwindcss")],
9
9
  tailwindAttributes: ["className"],
10
10
  <% } %>
@@ -6,12 +6,16 @@
6
6
  ,
7
7
  "baseUrl": ".",
8
8
  "paths": {
9
- <% if (props.navigationPackage?.name === "expo-router" && props.flags.importAlias === true) { %>
10
- "~/*": ["*"]
11
- <% } else if (props.flags.importAlias === true) { %>
12
- "~/*": ["src/*"]
13
- <% } else { %>
14
- "<%= props.flags.importAlias %>": ["src/*"]
9
+ <% if (props.stylingPackage?.name === 'nativewindui') { %>
10
+ "~/*": [ "./*" ]
11
+ <% } else { %>
12
+ <% if (props.navigationPackage?.name === "expo-router" && props.flags.importAlias === true) { %>
13
+ "~/*": ["*"]
14
+ <% } else if (props.flags.importAlias === true) { %>
15
+ "~/*": ["src/*"]
16
+ <% } else { %>
17
+ "<%= props.flags.importAlias %>": ["src/*"]
18
+ <% } %>
15
19
  <% } %>
16
20
  }
17
21
  <% } %>
@@ -1,5 +1,8 @@
1
1
  <% if (props.stylingPackage?.name === "nativewind") { %>
2
- import '../global.css';
2
+ import './global.css';
3
+ <% } else if (props.stylingPackage?.name === "nativewinui") { %>
4
+ import './global.css';
5
+ import 'expo-dev-client';
3
6
  <% } %>
4
7
  <% if (props.stylingPackage?.name === "unistyles") { %>
5
8
  import '../unistyles';
@@ -1,5 +1,8 @@
1
1
  <% if (props.stylingPackage?.name === "nativewind") { %>
2
- import '../global.css';
2
+ import './global.css';
3
+ <% } else if (props.stylingPackage?.name === "nativewinui") { %>
4
+ import './global.css';
5
+ import 'expo-dev-client';
3
6
  <% } %>
4
7
  <% if (props.stylingPackage?.name === "unistyles") { %>
5
8
  import '../unistyles';
@@ -1,5 +1,8 @@
1
1
  <% if (props.stylingPackage?.name === "nativewind") { %>
2
- import '../global.css';
2
+ import './global.css';
3
+ <% } else if (props.stylingPackage?.name === "nativewinui") { %>
4
+ import './global.css';
5
+ import 'expo-dev-client';
3
6
  <% } %>
4
7
  <% if (props.stylingPackage?.name === "unistyles") { %>
5
8
  import '../unistyles';
@@ -0,0 +1,18 @@
1
+ import { Link, Stack } from 'expo-router';
2
+ import { View } from 'react-native';
3
+ import { Text } from '~/components/nativewind-ui/Text';
4
+
5
+ export default function NotFoundScreen() {
6
+ return (
7
+ <>
8
+ <Stack.Screen options={{ title: 'Oops!' }} />
9
+ <View className='flex-1 items-center justify-center p-5 bg-background'>
10
+ <Text variant='largeTitle'>This screen doesn't exist.</Text>
11
+
12
+ <Link href='/' className='m-4 py-4'>
13
+ <Text>Go to home screen!</Text>
14
+ </Link>
15
+ </View>
16
+ </>
17
+ );
18
+ }
@@ -0,0 +1,85 @@
1
+ import '~/global.css';
2
+ import 'expo-dev-client';
3
+ import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
4
+ import { Icon } from '@roninoss/icons';
5
+ import { Link, Stack } from 'expo-router';
6
+ import { StatusBar } from 'expo-status-bar';
7
+ import { Pressable, View } from 'react-native';
8
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
9
+
10
+ import { ThemeToggle } from '~/components/nativewind-ui/ThemeToggle';
11
+ import { cn } from '~/lib/cn';
12
+ import { useColorScheme } from '~/lib/useColorScheme';
13
+ import { NAV_THEME } from '~/theme';
14
+
15
+ export {
16
+ // Catch any errors thrown by the Layout component.
17
+ ErrorBoundary,
18
+ } from 'expo-router';
19
+
20
+ export default function RootLayout() {
21
+ const { colorScheme, isDarkColorScheme } = useColorScheme();
22
+
23
+ return (
24
+ <>
25
+ <StatusBar
26
+ key={`root-status-bar-${isDarkColorScheme ? 'light' : 'dark'}`}
27
+ style={isDarkColorScheme ? 'light' : 'dark'}
28
+ />
29
+ <GestureHandlerRootView style={{ flex: 1 }}>
30
+ <NavThemeProvider value={NAV_THEME[colorScheme]}>
31
+ <Stack screenOptions={SCREEN_OPTIONS}>
32
+ <Stack.Screen name="index" options={INDEX_OPTIONS} />
33
+ <Stack.Screen name="top-tabs" options={TOP_TABS_OPTIONS} />
34
+ <Stack.Screen name="drawer" options={DEFAULT_OPTIONS} />
35
+ <Stack.Screen name="bottom-tabs" options={DEFAULT_OPTIONS} />
36
+ <Stack.Screen name="modal" options={MODAL_OPTIONS} />
37
+ </Stack>
38
+ </NavThemeProvider>
39
+ </GestureHandlerRootView>
40
+ </>
41
+ );
42
+ }
43
+
44
+ const SCREEN_OPTIONS = {
45
+ animation: 'ios', // for android
46
+ } as const;
47
+
48
+ const INDEX_OPTIONS = {
49
+ headerLargeTitle: true,
50
+ title: 'NativeWindUI',
51
+ headerRight: () => <SettingsIcon />,
52
+ } as const;
53
+
54
+ function SettingsIcon() {
55
+ const { colors } = useColorScheme();
56
+ return (
57
+ <Link href="/modal" asChild>
58
+ <Pressable className="opacity-80">
59
+ {({ pressed }) => (
60
+ <View className={cn(pressed ? 'opacity-50' : 'opacity-90')}>
61
+ <Icon name="cog-outline" color={colors.foreground} />
62
+ </View>
63
+ )}
64
+ </Pressable>
65
+ </Link>
66
+ );
67
+ }
68
+
69
+ const TOP_TABS_OPTIONS = {
70
+ title: 'Top Tabs',
71
+ headerShadowVisible: false,
72
+ headerBackTitle: 'Back',
73
+ headerRight: () => <ThemeToggle />,
74
+ } as const;
75
+
76
+ const MODAL_OPTIONS = {
77
+ presentation: 'modal',
78
+ animation: 'fade_from_bottom', // for android
79
+ title: 'Settings',
80
+ headerRight: () => <ThemeToggle />,
81
+ } as const;
82
+
83
+ const DEFAULT_OPTIONS = {
84
+ headerShown: false,
85
+ };