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.
Files changed (2) hide show
  1. package/dist/cli.js +24 -8
  2. 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("服务状态: stopped");
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("服务状态: stopped");
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(`服务状态: running (pid=${pid})`);
316
- console.log(`WS 地址: ${address}`);
317
- console.log(`连接状态: ${connected ? "connected" : "disconnected"}`);
318
- if (connected) {
319
- console.log(`设备IP: ${clientIp || "unknown"}`);
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 的详细命令参数说明
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {