一个基于 Vue 3 + TypeScript 的本地化密码管理器 uTools 插件。
src/
├── types/ # TypeScript 类型定义
├── services/ # 服务接口和注册器
├── stores/ # Pinia 状态管理
├── composables/ # Vue 组合式函数
├── utils/ # 工具函数
├── constants/ # 应用常量
└── test/ # 测试文件
- ✅ Pinia (状态管理)
- ✅ TypeScript (类型安全)
- ✅ Vitest (测试框架)
- ✅ Vue Test Utils (Vue 组件测试)
- ✅ fast-check (属性测试库)
- ✅ tsconfig.json 配置
- ✅ 路径映射 (@/* 别名)
- ✅ 严格类型检查
- ✅ 全局类型声明
- ✅ IPasswordEntry (密码条目接口)
- ✅ IPasswordGeneratorConfig (密码生成器配置)
- ✅ EncryptedData (加密数据结构)
- ✅ AppConfig (应用配置)
- ✅ 错误类型和数据库架构
- ✅ IEncryptionService (加密服务)
- ✅ IStorageService (存储服务)
- ✅ IPasswordRepository (密码仓储)
- ✅ IPasswordGenerator (密码生成器)
- ✅ IAuthService (认证服务)
- ✅ ISearchService (搜索服务)
- ✅ IImportExportService (导入导出服务)
- ✅ useAuthStore (认证状态)
- ✅ usePasswordStore (密码条目状态)
- ✅ useAppStore (应用状态)
- ✅ useAuth (认证相关)
- ✅ usePasswordEntries (密码条目管理)
- ✅ usePasswordGenerator (密码生成器)
- ✅ 验证工具 (validation.ts)
- ✅ 加密工具 (crypto.ts)
- ✅ 服务注册器 (registry.ts)
- ✅ Vitest 配置
- ✅ 测试环境设置
- ✅ Mock 配置 (Web Crypto API, IndexedDB, uTools)
- ✅ 基础测试用例
# 开发模式
npm run dev
# 构建项目
npm run build
# 运行测试
npm test
# 监听测试
npm run test:watch
# 类型检查
npm run type-check基础设施已搭建完成,可以开始实现具体的服务类:
- 加密服务实现 (EncryptionService)
- 本地存储服务 (StorageService)
- 认证系统 (AuthService)
- 密码生成器 (PasswordGenerator)
每个服务都有对应的接口定义和类型约束,确保实现的一致性和类型安全。