collabdocchat 1.2.9 → 1.2.10

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/USAGE.md CHANGED
@@ -294,3 +294,4 @@ mongod --version
294
294
 
295
295
  祝您使用愉快!🚀
296
296
 
297
+
package/bin/cli.js CHANGED
@@ -1,66 +1,66 @@
1
- #!/usr/bin/env node
2
-
3
- import { spawn, exec } from 'child_process';
4
- import { platform } from 'os';
5
- import { fileURLToPath } from 'url';
6
- import { dirname, join } from 'path';
7
- import { existsSync } from 'fs';
8
-
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = dirname(__filename);
11
- const rootDir = join(__dirname, '..');
12
- const isWindows = platform() === 'win32';
13
-
14
- console.log('\n🎉 欢迎使用 CollabDocChat!\n');
15
- console.log('📦 开源的实时协作文档聊天平台\n');
16
-
17
- // 检查是否在正确的目录
18
- const serverPath = join(rootDir, 'server', 'index.js');
19
- if (!existsSync(serverPath)) {
20
- console.error('❌ 错误:找不到服务器文件');
21
- console.error(' 这个包需要在安装后的目录中运行');
22
- console.error('\n💡 推荐使用方式:');
23
- console.error(' 1. npm install collabdocchat');
24
- console.error(' 2. cd node_modules/collabdocchat');
25
- console.error(' 3. npm start');
26
- console.error('\n 或者直接运行: npm start (在安装了 collabdocchat 的项目中)');
27
- process.exit(1);
28
- }
29
-
30
- console.log('🚀 正在启动应用...\n');
31
-
32
- // 使用 npm start 脚本来启动
33
- const npmCmd = isWindows ? 'npm.cmd' : 'npm';
34
- const startProcess = spawn(npmCmd, ['start'], {
35
- cwd: rootDir,
36
- stdio: 'inherit',
37
- shell: true
38
- });
39
-
40
- startProcess.on('error', (error) => {
41
- console.error('❌ 启动失败:', error.message);
42
- console.error('\n💡 请尝试手动启动:');
43
- console.error(` cd ${rootDir}`);
44
- console.error(' npm start');
45
- process.exit(1);
46
- });
47
-
48
- startProcess.on('exit', (code) => {
49
- if (code !== 0) {
50
- console.log(`\n⚠️ 进程退出,代码: ${code}`);
51
- }
52
- });
53
-
54
- // 处理退出信号
55
- process.on('SIGINT', () => {
56
- console.log('\n\n👋 正在关闭应用...');
57
- startProcess.kill('SIGINT');
58
- process.exit(0);
59
- });
60
-
61
- process.on('SIGTERM', () => {
62
- console.log('\n\n👋 正在关闭应用...');
63
- startProcess.kill('SIGTERM');
64
- process.exit(0);
65
- });
66
-
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn, exec } from 'child_process';
4
+ import { platform } from 'os';
5
+ import { fileURLToPath } from 'url';
6
+ import { dirname, join } from 'path';
7
+ import { existsSync } from 'fs';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const rootDir = join(__dirname, '..');
12
+ const isWindows = platform() === 'win32';
13
+
14
+ console.log('\n🎉 欢迎使用 CollabDocChat!\n');
15
+ console.log('📦 开源的实时协作文档聊天平台\n');
16
+
17
+ // 检查是否在正确的目录
18
+ const serverPath = join(rootDir, 'server', 'index.js');
19
+ if (!existsSync(serverPath)) {
20
+ console.error('❌ 错误:找不到服务器文件');
21
+ console.error(' 这个包需要在安装后的目录中运行');
22
+ console.error('\n💡 推荐使用方式:');
23
+ console.error(' 1. npm install collabdocchat');
24
+ console.error(' 2. cd node_modules/collabdocchat');
25
+ console.error(' 3. npm start');
26
+ console.error('\n 或者直接运行: npm start (在安装了 collabdocchat 的项目中)');
27
+ process.exit(1);
28
+ }
29
+
30
+ console.log('🚀 正在启动应用...\n');
31
+
32
+ // 使用 npm start 脚本来启动
33
+ const npmCmd = isWindows ? 'npm.cmd' : 'npm';
34
+ const startProcess = spawn(npmCmd, ['start'], {
35
+ cwd: rootDir,
36
+ stdio: 'inherit',
37
+ shell: true
38
+ });
39
+
40
+ startProcess.on('error', (error) => {
41
+ console.error('❌ 启动失败:', error.message);
42
+ console.error('\n💡 请尝试手动启动:');
43
+ console.error(` cd ${rootDir}`);
44
+ console.error(' npm start');
45
+ process.exit(1);
46
+ });
47
+
48
+ startProcess.on('exit', (code) => {
49
+ if (code !== 0) {
50
+ console.log(`\n⚠️ 进程退出,代码: ${code}`);
51
+ }
52
+ });
53
+
54
+ // 处理退出信号
55
+ process.on('SIGINT', () => {
56
+ console.log('\n\n👋 正在关闭应用...');
57
+ startProcess.kill('SIGINT');
58
+ process.exit(0);
59
+ });
60
+
61
+ process.on('SIGTERM', () => {
62
+ console.log('\n\n👋 正在关闭应用...');
63
+ startProcess.kill('SIGTERM');
64
+ process.exit(0);
65
+ });
66
+
@@ -48,3 +48,4 @@ pause
48
48
 
49
49
 
50
50
 
51
+
@@ -50,3 +50,4 @@ echo ""
50
50
 
51
51
 
52
52
 
53
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "collabdocchat",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "开源的实时协作文档聊天平台 - 集成任务管理、多人文档编辑、智能点名功能",
5
5
  "main": "./server/index.js",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  import { ApiService } from '../services/api.js';
2
2
  import { AuthService } from '../services/auth.js';
3
- import Quill from 'quill';
3
+ import Quill from 'quill/dist/quill.js';
4
4
  import 'quill/dist/quill.snow.css';
5
5
  import 'emoji-picker-element';
6
6