create-fullstack-setup 1.0.10 → 1.0.12

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/bin/index.js CHANGED
@@ -14,59 +14,90 @@ const answers = await inquirer.prompt([
14
14
  validate: (input) => (input ? true : "Project name is required")
15
15
  },
16
16
  {
17
- type: "rawlist",
18
- name: "frontend",
19
- message: "Choose frontend:",
20
- choices: ["React", "Next.js", "None"]
17
+ type: "rawlist",
18
+ name: "frontend",
19
+ message: "Choose frontend:",
20
+ choices: ["React", "Next.js", "None"]
21
+ },
22
+ {
23
+ type: "rawlist",
24
+ name: "backend",
25
+ message: "Choose backend:",
26
+ choices: ["Express"]
27
+ },
28
+ {
29
+ type: "rawlist",
30
+ name: "language",
31
+ message: "Choose language:",
32
+ choices: ["JavaScript", "TypeScript"]
33
+ },
34
+
35
+ {
36
+ type: "confirm",
37
+ name: "useBackendFeatures",
38
+ message: "Select backend features?",
39
+ default: true
21
40
  },
41
+
22
42
  {
23
- type: "rawlist",
24
- name: "backend",
25
- message: "Choose backend:",
26
- choices: ["Express"]
43
+ type: "confirm",
44
+ name: "JWT",
45
+ message: "Use JWT authentication?",
46
+ default: true,
47
+ when: (ans) => ans.useBackendFeatures
27
48
  },
28
49
  {
29
- type: "rawlist",
30
- name: "language",
31
- message: "Choose language:",
32
- choices: ["JavaScript", "TypeScript"]
50
+ type: "confirm",
51
+ name: "CORS",
52
+ message: "Enable CORS?",
53
+ default: true,
54
+ when: (ans) => ans.useBackendFeatures
33
55
  },
34
56
  {
35
57
  type: "confirm",
36
- name: "useBackendFeatures",
37
- message: "Select backend features?",
38
- default: true
58
+ name: "CookieParser",
59
+ message: "Use Cookie Parser?",
60
+ default: true,
61
+ when: (ans) => ans.useBackendFeatures
39
62
  },
40
63
  {
41
64
  type: "confirm",
42
- name: "useJWT",
43
- message: "Use JWT authentication?",
65
+ name: "dotenv",
66
+ message: "Use environment variable ?",
44
67
  default: true,
45
68
  when: (ans) => ans.useBackendFeatures
46
69
  },
47
70
  {
48
71
  type: "confirm",
49
- name: "useCORS",
50
- message: "Enable CORS?",
72
+ name: "Zod",
73
+ message: "Use Zod validator?",
51
74
  default: true,
52
75
  when: (ans) => ans.useBackendFeatures
53
76
  },
54
77
  {
55
78
  type: "confirm",
56
- name: "useCookieParser",
57
- message: "Use Cookie Parser?",
79
+ name: "multer",
80
+ message: "Use multer ?",
81
+ default: true,
82
+ when: (ans) => ans.useBackendFeatures
83
+ },
84
+ {
85
+ type: "confirm",
86
+ name: "Mongoose",
87
+ message: "Use MongoDB (Mongoose)?",
58
88
  default: true,
59
89
  when: (ans) => ans.useBackendFeatures
60
90
  },
61
91
  {
62
92
  type: "confirm",
63
- name: "useCloudinary",
64
- message: "Use Cloudinary?",
93
+ name: "Bcrypt",
94
+ message: "Use Bcrypt for password hashing?",
65
95
  default: true,
66
96
  when: (ans) => ans.useBackendFeatures
67
97
  }
68
98
  ]);
69
99
 
100
+
70
101
  const frontendMap = {
71
102
  React: {
72
103
  JavaScript: "react-js",
@@ -87,13 +118,19 @@ const backendMap = {
87
118
  };
88
119
 
89
120
  const backendFeatures = [];
121
+
90
122
  if (answers.useBackendFeatures) {
91
- if (answers.useJWT) backendFeatures.push("JWT");
92
- if (answers.useCORS) backendFeatures.push("CORS");
93
- if (answers.useCookieParser) backendFeatures.push("Cookie-Parser");
94
- if (answers.useCloudinary) backendFeatures.push("Cloudinary");
123
+ if (answers.JWT) backendFeatures.push("JWT");
124
+ if (answers.CORS) backendFeatures.push("CORS");
125
+ if (answers.CookieParser) backendFeatures.push("Cookie-Parser");
126
+ if (answers.dotenv) backendFeatures.push("Dotenv");
127
+ if (answers.Zod) backendFeatures.push("Zod");
128
+ if (answers.multer) backendFeatures.push("Multer");
129
+ if (answers.Mongoose) backendFeatures.push("Mongoose");
130
+ if (answers.Bcrypt) backendFeatures.push("Bcrypt");
95
131
  }
96
132
 
133
+
97
134
  const config = {
98
135
  projectName: answers.projectName,
99
136
  frontend:
@@ -104,4 +141,4 @@ const config = {
104
141
  backendFeatures
105
142
  };
106
143
 
107
- await createProject(config);
144
+ await createProject(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fullstack-setup",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "CLI to generate ready-to-run fullstack or backend applications",
5
5
  "bin": {
6
6
  "create-fullstack-setup": "bin/index.js"
@@ -1,3 +1,4 @@
1
+
1
2
  export const FEATURES = {
2
3
  CORS: {
3
4
  middleware: `
package/utils/prompts.js CHANGED
@@ -1,59 +0,0 @@
1
- import { type } from "os";
2
-
3
- const answers = await inquirer.prompt([
4
- {
5
- type:"confirm",
6
- name:"express",
7
- message:"install express ?",
8
- default:true
9
- },
10
-
11
- {
12
- type: "confirm",
13
- name: "JWT",
14
- message: "Use JWT authentication?",
15
- default: true
16
- },
17
- {
18
- type: "confirm",
19
- name: "CORS",
20
- message: "Enable CORS?",
21
- default: true
22
- },
23
- {
24
- type: "confirm",
25
- name: "CookieParser",
26
- message: "Use Cookie Parser?",
27
- default: true
28
- },
29
- {
30
- type: "confirm",
31
- name: "dotenv",
32
- message: "Use environment variable ?",
33
- default: true
34
- },
35
- {
36
- type: "confirm",
37
- name: "Zod",
38
- message: "Use Zod validator?",
39
- default: true
40
- },
41
- {
42
- type: "confirm",
43
- name: "multer",
44
- message: "Use multer ?",
45
- default: true
46
- },
47
- {
48
- type: "confirm",
49
- name: "Mongoose",
50
- message: "Use MongoDB (Mongoose)?",
51
- default: false
52
- },
53
- {
54
- type: "confirm",
55
- name: "Bcrypt",
56
- message: "Use Bcrypt for password hashing?",
57
- default: true
58
- }
59
- ]);