@highbeek/create-rnstarterkit 1.0.2-beta.2 → 1.0.2-beta.3

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 (135) hide show
  1. package/dist/bin/create-rnstarterkit.js +6 -0
  2. package/dist/src/generators/appGenerator.js +3 -1
  3. package/dist/templates/cli-base/.bundle/config +2 -0
  4. package/dist/templates/cli-base/.eslintrc.js +4 -0
  5. package/dist/templates/cli-base/.prettierrc.js +5 -0
  6. package/dist/templates/cli-base/.watchmanconfig +1 -0
  7. package/dist/templates/cli-base/App.tsx +45 -0
  8. package/dist/templates/cli-base/Gemfile +16 -0
  9. package/dist/templates/cli-base/Gemfile.lock +169 -0
  10. package/dist/templates/cli-base/README.md +97 -0
  11. package/dist/templates/cli-base/__tests__/App.test.tsx +13 -0
  12. package/dist/templates/cli-base/android/app/build.gradle +119 -0
  13. package/dist/templates/cli-base/android/app/debug.keystore +0 -0
  14. package/dist/templates/cli-base/android/app/proguard-rules.pro +10 -0
  15. package/dist/templates/cli-base/android/app/src/main/AndroidManifest.xml +27 -0
  16. package/dist/templates/cli-base/android/app/src/main/java/com/baseapp/MainActivity.kt +22 -0
  17. package/dist/templates/cli-base/android/app/src/main/java/com/baseapp/MainApplication.kt +27 -0
  18. package/dist/templates/cli-base/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  19. package/dist/templates/cli-base/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  20. package/dist/templates/cli-base/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  21. package/dist/templates/cli-base/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  22. package/dist/templates/cli-base/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  23. package/dist/templates/cli-base/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  24. package/dist/templates/cli-base/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  25. package/dist/templates/cli-base/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  26. package/dist/templates/cli-base/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  27. package/dist/templates/cli-base/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  28. package/dist/templates/cli-base/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  29. package/dist/templates/cli-base/android/app/src/main/res/values/strings.xml +3 -0
  30. package/dist/templates/cli-base/android/app/src/main/res/values/styles.xml +9 -0
  31. package/dist/templates/cli-base/android/build.gradle +21 -0
  32. package/dist/templates/cli-base/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  33. package/dist/templates/cli-base/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  34. package/dist/templates/cli-base/android/gradle.properties +44 -0
  35. package/dist/templates/cli-base/android/gradlew +251 -0
  36. package/dist/templates/cli-base/android/gradlew.bat +99 -0
  37. package/dist/templates/cli-base/android/settings.gradle +6 -0
  38. package/dist/templates/cli-base/app.json +4 -0
  39. package/dist/templates/cli-base/babel.config.js +3 -0
  40. package/dist/templates/cli-base/index.js +9 -0
  41. package/dist/templates/cli-base/ios/.xcode.env +11 -0
  42. package/dist/templates/cli-base/ios/BaseApp/AppDelegate.swift +48 -0
  43. package/dist/templates/cli-base/ios/BaseApp/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  44. package/dist/templates/cli-base/ios/BaseApp/Images.xcassets/Contents.json +6 -0
  45. package/dist/templates/cli-base/ios/BaseApp/Info.plist +60 -0
  46. package/dist/templates/cli-base/ios/BaseApp/LaunchScreen.storyboard +47 -0
  47. package/dist/templates/cli-base/ios/BaseApp/PrivacyInfo.xcprivacy +37 -0
  48. package/dist/templates/cli-base/ios/BaseApp.xcodeproj/project.pbxproj +494 -0
  49. package/dist/templates/cli-base/ios/BaseApp.xcodeproj/xcshareddata/xcschemes/BaseApp.xcscheme +88 -0
  50. package/dist/templates/cli-base/ios/BaseApp.xcworkspace/contents.xcworkspacedata +10 -0
  51. package/dist/templates/cli-base/ios/Podfile +34 -0
  52. package/dist/templates/cli-base/ios/Podfile.lock +2165 -0
  53. package/dist/templates/cli-base/jest.config.js +3 -0
  54. package/dist/templates/cli-base/metro.config.js +11 -0
  55. package/dist/templates/cli-base/package-lock.json +11859 -0
  56. package/dist/templates/cli-base/package.json +41 -0
  57. package/dist/templates/cli-base/tsconfig.json +8 -0
  58. package/dist/templates/expo-base/.vscode/extensions.json +1 -0
  59. package/dist/templates/expo-base/.vscode/settings.json +7 -0
  60. package/dist/templates/expo-base/README.md +50 -0
  61. package/dist/templates/expo-base/app/(tabs)/_layout.tsx +35 -0
  62. package/dist/templates/expo-base/app/(tabs)/explore.tsx +112 -0
  63. package/dist/templates/expo-base/app/(tabs)/index.tsx +98 -0
  64. package/dist/templates/expo-base/app/_layout.tsx +24 -0
  65. package/dist/templates/expo-base/app/modal.tsx +29 -0
  66. package/dist/templates/expo-base/app.json +48 -0
  67. package/dist/templates/expo-base/assets/images/android-icon-background.png +0 -0
  68. package/dist/templates/expo-base/assets/images/android-icon-foreground.png +0 -0
  69. package/dist/templates/expo-base/assets/images/android-icon-monochrome.png +0 -0
  70. package/dist/templates/expo-base/assets/images/favicon.png +0 -0
  71. package/dist/templates/expo-base/assets/images/icon.png +0 -0
  72. package/dist/templates/expo-base/assets/images/partial-react-logo.png +0 -0
  73. package/dist/templates/expo-base/assets/images/react-logo.png +0 -0
  74. package/dist/templates/expo-base/assets/images/react-logo@2x.png +0 -0
  75. package/dist/templates/expo-base/assets/images/react-logo@3x.png +0 -0
  76. package/dist/templates/expo-base/assets/images/splash-icon.png +0 -0
  77. package/dist/templates/expo-base/components/external-link.tsx +25 -0
  78. package/dist/templates/expo-base/components/haptic-tab.tsx +18 -0
  79. package/dist/templates/expo-base/components/hello-wave.tsx +19 -0
  80. package/dist/templates/expo-base/components/parallax-scroll-view.tsx +79 -0
  81. package/dist/templates/expo-base/components/themed-text.tsx +60 -0
  82. package/dist/templates/expo-base/components/themed-view.tsx +14 -0
  83. package/dist/templates/expo-base/components/ui/collapsible.tsx +45 -0
  84. package/dist/templates/expo-base/components/ui/icon-symbol.ios.tsx +32 -0
  85. package/dist/templates/expo-base/components/ui/icon-symbol.tsx +41 -0
  86. package/dist/templates/expo-base/constants/theme.ts +53 -0
  87. package/dist/templates/expo-base/eslint.config.js +10 -0
  88. package/dist/templates/expo-base/hooks/use-color-scheme.ts +1 -0
  89. package/dist/templates/expo-base/hooks/use-color-scheme.web.ts +21 -0
  90. package/dist/templates/expo-base/hooks/use-theme-color.ts +21 -0
  91. package/dist/templates/expo-base/package-lock.json +12916 -0
  92. package/dist/templates/expo-base/package.json +47 -0
  93. package/dist/templates/expo-base/scripts/reset-project.js +112 -0
  94. package/dist/templates/expo-base/tsconfig.json +17 -0
  95. package/dist/templates/optional/apiClient/api/client.ts +86 -0
  96. package/dist/templates/optional/apiClient/api/index.ts +1 -0
  97. package/dist/templates/optional/apiClient/config/env.cli.ts +5 -0
  98. package/dist/templates/optional/apiClient/config/env.expo.ts +4 -0
  99. package/dist/templates/optional/apiClient/config/env.ts +1 -0
  100. package/dist/templates/optional/apiClient/env.d.ts +3 -0
  101. package/dist/templates/optional/auth-context/api/authApi.ts +14 -0
  102. package/dist/templates/optional/auth-context/context/AuthContext.tsx +47 -0
  103. package/dist/templates/optional/auth-context/navigation/ProtectedStack.tsx +38 -0
  104. package/dist/templates/optional/auth-context/navigation/cli/BottomTabs.tsx +17 -0
  105. package/dist/templates/optional/auth-context/navigation/expo/BottomTabs.tsx +29 -0
  106. package/dist/templates/optional/auth-context/screens/HomeScreen.tsx +14 -0
  107. package/dist/templates/optional/auth-context/screens/LoginScreen.tsx +28 -0
  108. package/dist/templates/optional/auth-context/screens/ProfileScreen.tsx +10 -0
  109. package/dist/templates/optional/auth-context/screens/RegisterScreen.tsx +28 -0
  110. package/dist/templates/optional/auth-context/screens/SettingsScreen.tsx +10 -0
  111. package/dist/templates/optional/auth-context/utils/storage.ts +13 -0
  112. package/dist/templates/optional/auth-redux/api/authApi.ts +14 -0
  113. package/dist/templates/optional/auth-redux/navigation/ProtectedStack.tsx +30 -0
  114. package/dist/templates/optional/auth-redux/navigation/cli/BottomTabs.tsx +17 -0
  115. package/dist/templates/optional/auth-redux/navigation/expo/BottomTabs.tsx +31 -0
  116. package/dist/templates/optional/auth-redux/screens/HomeScreen.tsx +15 -0
  117. package/dist/templates/optional/auth-redux/screens/LoginScreen.tsx +29 -0
  118. package/dist/templates/optional/auth-redux/screens/ProfileScreen.tsx +14 -0
  119. package/dist/templates/optional/auth-redux/screens/RegisterScreen.tsx +14 -0
  120. package/dist/templates/optional/auth-redux/screens/SettingsScreen.tsx +14 -0
  121. package/dist/templates/optional/auth-redux/store/authSlice.ts +25 -0
  122. package/dist/templates/optional/auth-redux/store/store.ts +11 -0
  123. package/dist/templates/optional/auth-zustand/api/authApi.ts +14 -0
  124. package/dist/templates/optional/auth-zustand/navigation/BottomTabs.tsx +1 -0
  125. package/dist/templates/optional/auth-zustand/navigation/ProtectedStack.tsx +44 -0
  126. package/dist/templates/optional/auth-zustand/navigation/cli/BottomTabs.tsx +17 -0
  127. package/dist/templates/optional/auth-zustand/navigation/expo/BottomTabs.tsx +31 -0
  128. package/dist/templates/optional/auth-zustand/screens/HomeScreen.tsx +14 -0
  129. package/dist/templates/optional/auth-zustand/screens/LoginScreen.tsx +28 -0
  130. package/dist/templates/optional/auth-zustand/screens/ProfileScreen.tsx +10 -0
  131. package/dist/templates/optional/auth-zustand/screens/RegisterScreen.tsx +28 -0
  132. package/dist/templates/optional/auth-zustand/screens/SettingsScreen.tsx +10 -0
  133. package/dist/templates/optional/auth-zustand/store/authStore.ts +30 -0
  134. package/dist/templates/optional/auth-zustand/utils/storage.ts +13 -0
  135. package/package.json +2 -2
