@usercli/clideveloper 1.0.7 β†’ 1.0.9

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
@@ -4,7 +4,7 @@
4
4
  <h1><strong>πŸ’‘ Quick Install (Recommended):</strong></h1>
5
5
 
6
6
  <pre>
7
- <code>npx i @usercli/clideveloper</code>
7
+ <code>npx @usercli/clideveloper@latest</code>
8
8
  </pre>
9
9
 
10
10
  This npm package is designed to make the **developer installation and setup process easy and automatic**.
@@ -16,8 +16,11 @@ Think of it as your **personal npm butler** πŸ•΄οΈ, setting up your tools while
16
16
 
17
17
  ## 🚧 Current Status
18
18
 
19
- > **React.js and Next.js installation is not available yet.**
20
- > Support for React.js and Next.js will be added in a future update.
19
+ . βœ… Backend frameworks fully supported
20
+
21
+ . βœ… React.js and Next.js installation is now available
22
+
23
+ . ⚠️ Other frontend frameworks will be added in future updates
21
24
 
22
25
  ---
23
26
 
@@ -53,4 +56,4 @@ This package helps developers quickly bootstrap backend tools **without manual c
53
56
  ## πŸ“¦ Installation
54
57
 
55
58
  ```bash
56
- npx i @usercli/clideveloper
59
+ npx @usercli/clideveloper@latest
@@ -0,0 +1,73 @@
1
+ const {exec}=require("child_process");
2
+ const util=require("util");
3
+ const { createSpinner } = require("nanospinner");
4
+ const path = require("path");
5
+ const inquire=require("inquirer").default;
6
+
7
+ let execPromise=util.promisify(exec);
8
+
9
+ async function commonNextReactSetup(userPath,setupName){
10
+ try{
11
+
12
+ let userInstallPath=path.join(process.cwd(),userPath);
13
+
14
+ switch(setupName){
15
+ case "nextjs":
16
+
17
+ let jsTsChoice=await inquire.prompt([
18
+ {
19
+ name:"jsTs",
20
+ type:"input",
21
+ message:"You want to use typescript then write y or if you want to use normal js write n?",
22
+ validate:(check)=>{
23
+ if(check.trim()=="y" || check.trim()=="n"){
24
+ return true;
25
+ }
26
+
27
+ return "Write y or n in small";
28
+ }
29
+ }
30
+ ])
31
+
32
+
33
+ let spinner=createSpinner("Installing Next.js… greatness takes a moment πŸš€").start();
34
+
35
+ await execPromise(`npx create-next-app@latest . ${(jsTsChoice.jsTs=="y")?"--typescript":"--javascript"} --tailwind --app --no-eslint --import-alias "@/*" --yes --no-git`,{cwd:userInstallPath, shell: true});
36
+
37
+ spinner.success({text:"Successfully installed next js enjoy coding!"});
38
+
39
+ break;
40
+
41
+ case "reactjs":
42
+ let tsjs=await inquire.prompt([
43
+ {
44
+ name:"jsts",
45
+ type:"input",
46
+ message:"If you want to install react with typescript write y and if you want to install react with normal js write n?",
47
+ validate:(check)=>{
48
+ if(check.trim()=="y" || check.trim()=="n"){
49
+ return true;
50
+ }
51
+ return "Only write y or n in small";
52
+ }
53
+ }
54
+ ])
55
+
56
+ let spinner1=createSpinner("Downloading React… grabbing virtual DOM snacks πŸͺ").start();
57
+
58
+ await execPromise(`npm create vite@latest . --template ${(tsjs=="y")?"react-ts":"react"} --yes`,{cwd:userInstallPath,shell:true})
59
+
60
+ spinner1.success({text:"Successfully install react enjoy!"});
61
+
62
+ break;
63
+
64
+ default:
65
+ console.log("There no this type option are available");
66
+
67
+ }
68
+ }catch(err){
69
+ console.log(err);
70
+ }
71
+ }
72
+
73
+ module.exports={commonNextReactSetup};
package/index.js CHANGED
@@ -7,6 +7,7 @@ let {createFoldder}=require("./components/folderCreate");
7
7
  let {nodejs}=require("./components/nodejs");
8
8
  const {heading} =require("./components/welcomeHeading");
9
9
  const {createNestJs}=require("./components/nestjs");
10
+ const {commonNextReactSetup}=require("./components/nextjsReactjsSetup");
10
11
 
11
12
 
12
13
  async function main() {
@@ -34,9 +35,9 @@ async function main() {
34
35
  }else if(answer.framework=="nestjs"){
35
36
  await createNestJs(answer.folderName)
36
37
  }else if(answer.framework=="reactjs"){
37
- console.log("This react js is not come yet coming soon developer");
38
+ await commonNextReactSetup(answer.folderName,"reactjs");
38
39
  }else if(answer.framework=="nextjs"){
39
- console.log("This react js is not come yet coming soon developer");
40
+ await commonNextReactSetup(answer.folderName,"nextjs");
40
41
  }
41
42
 
42
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usercli/clideveloper",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {