@usercli/clideveloper 2.2.6 β 2.2.8
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 +11 -0
- package/components/exposetup.js +33 -0
- package/components/expressjs.js +30 -4
- package/index.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ Think of it as your **personal npm butler** π΄οΈ, setting up your tools while
|
|
|
44
44
|
|
|
45
45
|
. β
React.js and Next.js installation is now available
|
|
46
46
|
|
|
47
|
+
. β
Expo (React Native) frontend support added π± π
|
|
48
|
+
|
|
47
49
|
. β οΈ Other frontend frameworks will be added in future updates
|
|
48
50
|
|
|
49
51
|
---
|
|
@@ -62,6 +64,15 @@ With **Easy Dev Installer**, you can quickly install and configure:
|
|
|
62
64
|
|
|
63
65
|
---
|
|
64
66
|
|
|
67
|
+
## π Whatβs New
|
|
68
|
+
|
|
69
|
+
π± **Expo Support Unlocked!**
|
|
70
|
+
**Mobile app setup is now as easy as backend setup.**
|
|
71
|
+
|
|
72
|
+
**Run β Relax β Build π**
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
65
76
|
## π― Purpose
|
|
66
77
|
|
|
67
78
|
This package helps developers quickly bootstrap backend tools **without manual configuration**, saving time and reducing errors.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const {exec}=require("child_process");
|
|
2
|
+
const util=require("util");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { createSpinner } = require("nanospinner");
|
|
5
|
+
const fs = require("fs").promises;
|
|
6
|
+
|
|
7
|
+
let execPromise=util.promisify(exec);
|
|
8
|
+
|
|
9
|
+
const expoSetup=async (folderName)=>{
|
|
10
|
+
|
|
11
|
+
try{
|
|
12
|
+
const fullpath=`${process.cwd()}/${folderName}/frontend`;
|
|
13
|
+
|
|
14
|
+
let spinner=createSpinner("Making frontend folder...").start();
|
|
15
|
+
|
|
16
|
+
await fs.mkdir(`${fullpath}`,{recursive:true});
|
|
17
|
+
let pathjoin=path.join(`${process.cwd()}/${folderName}`,"frontend");
|
|
18
|
+
|
|
19
|
+
spinner.success({text:"Folder created successfully"});
|
|
20
|
+
|
|
21
|
+
let spinner1=createSpinner("Doing setup of expo application...").start();
|
|
22
|
+
|
|
23
|
+
await execPromise("npx create-expo-app .",{cwd:pathjoin});
|
|
24
|
+
|
|
25
|
+
spinner1.success({text:"Expo setup is completed successfully enjoy!"});
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
}catch(err){
|
|
29
|
+
console.log("Expo setup is not done because of some error");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports={expoSetup};
|
package/components/expressjs.js
CHANGED
|
@@ -209,10 +209,36 @@ app.listen(7000,()=> console.log("Server is on and running on port 7000"))
|
|
|
209
209
|
// write redis file or create folder
|
|
210
210
|
|
|
211
211
|
let spinner=createSpinner("Downloading all the things which are required to run redies...").start();
|
|
212
|
+
|
|
212
213
|
await execPromise("npm i ioredis",{cwd:`${path}/backend`})
|
|
213
214
|
await execPromise("npm i cors",{cwd:`${path}/backend`})
|
|
214
215
|
await execPromise("npm i dotenv",{cwd:`${path}/backend`});
|
|
215
216
|
|
|
217
|
+
spinner.success({text:"All requirements are installed successfully"});
|
|
218
|
+
spinner.stop();
|
|
219
|
+
|
|
220
|
+
console.log("To fully setup redis answer below question to run the redis");
|
|
221
|
+
// env redis file setup
|
|
222
|
+
|
|
223
|
+
const envRedis=await inquire.prompt([
|
|
224
|
+
{
|
|
225
|
+
name:"envHost",
|
|
226
|
+
type:"editor",
|
|
227
|
+
message:"Write your host name which is required to run redis editor will open copy and past your host name and with ctrl+s save it and close the editor fully?:"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name:"envPass",
|
|
231
|
+
type:"editor",
|
|
232
|
+
message:"Write your password which is required to run redis editor will open copy and past your password and with ctrl+s save it and close the editor fully?:"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name:"envPort",
|
|
236
|
+
type:"input",
|
|
237
|
+
message:"Write your port which is required to run redis?:"
|
|
238
|
+
}
|
|
239
|
+
])
|
|
240
|
+
|
|
241
|
+
let spinner1=createSpinner("Doing setup for redies...").start();
|
|
216
242
|
await fs.mkdir(`${path}/backend/redisFileForConnection`,{recursive:true});
|
|
217
243
|
|
|
218
244
|
let redisCode=`
|
|
@@ -238,13 +264,13 @@ module.exports={redis}
|
|
|
238
264
|
// env file is made
|
|
239
265
|
let envData=`
|
|
240
266
|
# string
|
|
241
|
-
REDIS_HOST
|
|
267
|
+
REDIS_HOST=${envRedis.envHost}
|
|
242
268
|
|
|
243
269
|
#string
|
|
244
|
-
REDIS_PASS
|
|
270
|
+
REDIS_PASS=${envRedis.envPass}
|
|
245
271
|
|
|
246
272
|
#number
|
|
247
|
-
REDIS_PORT
|
|
273
|
+
REDIS_PORT=${parseInt(envRedis.envPort)}
|
|
248
274
|
`;
|
|
249
275
|
let cleanEnvFile=envData.trim();
|
|
250
276
|
await fs.writeFile(`${path}/backend/.env`,cleanEnvFile);
|
|
@@ -283,7 +309,7 @@ app.listen(7000,()=> console.log("Server is on and running on port 7000"))
|
|
|
283
309
|
readFile=readFile=clean;
|
|
284
310
|
|
|
285
311
|
await fs.writeFile(`${path}/backend/index.js`,readFile);
|
|
286
|
-
|
|
312
|
+
spinner1.success({text:"redis setup is done enjoy!"});
|
|
287
313
|
|
|
288
314
|
}catch(err){
|
|
289
315
|
console.log("ioredis is not install for some reason");
|
package/index.js
CHANGED
|
@@ -8,7 +8,7 @@ let {nodejs}=require("./components/nodejs");
|
|
|
8
8
|
const {heading} =require("./components/welcomeHeading");
|
|
9
9
|
const {createNestJs}=require("./components/nestjs");
|
|
10
10
|
const {commonNextReactSetup}=require("./components/nextjsReactjsSetup");
|
|
11
|
-
|
|
11
|
+
const {expoSetup}=require("./components/exposetup");
|
|
12
12
|
|
|
13
13
|
async function main() {
|
|
14
14
|
await heading();
|
|
@@ -23,7 +23,7 @@ async function main() {
|
|
|
23
23
|
type: "rawlist",
|
|
24
24
|
name:"framework",
|
|
25
25
|
message:(m)=> `Which node js framework you want to use inside this folder = ${(m.folderName!=".")?m.folderName:"default folder we take"}?`,
|
|
26
|
-
choices: ["nodejs", "nestjs","reactjs","nextjs"],
|
|
26
|
+
choices: ["nodejs", "nestjs","reactjs","nextjs","react_expo"],
|
|
27
27
|
default: ["nodejs"]
|
|
28
28
|
},
|
|
29
29
|
]);
|
|
@@ -38,6 +38,8 @@ async function main() {
|
|
|
38
38
|
await commonNextReactSetup(answer.folderName,"reactjs");
|
|
39
39
|
}else if(answer.framework=="nextjs"){
|
|
40
40
|
await commonNextReactSetup(answer.folderName,"nextjs");
|
|
41
|
+
}else if(answer.framework=="react_expo"){
|
|
42
|
+
await expoSetup(answer.folderName);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
}
|