express-modular-monolith 1.0.2 → 1.1.4
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 +43 -5
- package/bin/cli.js +19 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,52 @@
|
|
|
1
1
|
# Express Modular Monolith
|
|
2
2
|
|
|
3
|
-
Generate an Express modular monolith boilerplate.
|
|
3
|
+
Generate an Express modular monolith boilerplate with JavaScript or TypeScript.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
|
+
|
|
6
7
|
```bash
|
|
7
8
|
npx express-modular-monolith
|
|
8
9
|
```
|
|
10
|
+
|
|
9
11
|
## Features
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
* JavaScript template
|
|
14
|
+
* TypeScript template
|
|
15
|
+
* Modular monolith structure
|
|
16
|
+
* Express
|
|
17
|
+
* Automatic Git repository initialization
|
|
18
|
+
* Automatic initial Git commit
|
|
19
|
+
|
|
20
|
+
## What's New in v1.1.4
|
|
21
|
+
|
|
22
|
+
* Added automatic `git init` after generating the project
|
|
23
|
+
* Added automatic initial commit for the generated boilerplate
|
|
24
|
+
* The generated project is ready to start tracking with Git immediately
|
|
25
|
+
|
|
26
|
+
## How It Works
|
|
27
|
+
|
|
28
|
+
Run:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx express-modular-monolith
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Choose your preferred language and project location. The CLI will:
|
|
35
|
+
|
|
36
|
+
1. Generate the selected boilerplate
|
|
37
|
+
2. Install the required dependencies
|
|
38
|
+
3. Initialize a Git repository
|
|
39
|
+
4. Add the generated files to Git
|
|
40
|
+
5. Create an initial commit
|
|
41
|
+
|
|
42
|
+
Your generated project will be ready for development with Git already configured.
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
* Node.js
|
|
47
|
+
* npm
|
|
48
|
+
* Git
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
package/bin/cli.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { exec } from "node:child_process";
|
|
5
|
+
import { exec as execCallback } from "node:child_process";
|
|
6
|
+
import { promisify } from "node:util";
|
|
6
7
|
import fs from "node:fs/promises";
|
|
7
8
|
import { input, select } from "@inquirer/prompts";
|
|
8
9
|
|
|
10
|
+
const exec = promisify(execCallback);
|
|
9
11
|
|
|
10
12
|
const projectName = await input({
|
|
11
13
|
message: "Project name:"
|
|
@@ -51,8 +53,24 @@ await fs.writeFile(
|
|
|
51
53
|
JSON.stringify(packageJson, null, 2)
|
|
52
54
|
);
|
|
53
55
|
|
|
56
|
+
await exec("npx gitignore node", {
|
|
57
|
+
cwd: projectPath
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
await fs.writeFile(".env", "PORT=8000\n")
|
|
61
|
+
|
|
54
62
|
await exec("npm install", {
|
|
55
63
|
cwd: projectPath
|
|
56
64
|
})
|
|
57
65
|
|
|
66
|
+
await exec("git init", {
|
|
67
|
+
cwd: projectPath
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
await exec("git add .", {
|
|
71
|
+
cwd: projectPath
|
|
72
|
+
})
|
|
58
73
|
|
|
74
|
+
await exec(`git commit -m "Initial commit"`, {
|
|
75
|
+
cwd: projectPath
|
|
76
|
+
})
|