create-stackflow 1.0.4 → 1.0.7
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 +4 -6
- package/cli.js +1 -1
- package/package.json +1 -1
- package/src/commands/create.js +9 -8
- package/src/generators/backend.js +264 -192
- package/src/generators/chat.js +661 -0
- package/src/generators/frontend.js +227 -118
- package/src/generators/root.js +6 -58
- package/src/utils/install.js +42 -0
- package/src/utils/prompts.js +26 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Features:
|
|
|
65
65
|
- React Router DOM
|
|
66
66
|
- Zustand / Redux Toolkit / Context API
|
|
67
67
|
- React Hook Form
|
|
68
|
-
- Zod / Yup validation
|
|
68
|
+
- Zod / Yup validation (Joi is backend-only)
|
|
69
69
|
- Axios API layer
|
|
70
70
|
- TanStack Query
|
|
71
71
|
- Protected routes
|
|
@@ -141,14 +141,12 @@ StackFlow automatically generates:
|
|
|
141
141
|
my-app/
|
|
142
142
|
│
|
|
143
143
|
├── frontend/
|
|
144
|
+
│ └── package.json
|
|
144
145
|
│
|
|
145
146
|
├── backend/
|
|
147
|
+
│ └── package.json
|
|
146
148
|
│
|
|
147
|
-
|
|
148
|
-
│
|
|
149
|
-
├── .gitignore
|
|
150
|
-
│
|
|
151
|
-
└── README.md
|
|
149
|
+
└── node_modules/ (hoisted at project root after install)
|
|
152
150
|
```
|
|
153
151
|
|
|
154
152
|
---
|
package/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ const program = new Command();
|
|
|
8
8
|
program
|
|
9
9
|
.name("create-stackflow")
|
|
10
10
|
.description("Generate a production-minded MERN starter with frontend, backend, auth, CRUD, and dashboard UI.")
|
|
11
|
-
.version("1.0.
|
|
11
|
+
.version("1.0.7")
|
|
12
12
|
.argument("[project-name]", "project folder name")
|
|
13
13
|
.option("--skip-install", "generate files without installing dependencies")
|
|
14
14
|
.option("--yes", "use recommended defaults")
|
package/package.json
CHANGED
package/src/commands/create.js
CHANGED
|
@@ -10,6 +10,7 @@ import { createRootFiles } from "../generators/root.js";
|
|
|
10
10
|
import { createBackend } from "../generators/backend.js";
|
|
11
11
|
import { createFrontend } from "../generators/frontend.js";
|
|
12
12
|
import { formatName } from "../utils/names.js";
|
|
13
|
+
import { installHoistedWorkspace } from "../utils/install.js";
|
|
13
14
|
|
|
14
15
|
export async function createStackFlow(options) {
|
|
15
16
|
printBanner();
|
|
@@ -51,8 +52,8 @@ export async function createStackFlow(options) {
|
|
|
51
52
|
await createBackend(context);
|
|
52
53
|
|
|
53
54
|
if (!context.skipInstall) {
|
|
54
|
-
await step("Installing root
|
|
55
|
-
|
|
55
|
+
await step("Installing dependencies (root node_modules)", () =>
|
|
56
|
+
installHoistedWorkspace(context),
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -61,7 +62,7 @@ export async function createStackFlow(options) {
|
|
|
61
62
|
if (context.runProject) {
|
|
62
63
|
console.log(chalk.cyan("\n🚀 Starting the project..."));
|
|
63
64
|
try {
|
|
64
|
-
await execa("npm", ["run", "dev"], { cwd:
|
|
65
|
+
await execa("npm", ["run", "dev"], { cwd: context.frontendDir, stdio: "inherit" });
|
|
65
66
|
} catch (error) {
|
|
66
67
|
console.error(chalk.red("\nFailed to start the project."));
|
|
67
68
|
console.error(chalk.dim(error.message));
|
|
@@ -77,6 +78,7 @@ function recommendedDefaults(projectName) {
|
|
|
77
78
|
frontend: "react",
|
|
78
79
|
language: "typescript",
|
|
79
80
|
backendLanguage: "javascript",
|
|
81
|
+
backendModule: "esm",
|
|
80
82
|
styling: "tailwind",
|
|
81
83
|
tailwind: true,
|
|
82
84
|
uiLibrary: "shadcn",
|
|
@@ -103,17 +105,16 @@ function recommendedDefaults(projectName) {
|
|
|
103
105
|
orm: "Mongoose",
|
|
104
106
|
authStrategy: "JWT",
|
|
105
107
|
passwordHashing: "bcryptjs",
|
|
106
|
-
fileUpload: "
|
|
108
|
+
fileUpload: "None",
|
|
107
109
|
backendValidation: "None",
|
|
108
110
|
securityPackages: ["helmet", "cors", "express-rate-limit", "hpp"],
|
|
109
|
-
cookieParser: true,
|
|
110
111
|
logging: "Morgan",
|
|
111
|
-
swagger:
|
|
112
|
+
swagger: false,
|
|
112
113
|
socketio: false,
|
|
113
114
|
winston: false,
|
|
114
115
|
morgan: true,
|
|
115
116
|
cloudinary: false,
|
|
116
|
-
multer:
|
|
117
|
+
multer: false,
|
|
117
118
|
helmet: true,
|
|
118
119
|
cors: true,
|
|
119
120
|
rateLimit: true,
|
|
@@ -163,7 +164,7 @@ function printSuccess(context) {
|
|
|
163
164
|
console.log(chalk.green.bold("StackFlow app created successfully."));
|
|
164
165
|
console.log();
|
|
165
166
|
console.log(chalk.white("Next steps:"));
|
|
166
|
-
console.log(chalk.cyan(` cd ${context.projectName}`));
|
|
167
|
+
console.log(chalk.cyan(` cd ${context.projectName}/${frontend}`));
|
|
167
168
|
console.log(chalk.cyan(" npm run dev"));
|
|
168
169
|
console.log();
|
|
169
170
|
console.log(chalk.dim(`Frontend: ${frontend}`));
|