ms-vite-plugin 1.0.5 → 1.0.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.
- package/dist/cli.js +24 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -289,7 +289,14 @@ async function wsStopCommand() {
|
|
|
289
289
|
async function wsStatusCommand() {
|
|
290
290
|
await ensureValidKuaiJSProject(process.cwd());
|
|
291
291
|
if (!(await fsExtra.pathExists(WS_PID_FILE))) {
|
|
292
|
-
console.log(
|
|
292
|
+
console.log(JSON.stringify({
|
|
293
|
+
status: "stopped",
|
|
294
|
+
running: false,
|
|
295
|
+
pid: null,
|
|
296
|
+
address: null,
|
|
297
|
+
connected: false,
|
|
298
|
+
clientIp: null,
|
|
299
|
+
}));
|
|
293
300
|
return;
|
|
294
301
|
}
|
|
295
302
|
const info = await fsExtra.readJSON(WS_PID_FILE);
|
|
@@ -309,15 +316,24 @@ async function wsStatusCommand() {
|
|
|
309
316
|
}
|
|
310
317
|
if (!running) {
|
|
311
318
|
await fsExtra.remove(WS_PID_FILE);
|
|
312
|
-
console.log(
|
|
319
|
+
console.log(JSON.stringify({
|
|
320
|
+
status: "stopped",
|
|
321
|
+
running: false,
|
|
322
|
+
pid: null,
|
|
323
|
+
address: null,
|
|
324
|
+
connected: false,
|
|
325
|
+
clientIp: null,
|
|
326
|
+
}));
|
|
313
327
|
return;
|
|
314
328
|
}
|
|
315
|
-
console.log(
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
329
|
+
console.log(JSON.stringify({
|
|
330
|
+
status: "running",
|
|
331
|
+
running: true,
|
|
332
|
+
pid,
|
|
333
|
+
address,
|
|
334
|
+
connected,
|
|
335
|
+
clientIp: connected ? clientIp || "unknown" : null,
|
|
336
|
+
}));
|
|
321
337
|
}
|
|
322
338
|
/**
|
|
323
339
|
* 生成顶层 help 的详细命令参数说明
|