@dolphjs/cli 1.0.21 → 1.0.22
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/dist/daemon/watcher.js +22 -15
- package/package.json +1 -1
package/dist/daemon/watcher.js
CHANGED
|
@@ -55,22 +55,29 @@ export const startProdApp = () => {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
|
+
const watcher = chokidar.watch(indexFilePath, {
|
|
59
|
+
ignored: "/node_modules",
|
|
60
|
+
persistent: true,
|
|
61
|
+
ignoreInitial: false,
|
|
62
|
+
});
|
|
63
|
+
let isWatcherActive = false;
|
|
58
64
|
export const watchFile = () => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
if (!isWatcherActive) {
|
|
66
|
+
console.log(chalk.bold(`${chalk.green("[DOLPH INFO]: ")} ${chalk.greenBright("watching files for changes ...")}`));
|
|
67
|
+
isWatcherActive = true;
|
|
68
|
+
fileExtension = readConfig().language;
|
|
69
|
+
watcher.on("all", (_event, path) => {
|
|
70
|
+
chalk.bold(`${chalk.green("[DOLPH INFO]: ")} ${chalk.greenBright("file changed" + `[${path}]`)}`);
|
|
71
|
+
startApp();
|
|
72
|
+
});
|
|
73
|
+
process.on("SIGINT", () => {
|
|
74
|
+
watcher.close();
|
|
75
|
+
process.exit(0);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
console.log(chalk.bold(`${chalk.red("[DOLPH ERROR]: ")} ${chalk.redBright("watcher is already active.")}`));
|
|
80
|
+
}
|
|
74
81
|
};
|
|
75
82
|
// startApp();
|
|
76
83
|
// watchFile();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dolphjs/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
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",
|