@nishant0121/set-it-up 0.0.4 → 0.0.6

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/README.md CHANGED
@@ -36,10 +36,10 @@ npx @nishant0121/set-it-up
36
36
 
37
37
  ## Usage
38
38
 
39
- Run the setup command in your terminal:
39
+ Run the tool in your terminal:
40
40
 
41
41
  ```bash
42
- setup
42
+ forge
43
43
  ```
44
44
 
45
45
  Follow the prompts to:
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nishant0121/set-it-up",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "A high-performance CLI tool to bootstrap and forge new projects with pre-configured templates, prerequisite checking, and interactive setup.",
5
5
  "license": "ISC",
6
6
  "author": "Nishant Patil",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "bin": {
10
- "setup": "bin/index.js"
10
+ "forge": "bin/index.js"
11
11
  },
12
12
  "scripts": {
13
13
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -23,4 +23,4 @@
23
23
  "inquirer": "^13.1.0",
24
24
  "ora": "^9.0.0"
25
25
  }
26
- }
26
+ }
@@ -46,14 +46,28 @@ export async function setupReactNative(answers, rnAnswers) {
46
46
 
47
47
  spinner.text = 'Configuring Navigation...';
48
48
 
49
- const templateFileName = isTypescript ? 'navigation.tsx' : 'navigation.jsx';
50
- const templatePath = path.join(__dirname, '..', 'templates', 'reactNative', templateFileName);
51
-
52
- const content = await fs.readFile(templatePath, 'utf8');
49
+ // Create modular folder structure
50
+ const srcDir = path.join(projectName, 'src');
51
+ const pagesDir = path.join(srcDir, 'pages');
52
+ const componentsDir = path.join(srcDir, 'components');
53
53
 
54
- const targetPath = isTypescript ? appTsxPath : appJsxPath;
55
-
56
- await fs.writeFile(targetPath, content);
54
+ await fs.ensureDir(pagesDir);
55
+ await fs.ensureDir(componentsDir);
56
+
57
+ const ext = isTypescript ? 'tsx' : 'jsx';
58
+ const templateBase = path.join(__dirname, '..', 'templates', 'reactNative', 'modular');
59
+
60
+ // Copy App file
61
+ const appContent = await fs.readFile(path.join(templateBase, `App.${ext}`), 'utf8');
62
+ const targetAppPath = isTypescript ? appTsxPath : appJsxPath;
63
+ await fs.writeFile(targetAppPath, appContent);
64
+
65
+ // Copy Screens
66
+ const homeContent = await fs.readFile(path.join(templateBase, 'pages', `HomeScreen.${ext}`), 'utf8');
67
+ await fs.writeFile(path.join(pagesDir, `HomeScreen.${ext}`), homeContent);
68
+
69
+ const detailsContent = await fs.readFile(path.join(templateBase, 'pages', `DetailsScreen.${ext}`), 'utf8');
70
+ await fs.writeFile(path.join(pagesDir, `DetailsScreen.${ext}`), detailsContent);
57
71
  }
58
72
 
