@ytchuan/flowlink 1.0.0 → 1.0.1

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 (3) hide show
  1. package/README.md +5 -137
  2. package/main.js +7 -5
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -1,5 +1,4 @@
1
1
  # FlowLink Electron 客户端
2
-
3
2
  FlowLink 桌面客户端主进程,基于 Electron + Node.js,负责本地调度服务、客户端配置写入、设备管理、环境自检等功能。
4
3
 
5
4
  ## 目录结构
@@ -30,147 +29,16 @@ app/
30
29
  - npm 或 pnpm
31
30
  - macOS / Windows(当前主要支持平台)
32
31
 
33
- ## 本地开发
34
-
35
- ### 1. 安装依赖
36
-
37
- ```bash
38
- cd soft-ats-clients/app
39
- npm install
40
- ```
41
-
42
- ### 2. 同时启动渲染层与 Electron
43
-
44
- ```bash
45
- npm run dev
46
- ```
47
-
48
- 该命令会:
49
- - 在 `../app-ui` 启动 Vite 开发服务器(默认端口 5173)
50
- - 等待 5173 端口就绪后启动 Electron
51
-
52
- ### 3. 单独启动 Electron(需先启动 app-ui 开发服务器)
53
-
54
- ```bash
55
- npm start
56
- ```
57
-
58
- ## 构建与打包
59
-
60
- ### 前置步骤:构建渲染层
61
-
62
- 所有打包命令都会先执行 `npm run build:ui`,将 `../app-ui/dist` 产物复制到应用包中。
63
-
64
- ```bash
65
- npm run build:ui
66
- ```
67
-
68
- ### 默认打包(当前平台,同时输出安装包 + 便携版)
69
-
70
- ```bash
71
- npm run build
72
- ```
73
-
74
- ### 分平台打包
75
-
76
- | 命令 | 说明 | 输出产物 |
77
- |---|---|---|
78
- | `npm run build:mac` | macOS 完整构建 | `.dmg` 安装包 + `.zip` 便携版 |
79
- | `npm run build:mac:zip` | macOS 仅便携版 | `.zip`(解压后双击 `.app` 运行) |
80
- | `npm run build:win` | Windows 完整构建 | `.exe` 安装包 + `portable` 文件夹 |
81
- | `npm run build:win:portable` | Windows 仅便携版 | 单个可执行文件夹,无需安装 |
82
-
83
- ## npm 发布
84
-
85
- ### 前置条件
86
-
87
- 1. 已在 [npmjs.com](https://www.npmjs.com/) 注册账号
88
- 2. 已在本地登录 npm:
89
-
90
- ```bash
91
- npm login
92
- ```
32
+ ## 用户安装与运行
93
33
 
94
- 3. 包名为 `@ytchuan/flowlink`(scoped 包),如需更换组织名,在 `package.json` 中修改 `name` 即可(`publishConfig.access` 已设为 `public`)
95
-
96
- ### 发布流程
97
-
98
- ```bash
99
- cd soft-ats-clients/app
100
- npm publish
101
- ```
102
-
103
- `npm publish` 会依次执行:
104
- 1. `prepack`:`npm run build:ui && node scripts/copy-ui.js && node scripts/manifest-electron.js rewrite`,构建渲染层并将 `../app-ui/dist` 产物复制到包内 `app-ui/dist`,再将发布清单中的 `electron` 从 `devDependencies` 移入 `dependencies`(electron-builder 要求本地必须在 `devDependencies`,而用户全局安装只会安装 `dependencies`,两者通过此脚本兼得);
105
- 2. `postpack`:自动将本地 `package.json` 中的 `electron` 恢复回 `devDependencies`。
106
-
107
- > 所有发布准备工作统一挂在 `prepack` 上,因此 `npm pack` 打出的本地 tarball 与正式发布的包内容完全一致,可直接用于发布前验证。
108
-
109
- ### 发布后用户安装与运行
34
+ ### 前置注意事项
110
35
 
111
36
  ```bash
37
+ export ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
112
38
  npm install -g @ytchuan/flowlink
113
39
  flowlink
114
40
  ```
115
41
 
116
- ### 本地测试(不发布到 npm)
117
-
118
- ```bash
119
- cd soft-ats-clients/app
120
- npm link # 本地全局链接
121
- flowlink # 测试启动
122
- ```
123
-
124
- ### 注意事项
125
-
126
- - 首次 `npm install -g @ytchuan/flowlink` 会下载 Electron(~150MB),需要耐心等待。
127
- - 国内网络若下载 Electron 超时,可先设置镜像:
128
- ```bash
129
- export ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
130
- npm install -g @ytchuan/flowlink
131
- ```
132
- - 发布前请确认 `package.json` 中的 `version` 已更新,npm 不允许重复发布同一版本。
133
- - 如需发布 beta 版本:`npm publish --tag beta`
134
-
135
- ## 输出目录
136
-
137
- 打包产物统一输出到:
138
-
139
- ```
140
- app/dist-electron/
141
- ```
142
-
143
- 按平台与子目录组织,例如:
144
-
145
- ```
146
- dist-electron/
147
- ├── mac/
148
- │ ├── FlowLink-1.5.2.dmg
149
- │ └── FlowLink-1.5.2-mac.zip
150
- └── win-unpacked/
151
- ├── FlowLink.exe # 便携版可直接运行
152
- └── ...
153
- ```
154
-
155
- ## 便携版说明
156
-
157
- - **macOS**:`FlowLink-x.x.x-mac.zip` 解压后得到 `FlowLink.app`,双击即可运行,无需安装到 Applications。
158
- - **Windows**:`win-unpacked/FlowLink.exe` 为绿色便携版,复制整个 `win-unpacked` 文件夹到任意位置即可运行。
159
-
160
- ## 常用配置
161
-
162
- 打包相关配置位于 `package.json` 的 `build` 字段:
163
-
164
- - `appId`:应用标识
165
- - `productName`:应用名称
166
- - `directories.output`:输出目录
167
- - `files`:需要打入应用包的文件
168
- - `extraResources`:额外复制的静态资源(如 `../app-ui/dist`)
169
- - `mac.target` / `win.target`:打包目标格式
170
-
171
42
  ## 注意事项
172
-
173
- 1. 打包前请确保 `../app-ui` 已能成功构建:`cd ../app-ui && npm run build`。
174
- 2. macOS 打包可能需要在「系统设置 > 隐私与安全性」中允许相关权限。
175
- 3. 若签名/公证失败,可临时在 `build` 配置中关闭 `asar` 或调整 `mac.identity` 排查。
176
- 4. 本地调度服务端口默认为 `51173`,占用时自动回退到 `51172`、`51171`。
43
+ 1. macOS 打包可能需要在「系统设置 > 隐私与安全性」中允许相关权限。
44
+ 2. 本地调度服务端口默认为 `51173`,如果`51173`被占用时自动回退到 `51172`、`51171`。
package/main.js CHANGED
@@ -266,11 +266,13 @@ app.whenReady().then(() => {
266
266
  nativeTheme.themeSource = 'system'
267
267
  }
268
268
 
269
- // 应用开机自启设置
270
- try {
271
- app.setLoginItemSettings({ openAtLogin: settings.autoStart })
272
- } catch (err) {
273
- console.warn('设置开机自启失败:', err.message)
269
+ // 应用开机自启设置(仅打包后生效,开发模式跳过以避免 macOS 权限警告)
270
+ if (app.isPackaged) {
271
+ try {
272
+ app.setLoginItemSettings({ openAtLogin: settings.autoStart })
273
+ } catch (err) {
274
+ console.warn('设置开机自启失败:', err.message)
275
+ }
274
276
  }
275
277
  })
276
278
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ytchuan/flowlink",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "FlowLink 桌面客户端 - AI 服务调度与管理",
5
5
  "main": "main.js",
6
6
  "bin": {
@@ -31,7 +31,8 @@
31
31
  "build:mac:zip": "npm run build:ui && electron-builder --mac zip",
32
32
  "prepack": "npm run build:ui && node scripts/copy-ui.js && node scripts/manifest-electron.js rewrite",
33
33
  "postpack": "node scripts/manifest-electron.js restore",
34
- "test": "echo \"Error: no test specified\" && exit 1"
34
+ "test": "echo \"Error: no test specified\" && exit 1",
35
+ "release:publish": "npm version patch && npm publish"
35
36
  },
36
37
  "author": "ytchuan",
37
38
  "license": "ISC",