@dolphjs/cli 1.1.5 → 1.1.6

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.
@@ -4,6 +4,7 @@ import chalk from "chalk";
4
4
  import { getRootDirectory } from "../utils/get_root_dir_path.js";
5
5
  import { readConfig } from "../utils/read_user_config_path.js";
6
6
  import { join } from "path";
7
+ import { debounce } from "lodash";
7
8
  let fileExtension = "";
8
9
  let indexFilePath = "";
9
10
  export const startApp = () => {
@@ -104,6 +105,7 @@ const watcher = chokidar.watch([], {
104
105
  ignoreInitial: false,
105
106
  });
106
107
  let isWatcherActive = false;
108
+ const debouncedStartApp = debounce(startApp, 1000);
107
109
  export const watchFile = () => {
108
110
  if (!isWatcherActive) {
109
111
  console.log(`${chalk.bold(chalk.green("[DOLPH INFO]: "))} ${chalk.greenBright("watching files for changes ...")}`);
@@ -114,7 +116,7 @@ export const watchFile = () => {
114
116
  watcher.on("all", (_event, path) => {
115
117
  `${chalk.bold(chalk.green("[DOLPH INFO]: "))} ${chalk.greenBright("file changed" + `[${path}]`)}`;
116
118
  if (path.endsWith(".ts") || path.endsWith(".js")) {
117
- startApp();
119
+ debouncedStartApp();
118
120
  }
119
121
  });
120
122
  process.on("SIGINT", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolphjs/cli",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "The dolphjs-cli is a tool for efficient intialization and management of a dolphjs project",
5
5
  "main": "./dist/index.js",
6
6
  "repository": "https://github.com/dolphjs/dolph-cli.git",
@@ -46,11 +46,13 @@
46
46
  "figlet": "^1.7.0",
47
47
  "inquirer": "^9.2.12",
48
48
  "js-yaml": "^4.1.0",
49
+ "lodash": "^4.17.21",
49
50
  "rimraf": "^5.0.5"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@types/figlet": "^1.5.8",
53
54
  "@types/inquirer": "^9.0.7",
55
+ "@types/lodash": "^4.14.202",
54
56
  "@types/node": "^20.9.1",
55
57
  "eslint": "^8.54.0",
56
58
  "eslint-config-airbnb-base": "^15.0.0",