Electron + React 19 + TypeScript + Ant Design 6 + Tailwind CSS 4 【核心架构】 - Electron 主进程(窗口管理、平台检测、图标适配) - Vite 构建链(双产物 dist/ + dist-electron/) - 共享层 shared/(类型、常量、工具函数) - IPC 通信框架 + 安全守卫 【主题系统】 - 蓝紫渐变主题(亮色/暗色双模式) - Ant Design ConfigProvider 适配(lightAlgorithm / darkAlgorithm) - Tailwind CSS 4 @theme 指令 + CSS 变量 - 设计令牌三处同步(tokens.ts / globals.css / antd-theme.ts) 【导航栏】 - 自定义 H5 导航栏替代系统菜单 - 个人版/企业版双布局 - 未登录拦截 + 事件总线驱动登录弹窗 【登录注册】 - Modal 弹层(Portal)+ Tabs 切换 - 登录/注册表单动态字段渲染 - 记住密码 / 自动登录 / 用户协议 【更新系统】 - 自定义 API 版本检查(替代 electron-updater generic provider) - 手动下载 + SHA512 校验 + spawn NSIS 安装 - 渲染进程更新状态机 Hook(useUpdater) - 检查更新按钮 + 下载进度展示 【构建工具链】 - build.mjs 构建总管(--win/--mac/--linux --personal/--enterprise --build/--clean/--sign/--upload/--publish) - scripts/ 自动化脚本(clean / generate-update-info / upload-oss / publish-release) - electron-builder NSIS 安装器(可选路径、多版本打包) - update-info.json 自动生成(fileSize/sha512/changelog/releaseDate) 【代码质量】 - ESLint + TypeScript strict + Prettier - husky + lint-staged(提交前自动检查) - commitlint(规范提交信息) - Playwright E2E + Vitest 单元测试框架 - rollup-plugin-visualizer 打包体积分析 【文档】 - README.md(快速开始 + 目录结构 + 命令速查) - UpdateA.md(发布手册:API/签名/发版流程/数据库) - CHANGELOG.md(更新日志) - .env.example(构建环境变量模板)
116 lines
3.9 KiB
JSON
116 lines
3.9 KiB
JSON
{
|
|
"name": "ele-heixiu",
|
|
"private": true,
|
|
"version": "0.0.1",
|
|
"description": "船长·HeiXiu — 桌面效率工作台",
|
|
"author": "HeiXiu 杨烨",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "chcp 65001 > null && cross-env ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ vite",
|
|
"build": "node build.mjs --win --personal --build",
|
|
"build:win": "node build.mjs --win --personal --build",
|
|
"build:win:enterprise": "node build.mjs --win --enterprise --build",
|
|
"build:mac": "node build.mjs --mac --personal --build",
|
|
"build:mac:enterprise": "node build.mjs --mac --enterprise --build",
|
|
"build:linux": "node build.mjs --linux --personal --build",
|
|
"build:linux:enterprise": "node build.mjs --linux --enterprise --build",
|
|
"build:clean": "node scripts/clean.mjs",
|
|
"upload:oss": "node scripts/upload-oss.mjs",
|
|
"publish:release": "node scripts/publish-release.mjs",
|
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
"preview": "vite preview",
|
|
"format": "prettier --write \"src/**/*.{ts,tsx,css}\" \"electron/**/*.ts\" \"shared/**/*.ts\"",
|
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,css}\" \"electron/**/*.ts\" \"shared/**/*.ts\"",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:e2e": "playwright test"
|
|
},
|
|
"dependencies": {
|
|
"antd": "^6.4.3",
|
|
"axios": "^1.16.1",
|
|
"react": "^19.2.7",
|
|
"react-dom": "^19.2.7"
|
|
},
|
|
"build": {
|
|
"appId": "com.heixiu.electron",
|
|
"productName": "船长·HeiXiu",
|
|
"asar": true,
|
|
"directories": {
|
|
"output": "release/${version}"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"dist-electron"
|
|
],
|
|
"electronDownload": {
|
|
"mirror": "https://npmmirror.com/mirrors/electron/"
|
|
},
|
|
"publish": {
|
|
"provider": "generic",
|
|
"url": "https://update.heixiu.com"
|
|
},
|
|
"win": {
|
|
"icon": "src/assets/logo/heixiu.ico",
|
|
"target": [
|
|
{
|
|
"target": "NSIS",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
}
|
|
],
|
|
"artifactName": "${productName}-Windows-${version}-${env.EDITION}-Setup.${ext}"
|
|
},
|
|
"mac": {
|
|
"icon": "src/assets/logo/heixiu.icns",
|
|
"target": [
|
|
"dmg"
|
|
],
|
|
"artifactName": "${productName}-Mac-${version}-${env.EDITION}-Installer.${ext}"
|
|
},
|
|
"linux": {
|
|
"icon": "src/assets/logo/HX.png",
|
|
"target": [
|
|
"AppImage"
|
|
],
|
|
"artifactName": "${productName}-Linux-${version}-${env.EDITION}.${ext}"
|
|
},
|
|
"nsis": {
|
|
"oneClick": false,
|
|
"perMachine": false,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"deleteAppDataOnUninstall": false,
|
|
"installerIcon": "src/assets/logo/heixiu.ico",
|
|
"uninstallerIcon": "src/assets/logo/heixiu.ico"
|
|
}
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.60.0",
|
|
"@tailwindcss/vite": "^4.3.0",
|
|
"@types/electron": "^1.4.38",
|
|
"@types/node": "^25.9.1",
|
|
"@types/react": "^19.2.16",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@typescript-eslint/eslint-plugin": "^8.60.1",
|
|
"@typescript-eslint/parser": "^8.60.1",
|
|
"@vitejs/plugin-react": "^6.0.0",
|
|
"autoprefixer": "^10.5.0",
|
|
"cross-env": "^10.1.0",
|
|
"electron": "42.3.0",
|
|
"electron-builder": "^26.8.1",
|
|
"eslint": "^10.4.1",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
"postcss": "^8.5.15",
|
|
"prettier": "^3.8.3",
|
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
"tailwindcss": "^4.3.0",
|
|
"typescript": "^6.0.3",
|
|
"vite": "8.0.16",
|
|
"vite-plugin-electron": "^1.0.0",
|
|
"vite-plugin-electron-renderer": "^1.0.0"
|
|
},
|
|
"main": "dist-electron/main.js"
|
|
}
|