create-stackflow 1.0.8 ā 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 +9 -17
- package/cli.js +1 -1
- package/package.json +1 -1
- package/src/commands/create.js +17 -3
- package/src/generators/frontend.js +2 -6
package/README.md
CHANGED
|
@@ -230,9 +230,17 @@ npx create-stackflow
|
|
|
230
230
|
|
|
231
231
|
## Start Project
|
|
232
232
|
|
|
233
|
+
### Start Backend
|
|
234
|
+
|
|
233
235
|
```bash
|
|
234
|
-
cd my-app
|
|
236
|
+
cd my-app/backend
|
|
237
|
+
npm run dev
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Start Frontend
|
|
235
241
|
|
|
242
|
+
```bash
|
|
243
|
+
cd my-app/frontend
|
|
236
244
|
npm run dev
|
|
237
245
|
```
|
|
238
246
|
|
|
@@ -248,22 +256,6 @@ MONGO_URI=mongodb://127.0.0.1:27017/myapp
|
|
|
248
256
|
|
|
249
257
|
---
|
|
250
258
|
|
|
251
|
-
# Root Development Scripts
|
|
252
|
-
|
|
253
|
-
StackFlow automatically configures:
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
npm run dev
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
This starts:
|
|
260
|
-
- frontend
|
|
261
|
-
- backend
|
|
262
|
-
|
|
263
|
-
simultaneously using `concurrently`.
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
259
|
# CLI Architecture
|
|
268
260
|
|
|
269
261
|
```text
|
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.9")
|
|
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
|
@@ -5,6 +5,7 @@ import fs from "fs-extra";
|
|
|
5
5
|
import ora from "ora";
|
|
6
6
|
import validatePackageName from "validate-npm-package-name";
|
|
7
7
|
import { execa } from "execa";
|
|
8
|
+
import concurrently from "concurrently";
|
|
8
9
|
import { askQuestions } from "../utils/prompts.js";
|
|
9
10
|
import { createRootFiles } from "../generators/root.js";
|
|
10
11
|
import { createBackend } from "../generators/backend.js";
|
|
@@ -62,7 +63,16 @@ export async function createStackFlow(options) {
|
|
|
62
63
|
if (context.runProject) {
|
|
63
64
|
console.log(chalk.cyan("\nš Starting the project..."));
|
|
64
65
|
try {
|
|
65
|
-
|
|
66
|
+
const { result } = concurrently(
|
|
67
|
+
[
|
|
68
|
+
{ command: "npm run dev", name: "backend", cwd: context.backendDir, prefixColor: "blue" },
|
|
69
|
+
{ command: "npm run dev", name: "frontend", cwd: context.frontendDir, prefixColor: "green" },
|
|
70
|
+
],
|
|
71
|
+
{
|
|
72
|
+
killOthers: ["failure", "success"],
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
await result;
|
|
66
76
|
} catch (error) {
|
|
67
77
|
console.error(chalk.red("\nFailed to start the project."));
|
|
68
78
|
console.error(chalk.dim(error.message));
|
|
@@ -164,8 +174,12 @@ function printSuccess(context) {
|
|
|
164
174
|
console.log(chalk.green.bold("StackFlow app created successfully."));
|
|
165
175
|
console.log();
|
|
166
176
|
console.log(chalk.white("Next steps:"));
|
|
167
|
-
console.log(chalk.
|
|
168
|
-
console.log(chalk.cyan(
|
|
177
|
+
console.log(chalk.white(" Start Backend:"));
|
|
178
|
+
console.log(chalk.cyan(` cd ${context.projectName}/${backend}`));
|
|
179
|
+
console.log(chalk.cyan(" npm run dev"));
|
|
180
|
+
console.log(chalk.white(" Start Frontend:"));
|
|
181
|
+
console.log(chalk.cyan(` cd ${context.projectName}/${frontend}`));
|
|
182
|
+
console.log(chalk.cyan(" npm run dev"));
|
|
169
183
|
console.log();
|
|
170
184
|
console.log(chalk.dim(`Frontend: ${frontend}`));
|
|
171
185
|
console.log(chalk.dim(`Backend: ${backend}`));
|
|
@@ -94,20 +94,16 @@ async function updateFrontendPackage(context) {
|
|
|
94
94
|
pkg.devDependencies["@tailwindcss/vite"] = "latest";
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
const backendName = path.basename(context.backendDir);
|
|
98
|
-
pkg.devDependencies = pkg.devDependencies || {};
|
|
99
|
-
pkg.devDependencies.concurrently = "^9.2.1";
|
|
100
|
-
|
|
101
97
|
if (context.frontend === "react") {
|
|
102
98
|
pkg.scripts = {
|
|
103
99
|
...(pkg.scripts || {}),
|
|
104
100
|
build: "vite build",
|
|
105
|
-
dev:
|
|
101
|
+
dev: "vite",
|
|
106
102
|
};
|
|
107
103
|
} else {
|
|
108
104
|
pkg.scripts = {
|
|
109
105
|
...(pkg.scripts || {}),
|
|
110
|
-
dev:
|
|
106
|
+
dev: "next dev",
|
|
111
107
|
};
|
|
112
108
|
}
|
|
113
109
|
|