express-modular-monolith 1.0.2 → 1.1.3

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.
Files changed (2) hide show
  1. package/bin/cli.js +19 -1
  2. package/package.json +1 -1
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
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-modular-monolith",
3
- "version": "1.0.2",
3
+ "version": "1.1.3",
4
4
  "description": "This is a modular monolith project generator for Express.js",
5
5
  "type": "module",
6
6
  "bin": {