phper/.kiro/steering/tech.md
Ethanfly 9614a3d234 feat: add Go version management support
- Add GoManager service for downloading and managing Go versions
- Implement Go version detection and installation
- Add GoManager Vue component with version selection UI
- Update main process to handle Go-related IPC calls
- Add Jest testing configuration and GoManager unit tests
- Update service store to include Go management
- Add routing for Go manager page
- Include Kiro specs and steering documentation
2026-01-13 18:30:26 +08:00

2.1 KiB

技术栈和构建系统

核心技术栈

前端框架

  • Vue 3: 使用 Composition API 和 <script setup> 语法
  • TypeScript: 严格类型检查,配置在 tsconfig.json
  • Element Plus: UI 组件库,提供现代化界面组件
  • Vue Router 4: 单页面应用路由管理
  • Pinia: 状态管理,替代 Vuex

桌面应用框架

  • Electron: 主进程和渲染进程架构
  • IPC 通信: 主进程与渲染进程间的安全通信
  • electron-store: 应用配置持久化存储

构建工具

  • Vite: 现代化构建工具,支持热重载
  • vite-plugin-electron: Electron 集成插件
  • electron-builder: 应用打包和分发

开发工具

  • Jest: 单元测试框架,配置在 jest.config.js
  • vue-tsc: Vue 组件类型检查
  • Sass: CSS 预处理器,支持主题变量

常用命令

开发环境

# 启动开发服务器
npm run dev

# 类型检查
npm run typecheck

# 运行测试
npm run test
npm run test:watch

构建和打包

# 构建生产版本(自动更新 patch 版本)
npm run build

# 指定版本更新类型
npm run build:patch   # 1.0.0 -> 1.0.1
npm run build:minor   # 1.0.0 -> 1.1.0
npm run build:major   # 1.0.0 -> 2.0.0

# 不更新版本号直接打包
npm run build:nobump

# 构建前进行类型检查
npm run build:check

关键依赖

生产依赖

  • axios: HTTP 客户端
  • unzipper: 文件解压缩
  • node-windows: Windows 服务管理
  • sudo-prompt: 管理员权限提升

开发依赖

  • concurrently: 并行运行多个命令
  • fast-check: 属性测试库
  • ts-jest: TypeScript Jest 支持

构建配置

  • 输出目录: dist (前端), dist-electron (Electron)
  • 图标: build/icon.ico
  • 安装包: 生成到 release 目录
  • 目标平台: Windows x64 (NSIS 和 Portable)

开发注意事项

  • 使用 windowsHide: true 隐藏命令行窗口
  • 服务启动使用 VBScript 实现静默启动
  • 需要管理员权限进行服务管理和 hosts 文件修改
  • 支持开机自启动(任务计划程序)