Files
ClassHelper/scripts/generate-icons.mjs
T
LoveChengke 5545ef6f55 feat: 生产化改造(服务端安装程序/PWA/Docker+HTTPS)并修复侧边栏点击无反应、SPA 静态托管 dotfiles 两个缺陷
- 修复 web-admin 与 desktop-client 侧边栏点击无反应:el-menu 的 index 是路径,不能当路由名使用
- 修复 Web 产物目录含点号目录(如 .cache)时 res.sendFile 因 dotfiles:ignore 返回 500
- 后端生产模式:静态托管 Web 端 + SPA 回退、helmet、限流(通用/登录)、trust proxy、
  /healthz 与 /readyz、请求耗时日志、生产环境变量强校验、首启动自动迁移与创建管理员、PID 文件
- Web 管理端 PWA:manifest + service worker + 图标,可在浏览器安装为应用
- 新增服务端 + Web 管理端 Windows 安装程序(内置 Node 运行时、启停与服务脚本、开机自启、卸载保留数据)
- 新增 Docker/Compose/Nginx 部署样例与 docs/production.md
- 新增 UI 回归测试:Web 端 Electron 驱动真实点击 7 项、客户端冒烟 11 项(含侧边栏点击与离线回退)
2026-09-12 00:20:21 +08:00

30 lines
999 B
JavaScript

/**
* 图标生成启动器:pnpm icons
* 复用 desktop-client 的 Electron 运行时渲染 SVG 并导出 PNG/ICO。
*/
import { spawn } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const electronDir = path.join(root, 'packages', 'desktop-client', 'node_modules', 'electron');
if (!fs.existsSync(electronDir)) {
console.error('[icons] 未找到 Electron,请先执行 pnpm install');
process.exit(2);
}
const pathFile = path.join(electronDir, 'path.txt');
const executable = fs.existsSync(pathFile)
? path.join(electronDir, 'dist', fs.readFileSync(pathFile, 'utf8').trim())
: path.join(electronDir, 'dist', 'electron.exe');
const child = spawn(executable, [path.join(root, 'scripts', 'icons', 'render.cjs')], {
cwd: root,
stdio: 'inherit',
env: process.env,
});
child.on('exit', (code) => process.exit(code ?? 1));