collabdocchat 1.0.6 → 1.0.7

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/.gitignore CHANGED
@@ -134,3 +134,6 @@ dist
134
134
  .yarn/build-state.yml
135
135
  .yarn/install-state.gz
136
136
  .pnp.*
137
+
138
+ # CollabDocChat 进程 PID 文件
139
+ .collabdocchat.pid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "collabdocchat",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "开源的实时协作文档聊天平台 - 集成任务管理、多人文档编辑、智能点名功能",
5
5
  "main": "./server/index.js",
6
6
  "type": "module",
@@ -2,7 +2,7 @@ import { exec } from 'child_process';
2
2
  import { platform } from 'os';
3
3
  import { fileURLToPath } from 'url';
4
4
  import { dirname, join } from 'path';
5
- import { existsSync, unlinkSync } from 'fs';
5
+ import { existsSync, unlinkSync, readFileSync } from 'fs';
6
6
 
7
7
  const __filename = fileURLToPath(import.meta.url);
8
8
  const __dirname = dirname(__filename);
@@ -14,11 +14,10 @@ const isWindows = platform() === 'win32';
14
14
  console.log('🛑 正在停止 CollabDocChat 服务...\n');
15
15
 
16
16
  // 读取 PID 文件
17
- async function readPidFile() {
17
+ function readPidFile() {
18
18
  if (existsSync(pidFile)) {
19
19
  try {
20
- const fs = await import('fs/promises');
21
- const content = await fs.readFile(pidFile, 'utf-8');
20
+ const content = readFileSync(pidFile, 'utf-8');
22
21
  return content.trim().split('\n').filter(Boolean);
23
22
  } catch (error) {
24
23
  return [];
@@ -104,7 +103,7 @@ async function main() {
104
103
  let stopped = false;
105
104
 
106
105
  // 方法1: 通过 PID 文件停止
107
- const pids = await readPidFile();
106
+ const pids = readPidFile();
108
107
  if (pids.length > 0) {
109
108
  console.log(`📋 找到 ${pids.length} 个进程记录`);
110
109
  for (const pid of pids) {