59
73
  spinner.succeed(chalk.green(`Project ${projectName} created successfully! šŸš€`));
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { NavigationContainer } from '@react-navigation/native';
3
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
4
+ import HomeScreen from './src/pages/HomeScreen';
5
+ import DetailsScreen from './src/pages/DetailsScreen';
6
+
7
+ const Stack = createNativeStackNavigator();
8
+
9
+ function App() {
10
+ return (
11
+ <NavigationContainer>
12
+ <Stack.Navigator screenOptions={{ headerShown: false }}>
13
+ <Stack.Screen name="Home" component={HomeScreen} />
14
+ <Stack.Screen name="Details" component={DetailsScreen} />
15
+ </Stack.Navigator>
16
+ </NavigationContainer>
17
+ );
18
+ }
19
+
20
+ export default App;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { NavigationContainer } from '@react-navigation/native';
3
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
4
+ import HomeScreen from './src/pages/HomeScreen';
5
+ import DetailsScreen from './src/pages/DetailsScreen';
6
+
7
+ const Stack = createNativeStackNavigator();
8
+
9
+ function App(): React.JSX.Element {
10
+ return (
11
+ <NavigationContainer>
12
+ <Stack.Navigator screenOptions={{ headerShown: false }}>
13
+ <Stack.Screen name="Home" component={HomeScreen} />
14
+ <Stack.Screen name="Details" component={DetailsScreen} />
15
+ </Stack.Navigator>
16
+ </NavigationContainer>
17
+ );
18
+ }
19
+
20
+ export default App;
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity, SafeAreaView } from 'react-native';
3
+
4
+ export default function DetailsScreen({ navigation }) {
5
+ return (
6
+ <SafeAreaView style={styles.container}>
7
+ <View style={styles.content}>
8
+ <View style={styles.card}>
9
+ <Text style={styles.title}>Details Screen</Text>
10
+ <Text style={styles.text}>
11
+ This is a detail view. You can add more complex content, forms, or data displays here.
12
+ </Text>
13
+ <TouchableOpacity
14
+ style={styles.button}
15
+ onPress={() => navigation.goBack()}
16
+ activeOpacity={0.8}
17
+ >
18
+ <Text style={styles.buttonText}>Go Back</Text>
19
+ </TouchableOpacity>
20
+ </View>
21
+ </View>
22
+ </SafeAreaView>
23
+ );
24
+ }
25
+
26
+ const styles = StyleSheet.create({
27
+ container: {
28
+ flex: 1,
29
+ backgroundColor: '#f8f9fa',
30
+ },
31
+ content: {
32
+ flex: 1,
33
+ padding: 24,
34
+ justifyContent: 'center',
35
+ },
36
+ card: {
37
+ backgroundColor: '#ffffff',
38
+ borderRadius: 24,
39
+ padding: 32,
40
+ shadowColor: '#000',
41
+ shadowOffset: {
42
+ width: 0,
43
+ height: 12,
44
+ },
45
+ shadowOpacity: 0.08,
46
+ shadowRadius: 16,
47
+ elevation: 4,
48
+ alignItems: 'center',
49
+ },
50
+ title: {
51
+ fontSize: 24,
52
+ fontWeight: '700',
53
+ color: '#1a1a1a',
54
+ marginBottom: 16,
55
+ },
56
+ text: {
57
+ fontSize: 16,
58
+ color: '#4a4a4a',
59
+ textAlign: 'center',
60
+ marginBottom: 32,
61
+ lineHeight: 24,
62
+ },
63
+ button: {
64
+ backgroundColor: '#ffffff',
65
+ paddingVertical: 16,
66
+ paddingHorizontal: 32,
67
+ borderRadius: 16,
68
+ width: '100%',
69
+ alignItems: 'center',
70
+ borderWidth: 1,
71
+ borderColor: '#e1e1e1',
72
+ },
73
+ buttonText: {
74
+ color: '#1a1a1a',
75
+ fontSize: 16,
76
+ fontWeight: '600',
77
+ },
78
+ });
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity, SafeAreaView } from 'react-native';
3
+ import { NativeStackScreenProps } from '@react-navigation/native-stack';
4
+
5
+ type RootStackParamList = {
6
+ Home: undefined;
7
+ Details: undefined;
8
+ };
9
+
10
+ type Props = NativeStackScreenProps<RootStackParamList, 'Details'>;
11
+
12
+ export default function DetailsScreen({ navigation }: Props) {
13
+ return (
14
+ <SafeAreaView style={styles.container}>
15
+ <View style={styles.content}>
16
+ <View style={styles.card}>
17
+ <Text style={styles.title}>Details Screen</Text>
18
+ <Text style={styles.text}>
19
+ This is a detail view. You can add more complex content, forms, or data displays here.
20
+ </Text>
21
+ <TouchableOpacity
22
+ style={styles.button}
23
+ onPress={() => navigation.goBack()}
24
+ activeOpacity={0.8}
25
+ >
26
+ <Text style={styles.buttonText}>Go Back</Text>
27
+ </TouchableOpacity>
28
+ </View>
29
+ </View>
30
+ </SafeAreaView>
31
+ );
32
+ }
33
+
34
+ const styles = StyleSheet.create({
35
+ container: {
36
+ flex: 1,
37
+ backgroundColor: '#f8f9fa',
38
+ },
39
+ content: {
40
+ flex: 1,
41
+ padding: 24,
42
+ justifyContent: 'center',
43
+ },
44
+ card: {
45
+ backgroundColor: '#ffffff',
46
+ borderRadius: 24,
47
+ padding: 32,
48
+ shadowColor: '#000',
49
+ shadowOffset: {
50
+ width: 0,
51
+ height: 12,
52
+ },
53
+ shadowOpacity: 0.08,
54
+ shadowRadius: 16,
55
+ elevation: 4,
56
+ alignItems: 'center',
57
+ },
58
+ title: {
59
+ fontSize: 24,
60
+ fontWeight: '700',
61
+ color: '#1a1a1a',
62
+ marginBottom: 16,
63
+ },
64
+ text: {
65
+ fontSize: 16,
66
+ color: '#4a4a4a',
67
+ textAlign: 'center',
68
+ marginBottom: 32,
69
+ lineHeight: 24,
70
+ },
71
+ button: {
72
+ backgroundColor: '#ffffff',
73
+ paddingVertical: 16,
74
+ paddingHorizontal: 32,
75
+ borderRadius: 16,
76
+ width: '100%',
77
+ alignItems: 'center',
78
+ borderWidth: 1,
79
+ borderColor: '#e1e1e1',
80
+ },
81
+ buttonText: {
82
+ color: '#1a1a1a',
83
+ fontSize: 16,
84
+ fontWeight: '600',
85
+ },
86
+ });
@@ -0,0 +1,100 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity, SafeAreaView, StatusBar } from 'react-native';
3
+
4
+ export default function HomeScreen({ navigation }) {
5
+ return (
6
+ <SafeAreaView style={styles.container}>
7
+ <StatusBar barStyle="dark-content" backgroundColor="#f8f9fa" />
8
+ <View style={styles.content}>
9
+ <View style={styles.header}>
10
+ <Text style={styles.title}>Welcome Home</Text>
11
+ <Text style={styles.subtitle}>Start building something amazing</Text>
12
+ </View>
13
+
14
+ <View style={styles.card}>
15
+ <Text style={styles.cardText}>
16
+ This is your new modular React Native project. Navigate to the details to see more.
17
+ </Text>
18
+ <TouchableOpacity
19
+ style={styles.button}
20
+ onPress={() => navigation.navigate('Details')}
21
+ activeOpacity={0.8}
22
+ >
23
+ <Text style={styles.buttonText}>Go to Details</Text>
24
+ </TouchableOpacity>
25
+ </View>
26
+ </View>
27
+ </SafeAreaView>
28
+ );
29
+ }
30
+
31
+ const styles = StyleSheet.create({
32
+ container: {
33
+ flex: 1,
34
+ backgroundColor: '#f8f9fa',
35
+ },
36
+ content: {
37
+ flex: 1,
38
+ padding: 24,
39
+ justifyContent: 'center',
40
+ },
41
+ header: {
42
+ marginBottom: 48,
43
+ alignItems: 'center',
44
+ },
45
+ title: {
46
+ fontSize: 32,
47
+ fontWeight: '800',
48
+ color: '#1a1a1a',
49
+ marginBottom: 8,
50
+ textAlign: 'center',
51
+ },
52
+ subtitle: {
53
+ fontSize: 16,
54
+ color: '#666666',
55
+ fontWeight: '500',
56
+ textAlign: 'center',
57
+ },
58
+ card: {
59
+ backgroundColor: '#ffffff',
60
+ borderRadius: 24,
61
+ padding: 32,
62
+ shadowColor: '#000',
63
+ shadowOffset: {
64
+ width: 0,
65
+ height: 12,
66
+ },
67
+ shadowOpacity: 0.08,
68
+ shadowRadius: 16,
69
+ elevation: 4,
70
+ alignItems: 'center',
71
+ },
72
+ cardText: {
73
+ fontSize: 16,
74
+ color: '#4a4a4a',
75
+ textAlign: 'center',
76
+ marginBottom: 24,
77
+ lineHeight: 24,
78
+ },
79
+ button: {
80
+ backgroundColor: '#007AFF',
81
+ paddingVertical: 16,
82
+ paddingHorizontal: 32,
83
+ borderRadius: 16,
84
+ width: '100%',
85
+ alignItems: 'center',
86
+ shadowColor: '#007AFF',
87
+ shadowOffset: {
88
+ width: 0,
89
+ height: 4,
90
+ },
91
+ shadowOpacity: 0.3,
92
+ shadowRadius: 8,
93
+ elevation: 4,
94
+ },
95
+ buttonText: {
96
+ color: '#ffffff',
97
+ fontSize: 16,
98
+ fontWeight: '700',
99
+ },
100
+ });
@@ -0,0 +1,108 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity, SafeAreaView, StatusBar } from 'react-native';
3
+ import { NativeStackScreenProps } from '@react-navigation/native-stack';
4
+
5
+ type RootStackParamList = {
6
+ Home: undefined;
7
+ Details: undefined;
8
+ };
9
+
10
+ type Props = NativeStackScreenProps<RootStackParamList, 'Home'>;
11
+
12
+ export default function HomeScreen({ navigation }: Props) {
13
+ return (
14
+ <SafeAreaView style={styles.container}>
15
+ <StatusBar barStyle="dark-content" backgroundColor="#f8f9fa" />
16
+ <View style={styles.content}>
17
+ <View style={styles.header}>
18
+ <Text style={styles.title}>Welcome Home</Text>
19
+ <Text style={styles.subtitle}>Start building something amazing</Text>
20
+ </View>
21
+
22
+ <View style={styles.card}>
23
+ <Text style={styles.cardText}>
24
+ This is your new modular React Native project. Navigate to the details to see more.
25
+ </Text>
26
+ <TouchableOpacity
27
+ style={styles.button}
28
+ onPress={() => navigation.navigate('Details')}
29
+ activeOpacity={0.8}
30
+ >
31
+ <Text style={styles.buttonText}>Go to Details</Text>
32
+ </TouchableOpacity>
33
+ </View>
34
+ </View>
35
+ </SafeAreaView>
36
+ );
37
+ }
38
+
39
+ const styles = StyleSheet.create({
40
+ container: {
41
+ flex: 1,
42
+ backgroundColor: '#f8f9fa',
43
+ },
44
+ content: {
45
+ flex: 1,
46
+ padding: 24,
47
+ justifyContent: 'center',
48
+ },
49
+ header: {
50
+ marginBottom: 48,
51
+ alignItems: 'center',
52
+ },
53
+ title: {
54
+ fontSize: 32,
55
+ fontWeight: '800',
56
+ color: '#1a1a1a',
57
+ marginBottom: 8,
58
+ textAlign: 'center',
59
+ },
60
+ subtitle: {
61
+ fontSize: 16,
62
+ color: '#666666',
63
+ fontWeight: '500',
64
+ textAlign: 'center',
65
+ },
66
+ card: {
67
+ backgroundColor: '#ffffff',
68
+ borderRadius: 24,
69
+ padding: 32,
70
+ shadowColor: '#000',
71
+ shadowOffset: {
72
+ width: 0,
73
+ height: 12,
74
+ },
75
+ shadowOpacity: 0.08,
76
+ shadowRadius: 16,
77
+ elevation: 4,
78
+ alignItems: 'center',
79
+ },
80
+ cardText: {
81
+ fontSize: 16,
82
+ color: '#4a4a4a',
83
+ textAlign: 'center',
84
+ marginBottom: 24,
85
+ lineHeight: 24,
86
+ },
87
+ button: {
88
+ backgroundColor: '#007AFF',
89
+ paddingVertical: 16,
90
+ paddingHorizontal: 32,
91
+ borderRadius: 16,
92
+ width: '100%',
93
+ alignItems: 'center',
94
+ shadowColor: '#007AFF',
95
+ shadowOffset: {
96
+ width: 0,
97
+ height: 4,
98
+ },
99
+ shadowOpacity: 0.3,
100
+ shadowRadius: 8,
101
+ elevation: 4,
102
+ },
103
+ buttonText: {
104
+ color: '#ffffff',
105
+ fontSize: 16,
106
+ fontWeight: '700',
107
+ },
108
+ });
package/src/wizard.js CHANGED
@@ -14,7 +14,7 @@ export async function mainWizard() {
14
14
  const title = `
15
15
  SET - IT - UP
16
16
  `;
17
-
17
+
18
18
  const boxenOptions = {
19
19
  padding: 1,
20
20
  margin: 1,
@@ -24,14 +24,14 @@ export async function mainWizard() {
24
24
  };
25
25
 
26
26
  const welcomeMessage = boxen(
27
- gradient.pastel.multiline(title) +
28
- '\n' +
27
+ gradient.pastel.multiline(title) +
28
+ '\n' +
29
29
  chalk.white('šŸš€ Ready to launch your next idea?'),
30
30
  boxenOptions
31
31
  );
32
32
 
33
33
  console.log(welcomeMessage);
34
-
34
+
35
35
  console.log(chalk.hex('#4285F4')(' Hi there! Let\'s configure your new project.\n'));
36
36
 
37
37
  const answers = await inquirer.prompt([
@@ -47,8 +47,8 @@ export async function mainWizard() {
47
47
  message: 'Enter your project name:',
48
48
  default: 'my-awesome-app',
49
49
  validate: (input) => {
50
- if (/^([a-z0-9\-\_])+$/.test(input)) return true;
51
- return 'Project name may only include lowercase letters, numbers, underscores and hashes.';
50
+ if (/^([a-z0-9\-\_])+$/.test(input)) return true;
51
+ return 'Project name may only include lowercase letters, numbers, underscores and hashes.';
52
52
  }
53
53
  },
54
54
  {
@@ -119,6 +119,6 @@ export async function mainWizard() {
119
119
  await setupReact(answers, reactAnswers);
120
120
 
121
121
  } else {
122
- console.log(chalk.yellow('\n🚧 This feature is coming soon! Stay tuned.\n'));
122
+ console.log(chalk.yellow('\n🚧 This feature is coming soon! Stay tuned.\n'));
123
123
  }
124
124
  }