@@ -0,0 +1,60 @@
1
+ import { StyleSheet, Text, type TextProps } from 'react-native';
2
+
3
+ import { useThemeColor } from '@/hooks/use-theme-color';
4
+
5
+ export type ThemedTextProps = TextProps & {
6
+ lightColor?: string;
7
+ darkColor?: string;
8
+ type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link';
9
+ };
10
+
11
+ export function ThemedText({
12
+ style,
13
+ lightColor,
14
+ darkColor,
15
+ type = 'default',
16
+ ...rest
17
+ }: ThemedTextProps) {
18
+ const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text');
19
+
20
+ return (
21
+ <Text
22
+ style={[
23
+ { color },
24
+ type === 'default' ? styles.default : undefined,
25
+ type === 'title' ? styles.title : undefined,
26
+ type === 'defaultSemiBold' ? styles.defaultSemiBold : undefined,
27
+ type === 'subtitle' ? styles.subtitle : undefined,
28
+ type === 'link' ? styles.link : undefined,
29
+ style,
30
+ ]}
31
+ {...rest}
32
+ />
33
+ );
34
+ }
35
+
36
+ const styles = StyleSheet.create({
37
+ default: {
38
+ fontSize: 16,
39
+ lineHeight: 24,
40
+ },
41
+ defaultSemiBold: {
42
+ fontSize: 16,
43
+ lineHeight: 24,
44
+ fontWeight: '600',
45
+ },
46
+ title: {
47
+ fontSize: 32,
48
+ fontWeight: 'bold',
49
+ lineHeight: 32,
50
+ },
51
+ subtitle: {
52
+ fontSize: 20,
53
+ fontWeight: 'bold',
54
+ },
55
+ link: {
56
+ lineHeight: 30,
57
+ fontSize: 16,
58
+ color: '#0a7ea4',
59
+ },
60
+ });
@@ -0,0 +1,14 @@
1
+ import { View, type ViewProps } from 'react-native';
2
+
3
+ import { useThemeColor } from '@/hooks/use-theme-color';
4
+
5
+ export type ThemedViewProps = ViewProps & {
6
+ lightColor?: string;
7
+ darkColor?: string;
8
+ };
9
+
10
+ export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
11
+ const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background');
12
+
13
+ return <View style={[{ backgroundColor }, style]} {...otherProps} />;
14
+ }
@@ -0,0 +1,45 @@
1
+ import { PropsWithChildren, useState } from 'react';
2
+ import { StyleSheet, TouchableOpacity } from 'react-native';
3
+
4
+ import { ThemedText } from '@/components/themed-text';
5
+ import { ThemedView } from '@/components/themed-view';
6
+ import { IconSymbol } from '@/components/ui/icon-symbol';
7
+ import { Colors } from '@/constants/theme';
8
+ import { useColorScheme } from '@/hooks/use-color-scheme';
9
+
10
+ export function Collapsible({ children, title }: PropsWithChildren & { title: string }) {
11
+ const [isOpen, setIsOpen] = useState(false);
12
+ const theme = useColorScheme() ?? 'light';
13
+
14
+ return (
15
+ <ThemedView>
16
+ <TouchableOpacity
17
+ style={styles.heading}
18
+ onPress={() => setIsOpen((value) => !value)}
19
+ activeOpacity={0.8}>
20
+ <IconSymbol
21
+ name="chevron.right"
22
+ size={18}
23
+ weight="medium"
24
+ color={theme === 'light' ? Colors.light.icon : Colors.dark.icon}
25
+ style={{ transform: [{ rotate: isOpen ? '90deg' : '0deg' }] }}
26
+ />
27
+
28
+ <ThemedText type="defaultSemiBold">{title}</ThemedText>
29
+ </TouchableOpacity>
30
+ {isOpen && <ThemedView style={styles.content}>{children}</ThemedView>}
31
+ </ThemedView>
32
+ );
33
+ }
34
+
35
+ const styles = StyleSheet.create({
36
+ heading: {
37
+ flexDirection: 'row',
38
+ alignItems: 'center',
39
+ gap: 6,
40
+ },
41
+ content: {
42
+ marginTop: 6,
43
+ marginLeft: 24,
44
+ },
45
+ });
@@ -0,0 +1,32 @@
1
+ import { SymbolView, SymbolViewProps, SymbolWeight } from 'expo-symbols';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+
4
+ export function IconSymbol({
5
+ name,
6
+ size = 24,
7
+ color,
8
+ style,
9
+ weight = 'regular',
10
+ }: {
11
+ name: SymbolViewProps['name'];
12
+ size?: number;
13
+ color: string;
14
+ style?: StyleProp<ViewStyle>;
15
+ weight?: SymbolWeight;
16
+ }) {
17
+ return (
18
+ <SymbolView
19
+ weight={weight}
20
+ tintColor={color}
21
+ resizeMode="scaleAspectFit"
22
+ name={name}
23
+ style={[
24
+ {
25
+ width: size,
26
+ height: size,
27
+ },
28
+ style,
29
+ ]}
30
+ />
31
+ );
32
+ }
@@ -0,0 +1,41 @@
1
+ // Fallback for using MaterialIcons on Android and web.
2
+
3
+ import MaterialIcons from '@expo/vector-icons/MaterialIcons';
4
+ import { SymbolWeight, SymbolViewProps } from 'expo-symbols';
5
+ import { ComponentProps } from 'react';
6
+ import { OpaqueColorValue, type StyleProp, type TextStyle } from 'react-native';
7
+
8
+ type IconMapping = Record<SymbolViewProps['name'], ComponentProps<typeof MaterialIcons>['name']>;
9
+ type IconSymbolName = keyof typeof MAPPING;
10
+
11
+ /**
12
+ * Add your SF Symbols to Material Icons mappings here.
13
+ * - see Material Icons in the [Icons Directory](https://icons.expo.fyi).
14
+ * - see SF Symbols in the [SF Symbols](https://developer.apple.com/sf-symbols/) app.
15
+ */
16
+ const MAPPING = {
17
+ 'house.fill': 'home',
18
+ 'paperplane.fill': 'send',
19
+ 'chevron.left.forwardslash.chevron.right': 'code',
20
+ 'chevron.right': 'chevron-right',
21
+ } as IconMapping;
22
+
23
+ /**
24
+ * An icon component that uses native SF Symbols on iOS, and Material Icons on Android and web.
25
+ * This ensures a consistent look across platforms, and optimal resource usage.
26
+ * Icon `name`s are based on SF Symbols and require manual mapping to Material Icons.
27
+ */
28
+ export function IconSymbol({
29
+ name,
30
+ size = 24,
31
+ color,
32
+ style,
33
+ }: {
34
+ name: IconSymbolName;
35
+ size?: number;
36
+ color: string | OpaqueColorValue;
37
+ style?: StyleProp<TextStyle>;
38
+ weight?: SymbolWeight;
39
+ }) {
40
+ return <MaterialIcons color={color} size={size} name={MAPPING[name]} style={style} />;
41
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Below are the colors that are used in the app. The colors are defined in the light and dark mode.
3
+ * There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
4
+ */
5
+
6
+ import { Platform } from 'react-native';
7
+
8
+ const tintColorLight = '#0a7ea4';
9
+ const tintColorDark = '#fff';
10
+
11
+ export const Colors = {
12
+ light: {
13
+ text: '#11181C',
14
+ background: '#fff',
15
+ tint: tintColorLight,
16
+ icon: '#687076',
17
+ tabIconDefault: '#687076',
18
+ tabIconSelected: tintColorLight,
19
+ },
20
+ dark: {
21
+ text: '#ECEDEE',
22
+ background: '#151718',
23
+ tint: tintColorDark,
24
+ icon: '#9BA1A6',
25
+ tabIconDefault: '#9BA1A6',
26
+ tabIconSelected: tintColorDark,
27
+ },
28
+ };
29
+
30
+ export const Fonts = Platform.select({
31
+ ios: {
32
+ /** iOS `UIFontDescriptorSystemDesignDefault` */
33
+ sans: 'system-ui',
34
+ /** iOS `UIFontDescriptorSystemDesignSerif` */
35
+ serif: 'ui-serif',
36
+ /** iOS `UIFontDescriptorSystemDesignRounded` */
37
+ rounded: 'ui-rounded',
38
+ /** iOS `UIFontDescriptorSystemDesignMonospaced` */
39
+ mono: 'ui-monospace',
40
+ },
41
+ default: {
42
+ sans: 'normal',
43
+ serif: 'serif',
44
+ rounded: 'normal',
45
+ mono: 'monospace',
46
+ },
47
+ web: {
48
+ sans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
49
+ serif: "Georgia, 'Times New Roman', serif",
50
+ rounded: "'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Meiryo, 'MS PGothic', sans-serif",
51
+ mono: "SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
52
+ },
53
+ });
@@ -0,0 +1,10 @@
1
+ // https://docs.expo.dev/guides/using-eslint/
2
+ const { defineConfig } = require('eslint/config');
3
+ const expoConfig = require('eslint-config-expo/flat');
4
+
5
+ module.exports = defineConfig([
6
+ expoConfig,
7
+ {
8
+ ignores: ['dist/*'],
9
+ },
10
+ ]);
@@ -0,0 +1 @@
1
+ export { useColorScheme } from 'react-native';
@@ -0,0 +1,21 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { useColorScheme as useRNColorScheme } from 'react-native';
3
+
4
+ /**
5
+ * To support static rendering, this value needs to be re-calculated on the client side for web
6
+ */
7
+ export function useColorScheme() {
8
+ const [hasHydrated, setHasHydrated] = useState(false);
9
+
10
+ useEffect(() => {
11
+ setHasHydrated(true);
12
+ }, []);
13
+
14
+ const colorScheme = useRNColorScheme();
15
+
16
+ if (hasHydrated) {
17
+ return colorScheme;
18
+ }
19
+
20
+ return 'light';
21
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Learn more about light and dark modes:
3
+ * https://docs.expo.dev/guides/color-schemes/
4
+ */
5
+
6
+ import { Colors } from '@/constants/theme';
7
+ import { useColorScheme } from '@/hooks/use-color-scheme';
8
+
9
+ export function useThemeColor(
10
+ props: { light?: string; dark?: string },
11
+ colorName: keyof typeof Colors.light & keyof typeof Colors.dark
12
+ ) {
13
+ const theme = useColorScheme() ?? 'light';
14
+ const colorFromProps = props[theme];
15
+
16
+ if (colorFromProps) {
17
+ return colorFromProps;
18
+ } else {
19
+ return Colors[theme][colorName];
20
+ }
21
+ }