nuxt-gin-tools 0.2.4 → 0.2.5
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/package.json +1 -1
- package/src/dev-go.js +5 -5
- package/src/update.js +1 -1
- package/src/utils.js +2 -2
package/package.json
CHANGED
package/src/dev-go.js
CHANGED
|
@@ -96,7 +96,7 @@ function loadWatchConfig() {
|
|
|
96
96
|
parsedConfig = JSON.parse((0, fs_extra_1.readFileSync)(configPath, "utf-8"));
|
|
97
97
|
}
|
|
98
98
|
catch (_j) {
|
|
99
|
-
console.warn(chalk_1.default.
|
|
99
|
+
console.warn(chalk_1.default.green(`[${LOG_TAG}] invalid watch config JSON, fallback to defaults: ${configPath}`));
|
|
100
100
|
return defaultConfig;
|
|
101
101
|
}
|
|
102
102
|
const includeExt = toStringArray((_a = parsedConfig.includeExt) !== null && _a !== void 0 ? _a : parsedConfig.include_ext)
|
|
@@ -240,7 +240,7 @@ function startGoDev() {
|
|
|
240
240
|
const watchRoots = watchConfig.includeDir.length
|
|
241
241
|
? watchConfig.includeDir.map((dir) => (0, path_1.join)(cwd, dir))
|
|
242
242
|
: [cwd];
|
|
243
|
-
console.log(chalk_1.default.
|
|
243
|
+
console.log(chalk_1.default.green(`[${LOG_TAG}] watching: ${watchRoots.map((item) => toProjectRelative(item)).join(", ")}`));
|
|
244
244
|
let restarting = false;
|
|
245
245
|
let goProc = runGoProcess();
|
|
246
246
|
let restartTimer = null;
|
|
@@ -265,7 +265,7 @@ function startGoDev() {
|
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
267
|
restarting = true;
|
|
268
|
-
console.log(chalk_1.default.
|
|
268
|
+
console.log(chalk_1.default.green(`[${LOG_TAG}] ${eventName}: ${relPath}, restarting...`));
|
|
269
269
|
yield stopGoProcess(goProc);
|
|
270
270
|
goProc = runGoProcess();
|
|
271
271
|
restarting = false;
|
|
@@ -276,7 +276,7 @@ function startGoDev() {
|
|
|
276
276
|
.on("change", (filePath) => triggerRestart("change", filePath))
|
|
277
277
|
.on("unlink", (filePath) => triggerRestart("unlink", filePath))
|
|
278
278
|
.on("error", (error) => {
|
|
279
|
-
console.error(chalk_1.default.
|
|
279
|
+
console.error(chalk_1.default.green(`[${LOG_TAG}] watcher error: ${String(error)}`));
|
|
280
280
|
});
|
|
281
281
|
const shutdown = () => __awaiter(this, void 0, void 0, function* () {
|
|
282
282
|
if (restartTimer) {
|
|
@@ -299,7 +299,7 @@ function startGoDev() {
|
|
|
299
299
|
if (require.main === module) {
|
|
300
300
|
// 兼容直接执行该文件(例如 node src/dev-go.js)。
|
|
301
301
|
startGoDev().catch((error) => {
|
|
302
|
-
console.error(chalk_1.default.
|
|
302
|
+
console.error(chalk_1.default.green(`[${LOG_TAG}] failed to start: ${String(error)}`));
|
|
303
303
|
process.exit(1);
|
|
304
304
|
});
|
|
305
305
|
}
|
package/src/update.js
CHANGED
package/src/utils.js
CHANGED
|
@@ -34,7 +34,7 @@ function killPortUnix(port, options) {
|
|
|
34
34
|
for (const pid of pids) {
|
|
35
35
|
try {
|
|
36
36
|
process.kill(pid, "SIGKILL");
|
|
37
|
-
console.log(chalk_1.default.
|
|
37
|
+
console.log(chalk_1.default.green(buildMessage(pid, port, "unix", options)));
|
|
38
38
|
}
|
|
39
39
|
catch (_a) {
|
|
40
40
|
// Best-effort: if the process is already gone, ignore.
|
|
@@ -81,7 +81,7 @@ function killPortWindows(port, options) {
|
|
|
81
81
|
(0, child_process_1.execSync)(`taskkill /PID ${pid} /F`, {
|
|
82
82
|
stdio: ["ignore", "ignore", "ignore"],
|
|
83
83
|
});
|
|
84
|
-
console.log(chalk_1.default.
|
|
84
|
+
console.log(chalk_1.default.green(buildMessage(pid, port, "win32", options)));
|
|
85
85
|
}
|
|
86
86
|
catch (_a) {
|
|
87
87
|
// Best-effort: if the process is already gone, ignore.
|