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 +1 -0
- package/bin/cli.js +66 -66
- package/install-and-start.bat +1 -0
- package/install-and-start.sh +1 -0
- package/package.json +1 -1
- package/src/pages/user-dashboard.js +1 -1
package/USAGE.md
CHANGED
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
|
+
|
package/install-and-start.bat
CHANGED
package/install-and-start.sh
CHANGED
package/package.json
CHANGED