create-rn-clean-architecture 1.0.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.
- package/LICENSE +21 -0
- package/README.md +369 -0
- package/bin/cli.js +8 -0
- package/package.json +42 -0
- package/src/checkDependencies.js +108 -0
- package/src/createDirectories.js +38 -0
- package/src/generateFiles.js +114 -0
- package/src/index.js +125 -0
- package/templates/PROJECT_ARCHITECTURE.md +385 -0
- package/templates/constants/COLORS.ts.template +36 -0
- package/templates/constants/SIZINGS.ts.template +51 -0
- package/templates/constants/splash.constants.ts.template +1 -0
- package/templates/hooks/useSplashNavigation.ts.template +16 -0
- package/templates/navigation/BottomTabNavigation.tsx.template +17 -0
- package/templates/navigation/StackNavigation.tsx.template +18 -0
- package/templates/root/App.tsx.template +13 -0
- package/templates/screens/HomeScreen.tsx.template +18 -0
- package/templates/screens/ProfileScreen.tsx.template +18 -0
- package/templates/screens/SettingsScreen.tsx.template +18 -0
- package/templates/screens/SplashScreen.tsx.template +21 -0
- package/templates/styles/home.styles.ts.template +26 -0
- package/templates/styles/profile.styles.ts.template +26 -0
- package/templates/styles/settings.styles.ts.template +26 -0
- package/templates/styles/splash.styles.ts.template +25 -0
- package/templates/types/Type.ts.template +15 -0
- package/templates/utils/Util.ts.template +6 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { styles } from '../../styles/profile/profile.styles';
|
|
6
|
+
|
|
7
|
+
const ProfileScreen = () => {
|
|
8
|
+
return (
|
|
9
|
+
<SafeAreaView style={styles.container}>
|
|
10
|
+
<View style={styles.content}>
|
|
11
|
+
<Text style={styles.title}>Profile Screen</Text>
|
|
12
|
+
<Text style={styles.subtitle}>Manage your profile here</Text>
|
|
13
|
+
</View>
|
|
14
|
+
</SafeAreaView>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default ProfileScreen;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { styles } from '../../styles/settings/settings.styles';
|
|
6
|
+
|
|
7
|
+
const SettingsScreen = () => {
|
|
8
|
+
return (
|
|
9
|
+
<SafeAreaView style={styles.container}>
|
|
10
|
+
<View style={styles.content}>
|
|
11
|
+
<Text style={styles.title}>Settings Screen</Text>
|
|
12
|
+
<Text style={styles.subtitle}>App settings and preferences</Text>
|
|
13
|
+
</View>
|
|
14
|
+
</SafeAreaView>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default SettingsScreen;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { useSplashNavigation } from '../../hooks/splash/useSplashNavigation';
|
|
6
|
+
import { styles } from '../../styles/splash/splash.styles';
|
|
7
|
+
|
|
8
|
+
const SplashScreen = () => {
|
|
9
|
+
useSplashNavigation();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<SafeAreaView style={styles.container}>
|
|
13
|
+
<View style={styles.content}>
|
|
14
|
+
<Text style={styles.title}>Welcome</Text>
|
|
15
|
+
<Text style={styles.subtitle}>Your App Name</Text>
|
|
16
|
+
</View>
|
|
17
|
+
</SafeAreaView>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default SplashScreen;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { COLORS } from '../../constants/styles/COLORS';
|
|
3
|
+
import { SIZINGS } from '../../constants/sizings/SIZINGS';
|
|
4
|
+
|
|
5
|
+
export const styles = StyleSheet.create({
|
|
6
|
+
container: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
backgroundColor: COLORS.colors.background,
|
|
9
|
+
},
|
|
10
|
+
content: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
padding: SIZINGS.spacing.lg,
|
|
15
|
+
},
|
|
16
|
+
title: {
|
|
17
|
+
fontSize: SIZINGS.fontSizings.large_4,
|
|
18
|
+
fontWeight: 'bold',
|
|
19
|
+
color: COLORS.colors.text,
|
|
20
|
+
marginBottom: SIZINGS.spacing.sm,
|
|
21
|
+
},
|
|
22
|
+
subtitle: {
|
|
23
|
+
fontSize: SIZINGS.fontSizings.medium,
|
|
24
|
+
color: COLORS.colors.textSecondary,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { COLORS } from '../../constants/styles/COLORS';
|
|
3
|
+
import { SIZINGS } from '../../constants/sizings/SIZINGS';
|
|
4
|
+
|
|
5
|
+
export const styles = StyleSheet.create({
|
|
6
|
+
container: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
backgroundColor: COLORS.colors.background,
|
|
9
|
+
},
|
|
10
|
+
content: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
padding: SIZINGS.spacing.lg,
|
|
15
|
+
},
|
|
16
|
+
title: {
|
|
17
|
+
fontSize: SIZINGS.fontSizings.large_4,
|
|
18
|
+
fontWeight: 'bold',
|
|
19
|
+
color: COLORS.colors.text,
|
|
20
|
+
marginBottom: SIZINGS.spacing.sm,
|
|
21
|
+
},
|
|
22
|
+
subtitle: {
|
|
23
|
+
fontSize: SIZINGS.fontSizings.medium,
|
|
24
|
+
color: COLORS.colors.textSecondary,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { COLORS } from '../../constants/styles/COLORS';
|
|
3
|
+
import { SIZINGS } from '../../constants/sizings/SIZINGS';
|
|
4
|
+
|
|
5
|
+
export const styles = StyleSheet.create({
|
|
6
|
+
container: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
backgroundColor: COLORS.colors.background,
|
|
9
|
+
},
|
|
10
|
+
content: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
padding: SIZINGS.spacing.lg,
|
|
15
|
+
},
|
|
16
|
+
title: {
|
|
17
|
+
fontSize: SIZINGS.fontSizings.large_4,
|
|
18
|
+
fontWeight: 'bold',
|
|
19
|
+
color: COLORS.colors.text,
|
|
20
|
+
marginBottom: SIZINGS.spacing.sm,
|
|
21
|
+
},
|
|
22
|
+
subtitle: {
|
|
23
|
+
fontSize: SIZINGS.fontSizings.medium,
|
|
24
|
+
color: COLORS.colors.textSecondary,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { COLORS } from '../../constants/styles/COLORS';
|
|
3
|
+
import { SIZINGS } from '../../constants/sizings/SIZINGS';
|
|
4
|
+
|
|
5
|
+
export const styles = StyleSheet.create({
|
|
6
|
+
container: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
backgroundColor: COLORS.colors.primary,
|
|
9
|
+
},
|
|
10
|
+
content: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
},
|
|
15
|
+
title: {
|
|
16
|
+
fontSize: SIZINGS.fontSizings.large_6,
|
|
17
|
+
fontWeight: 'bold',
|
|
18
|
+
color: COLORS.colors.white,
|
|
19
|
+
marginBottom: SIZINGS.spacing.md,
|
|
20
|
+
},
|
|
21
|
+
subtitle: {
|
|
22
|
+
fontSize: SIZINGS.fontSizings.large,
|
|
23
|
+
color: COLORS.colors.white,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
2
|
+
|
|
3
|
+
export type Navigation = NativeStackNavigationProp<STACK_NAVIGATOR_PARAMS>;
|
|
4
|
+
|
|
5
|
+
export type STACK_NAVIGATOR_PARAMS = {
|
|
6
|
+
Splash: undefined;
|
|
7
|
+
Home: undefined;
|
|
8
|
+
BottomTab: undefined;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type BOTTOM_TAB_NAVIGATOR_PARAMS = {
|
|
12
|
+
Home: undefined;
|
|
13
|
+
Profile: undefined;
|
|
14
|
+
Settings: undefined;
|
|
15
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
2
|
+
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
3
|
+
import { BOTTOM_TAB_NAVIGATOR_PARAMS, STACK_NAVIGATOR_PARAMS } from '../types/Type';
|
|
4
|
+
|
|
5
|
+
export const Stack = createNativeStackNavigator<STACK_NAVIGATOR_PARAMS>();
|
|
6
|
+
export const Tab = createBottomTabNavigator<BOTTOM_TAB_NAVIGATOR_PARAMS>();
|