@nishant0121/set-it-up 0.0.3 ā 0.0.4
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/package.json +1 -1
- package/src/utils/checkEnv.js +6 -2
- package/src/wizard.js +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nishant0121/set-it-up",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
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",
|
package/src/utils/checkEnv.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import commandExists from 'command-exists';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
|
|
4
|
-
export async function checkPrerequisites(type) {
|
|
4
|
+
export async function checkPrerequisites(type, options = {}) {
|
|
5
5
|
const requirements = {
|
|
6
|
-
'React Native': ['node', 'git', 'npm', '
|
|
6
|
+
'React Native': ['node', 'git', 'npm', 'java'],
|
|
7
7
|
'React': ['node', 'git', 'npm'],
|
|
8
8
|
'Next.js': ['node', 'git']
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
if (type === 'React Native' && options.targetPlatform !== 'Android') {
|
|
12
|
+
requirements['React Native'].push('pod');
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
console.log(chalk.blue('\nš Checking prerequisites...'));
|
|
12
16
|
|
|
13
17
|
for (const cmd of requirements[type]) {
|
package/src/wizard.js
CHANGED
|
@@ -60,7 +60,16 @@ export async function mainWizard() {
|
|
|
60
60
|
]);
|
|
61
61
|
|
|
62
62
|
if (answers.projectType === 'React Native') {
|
|
63
|
-
await
|
|
63
|
+
const platformAnswer = await inquirer.prompt([
|
|
64
|
+
{
|
|
65
|
+
type: 'rawlist',
|
|
66
|
+
name: 'targetPlatform',
|
|
67
|
+
message: 'Which platform do you want to target?',
|
|
68
|
+
choices: ['Android', 'iOS', 'Both'],
|
|
69
|
+
}
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
await checkPrerequisites('React Native', { targetPlatform: platformAnswer.targetPlatform });
|
|
64
73
|
|
|
65
74
|
// Additional RN specific questions
|
|
66
75
|
const rnAnswers = await inquirer.prompt([
|
|
@@ -77,6 +86,8 @@ export async function mainWizard() {
|
|
|
77
86
|
}
|
|
78
87
|
]);
|
|
79
88
|
|
|
89
|
+
Object.assign(rnAnswers, platformAnswer);
|
|
90
|
+
|
|
80
91
|
await setupReactNative(answers, rnAnswers);
|
|
81
92
|
} else if (answers.projectType === 'React') {
|
|
82
93
|
await checkPrerequisites('React');
|