@nishant0121/set-it-up 0.0.1 β 0.0.2
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 +66 -0
- package/bin/index.js +11 -1
- package/package.json +3 -1
- package/src/wizard.js +34 -1
package/README.md
CHANGED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# set-it-up π
|
|
2
|
+
|
|
3
|
+
**set-it-up** is a powerful CLI tool designed to forge new projects effortlessly. It automates the boilerplate setup, handles prerequisites, and gets you coding faster with pre-configured templates.
|
|
4
|
+
|
|
5
|
+
## β¨ Features
|
|
6
|
+
|
|
7
|
+
- **Interactive Wizard**: Easy-to-use terminal interface to guide you through project creation.
|
|
8
|
+
- **Prerequisite Checks**: Automatically checks for necessary tools (Node.js, Git, etc.) before starting.
|
|
9
|
+
- **React Native Support**:
|
|
10
|
+
- fast setup with `@react-native-community/cli`.
|
|
11
|
+
- Option to choose between **TypeScript** and **JavaScript**.
|
|
12
|
+
- One-click **React Navigation** integration with boilerplate code.
|
|
13
|
+
- **Smart Defaults**: Uses the user's preferred package manager (npm, yarn, pnpm).
|
|
14
|
+
|
|
15
|
+
## π¦ Installation
|
|
16
|
+
|
|
17
|
+
To use `set-it-up` globally on your system:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Install globally from the current directory (for development)
|
|
21
|
+
npm install -g .
|
|
22
|
+
|
|
23
|
+
# Or if published to npm (future)
|
|
24
|
+
# npm install -g set-it-up
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## π οΈ Usage
|
|
28
|
+
|
|
29
|
+
Simply run the `setup` command in your terminal:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
setup
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Follow the on-screen prompts to:
|
|
36
|
+
1. Choose your project type (currently supports **React Native**).
|
|
37
|
+
2. Enter a project name.
|
|
38
|
+
3. Select your package manager.
|
|
39
|
+
4. Configure specific options (e.g., add Navigation).
|
|
40
|
+
|
|
41
|
+
### Example Workflow
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
π Welcome to Launchpad - Your Project Forge π οΈ
|
|
45
|
+
|
|
46
|
+
? What do you want to build today? React Native
|
|
47
|
+
? Enter your project name: my-app
|
|
48
|
+
? Select your preferred package manager: npm
|
|
49
|
+
? Which language do you want to use? TypeScript
|
|
50
|
+
? Would you like to add React Navigation setup? Yes
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## πΊοΈ Roadmap
|
|
54
|
+
|
|
55
|
+
- [x] React Native (JS/TS + Navigation)
|
|
56
|
+
- [ ] Next.js Support
|
|
57
|
+
- [ ] Custom GitHub Templates
|
|
58
|
+
- [ ] Backend Templates (Express, NestJS)
|
|
59
|
+
|
|
60
|
+
## π€ Contributing
|
|
61
|
+
|
|
62
|
+
Contributions are welcome! Please open an issue or submit a pull request for improvements.
|
|
63
|
+
|
|
64
|
+
## π License
|
|
65
|
+
|
|
66
|
+
ISC
|
package/bin/index.js
CHANGED
|
@@ -7,7 +7,17 @@ program
|
|
|
7
7
|
.version('1.0.0')
|
|
8
8
|
.description('A powerful CLI to forge new projects')
|
|
9
9
|
.action(async () => {
|
|
10
|
-
|
|
10
|
+
try {
|
|
11
|
+
await mainWizard();
|
|
12
|
+
} catch (error) {
|
|
13
|
+
if (error.name === 'ExitPromptError' || error.message.includes('User force closed the prompt')) {
|
|
14
|
+
console.log('\nπ Goodbye!');
|
|
15
|
+
process.exit(0);
|
|
16
|
+
} else {
|
|
17
|
+
console.error(error);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
});
|
|
12
22
|
|
|
13
23
|
program.parse(process.argv);
|
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.2",
|
|
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",
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"boxen": "^8.0.1",
|
|
16
17
|
"chalk": "^5.6.2",
|
|
17
18
|
"command-exists": "^1.2.9",
|
|
18
19
|
"commander": "^14.0.2",
|
|
19
20
|
"execa": "^9.6.1",
|
|
20
21
|
"fs-extra": "^11.3.3",
|
|
22
|
+
"gradient-string": "^3.0.0",
|
|
21
23
|
"inquirer": "^13.1.0",
|
|
22
24
|
"ora": "^9.0.0"
|
|
23
25
|
}
|
package/src/wizard.js
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
+
import gradient from 'gradient-string';
|
|
4
|
+
import boxen from 'boxen';
|
|
3
5
|
import { checkPrerequisites } from './utils/checkEnv.js';
|
|
4
6
|
import { setupReactNative } from './engines/reactNative.js';
|
|
5
7
|
|
|
6
8
|
export async function mainWizard() {
|
|
7
|
-
|
|
9
|
+
// Clear the console for a fresh start
|
|
10
|
+
console.clear();
|
|
11
|
+
|
|
12
|
+
// Create a beautiful header
|
|
13
|
+
const title = `
|
|
14
|
+
SET - IT - UP
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
const boxenOptions = {
|
|
18
|
+
padding: 1,
|
|
19
|
+
margin: 1,
|
|
20
|
+
borderStyle: 'round',
|
|
21
|
+
borderColor: 'cyan',
|
|
22
|
+
backgroundColor: '#1b1b1b'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const welcomeMessage = boxen(
|
|
26
|
+
gradient.pastel.multiline(title) +
|
|
27
|
+
'\n' +
|
|
28
|
+
chalk.white('π Ready to launch your next idea?'),
|
|
29
|
+
boxenOptions
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
console.log(welcomeMessage);
|
|
33
|
+
|
|
34
|
+
console.log(chalk.hex('#4285F4')(' Hi there! Let\'s configure your new project.\n'));
|
|
8
35
|
|
|
9
36
|
const answers = await inquirer.prompt([
|
|
10
37
|
{
|
|
@@ -18,6 +45,10 @@ export async function mainWizard() {
|
|
|
18
45
|
name: 'projectName',
|
|
19
46
|
message: 'Enter your project name:',
|
|
20
47
|
default: 'my-awesome-app',
|
|
48
|
+
validate: (input) => {
|
|
49
|
+
if (/^([a-z0-9\-\_])+$/.test(input)) return true;
|
|
50
|
+
return 'Project name may only include lowercase letters, numbers, underscores and hashes.';
|
|
51
|
+
}
|
|
21
52
|
},
|
|
22
53
|
{
|
|
23
54
|
type: 'rawlist',
|
|
@@ -46,5 +77,7 @@ export async function mainWizard() {
|
|
|
46
77
|
]);
|
|
47
78
|
|
|
48
79
|
await setupReactNative(answers, rnAnswers);
|
|
80
|
+
} else {
|
|
81
|
+
console.log(chalk.yellow('\nπ§ This feature is coming soon! Stay tuned.\n'));
|
|
49
82
|
}
|
|
50
83
|
}
|