@ytchuan/flowlink 1.0.2 → 1.0.4
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/README.md +17 -4
- package/bin/flowlink.js +25 -8
- package/main.js +10 -0
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -18,7 +18,8 @@ app/
|
|
|
18
18
|
│ └── updater.js # 更新检查
|
|
19
19
|
├── scripts/ # 发布辅助脚本
|
|
20
20
|
│ ├── copy-ui.js # 发布前复制渲染层产物到包内
|
|
21
|
-
│
|
|
21
|
+
│ ├── manifest-electron.js # 切换 electron 依赖位置(保留兼容)
|
|
22
|
+
│ └── release.js # 发布脚本(处理 electron 依赖 + 调用 npm publish)
|
|
22
23
|
├── docs/ # 设计文档与 Agent 说明
|
|
23
24
|
└── package.json # 依赖与 electron-builder 打包配置
|
|
24
25
|
```
|
|
@@ -31,14 +32,26 @@ app/
|
|
|
31
32
|
|
|
32
33
|
## 用户安装与运行
|
|
33
34
|
|
|
34
|
-
### 前置注意事项
|
|
35
|
-
|
|
36
35
|
```bash
|
|
37
|
-
export ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
|
|
38
36
|
npm install -g @ytchuan/flowlink
|
|
39
37
|
flowlink
|
|
40
38
|
```
|
|
41
39
|
|
|
40
|
+
> 首次安装会下载 Electron(~150MB),包内已配置国内镜像加速下载。
|
|
41
|
+
> `flowlink` 默认后台运行,不占用终端。如需调试,使用 `flowlink --foreground` 前台运行。
|
|
42
|
+
|
|
43
|
+
## 版本更新
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm update -g @ytchuan/flowlink
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 卸载
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm uninstall -g @ytchuan/flowlink
|
|
53
|
+
```
|
|
54
|
+
|
|
42
55
|
## 注意事项
|
|
43
56
|
1. macOS 打包可能需要在「系统设置 > 隐私与安全性」中允许相关权限。
|
|
44
57
|
2. 本地调度服务端口默认为 `51173`,如果`51173`被占用时自动回退到 `51172`、`51171`。
|
package/bin/flowlink.js
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* FlowLink CLI 入口
|
|
5
5
|
* npm install -g @ytchuan/flowlink 后,用户直接执行 flowlink 即可启动
|
|
6
|
+
*
|
|
7
|
+
* 用法:
|
|
8
|
+
* flowlink # 后台运行(推荐)
|
|
9
|
+
* flowlink --foreground # 前台运行(调试用,终端显示日志)
|
|
6
10
|
*/
|
|
7
11
|
const { spawn } = require('child_process')
|
|
8
12
|
const path = require('path')
|
|
@@ -13,12 +17,25 @@ const electronPath = require('electron')
|
|
|
13
17
|
// 应用根目录(bin 的上一级)
|
|
14
18
|
const appDir = path.join(__dirname, '..')
|
|
15
19
|
|
|
16
|
-
//
|
|
17
|
-
const
|
|
18
|
-
stdio: 'inherit',
|
|
19
|
-
env: process.env,
|
|
20
|
-
})
|
|
20
|
+
// 检查是否前台模式(调试用)
|
|
21
|
+
const isForeground = process.argv.includes('--foreground') || process.argv.includes('-f')
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (isForeground) {
|
|
24
|
+
// 前台模式:继承终端,显示日志,Ctrl+C 退出
|
|
25
|
+
const child = spawn(electronPath, [appDir], {
|
|
26
|
+
stdio: 'inherit',
|
|
27
|
+
env: process.env,
|
|
28
|
+
})
|
|
29
|
+
child.on('close', (code) => {
|
|
30
|
+
process.exitCode = code
|
|
31
|
+
})
|
|
32
|
+
} else {
|
|
33
|
+
// 后台模式:分离进程,立即返回终端控制权给用户
|
|
34
|
+
const child = spawn(electronPath, [appDir], {
|
|
35
|
+
detached: true,
|
|
36
|
+
stdio: 'ignore',
|
|
37
|
+
env: process.env,
|
|
38
|
+
})
|
|
39
|
+
child.unref() // 允许父进程退出,不等待子进程
|
|
40
|
+
console.log('FlowLink 已在后台启动')
|
|
41
|
+
}
|
package/main.js
CHANGED
|
@@ -248,6 +248,16 @@ function registerIpcHandlers() {
|
|
|
248
248
|
// ---- App 生命周期 ----
|
|
249
249
|
app.whenReady().then(() => {
|
|
250
250
|
registerIpcHandlers()
|
|
251
|
+
|
|
252
|
+
// macOS: 设置 Dock 图标(非打包模式下默认显示 Electron 图标)
|
|
253
|
+
if (process.platform === 'darwin' && app.dock) {
|
|
254
|
+
const { nativeImage } = require('electron')
|
|
255
|
+
const dockIcon = nativeImage.createFromPath(path.join(__dirname, 'assets', 'logo512.png'))
|
|
256
|
+
if (!dockIcon.isEmpty()) {
|
|
257
|
+
app.dock.setIcon(dockIcon)
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
251
261
|
createWindow()
|
|
252
262
|
|
|
253
263
|
// 调度服务不随软件启动,由主页"启动服务"按钮触发(scheduler:start)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ytchuan/flowlink",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "FlowLink 桌面客户端 - AI 服务调度与管理",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"services/",
|
|
14
14
|
"app-ui/dist/",
|
|
15
15
|
"assets/",
|
|
16
|
-
"resources/"
|
|
16
|
+
"resources/",
|
|
17
|
+
".npmrc"
|
|
17
18
|
],
|
|
18
19
|
"engines": {
|
|
19
20
|
"node": ">=22"
|
|
@@ -30,10 +31,8 @@
|
|
|
30
31
|
"build:mac": "npm run build:ui && electron-builder --mac",
|
|
31
32
|
"build:mac:zip": "npm run build:ui && electron-builder --mac zip",
|
|
32
33
|
"prepack": "npm run build:ui && node scripts/copy-ui.js",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
36
|
-
"release:publish": "npm version patch && npm publish"
|
|
34
|
+
"release": "node scripts/release.js",
|
|
35
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
37
36
|
},
|
|
38
37
|
"author": "ytchuan",
|
|
39
38
|
"license": "ISC",
|