@dolphjs/cli 1.2.1 → 1.2.2

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.
@@ -22,8 +22,12 @@ export const startApp = () => {
22
22
  spawnArgs = [indexFilePath];
23
23
  }
24
24
  if (child) {
25
+ child.on("exit", () => {
26
+ child = null;
27
+ });
25
28
  // If child process is already running, gracefully close it before restarting
26
29
  child.kill("SIGTERM");
30
+ // child.kill("SIGKILL");
27
31
  }
28
32
  child = spawn(fileExtension === "ts" ? "ts-node" : "node", spawnArgs, {
29
33
  stdio: "inherit",
@@ -35,6 +39,7 @@ export const startApp = () => {
35
39
  child.on("close", (code) => {
36
40
  if (code === 1) {
37
41
  console.error(`${chalk.bold(chalk.red("[DOLPH ERROR]: "))} ${chalk.redBright("exiting watch mode ...")}`);
42
+ child = null;
38
43
  process.exit(1);
39
44
  }
40
45
  });
@@ -71,6 +76,9 @@ export const startProdApp = () => {
71
76
  indexFilePath = join(getRootDirectory(), "src", `server.ts`);
72
77
  const spawnArgs = ["src", "-d", "app", "--source-maps", "--copy-files"];
73
78
  if (child) {
79
+ child.on("exit", () => {
80
+ child = null;
81
+ });
74
82
  child.kill("SIGTERM");
75
83
  }
76
84
  child = spawn("swc", spawnArgs, {
@@ -2,6 +2,6 @@ import chalk from "chalk";
2
2
  import { program } from "commander";
3
3
  export const packageDescription = () => {
4
4
  program
5
- .version("1.2.1")
6
- .description(chalk.cyan("The dolph-cli is a tool for efficient intialization and management of a dolphjs project"));
5
+ .version("1.2.2")
6
+ .description(chalk.cyan("The dolph-cli is a tool for efficient initialization and management of a dolphjs project"));
7
7
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dolphjs/cli",
3
- "version": "1.2.1",
4
- "description": "The dolphjs-cli is a tool for efficient intialization and management of a dolphjs project",
3
+ "version": "1.2.2",
4
+ "description": "The dolphjs-cli is a tool for efficient initialization and management of a dolphjs project",
5
5
  "main": "./dist/index.js",
6
6
  "repository": "https://github.com/dolphjs/dolph-cli.git",
7
7
  "author": "<https://github.com/Xlaez>",