2 Commits

Author SHA1 Message Date
VirtualHotBar
b7d2b78e43 feat(repository): 实现数据访问抽象层并统一日志服务
- 完成 Repository 层实现,包括 BaseRepository、ConfigRepository、
  StorageRepository、MountRepository、TaskRepository
- 迁移所有 console.log/warn/error 到统一的 LoggerService
- 实现 MountRepository 的原子性更新逻辑,支持配置变更检测
- 实现 TaskRepository 的任务状态管理和生命周期控制
- 添加完整的单元测试覆盖 StorageManager、FileManager、
  TransferService 及各 Repository 模块
- 新增 CacheManager 的 localStorage 持久化功能
- 优化 ChunkTransferService 的并发控制和信号量实现
- 修复 MountRepository ID 生成逻辑中的特殊字符冲突问题
- 实现 TaskRepository.update 的真正就地更新而非删除重建
- 补充完整的类型定义文档和 JSDoc 注释
2026-04-07 00:31:16 +08:00
VirtualHotBar
a956e7b96a refactor(arch): restructure codebase with modular services and state management
Introduce comprehensive architectural improvements including service layer, state management stores, repository pattern, unified logging and error handling, and test infrastructure.

Key changes:
- Add service layer with ConfigService, LoggerService, ErrorService, and storage services (StorageManager, FileManager, TransferService)
- Implement Zustand stores for rclone, openlist, mount, storage, settings, stats, and task state management
- Introduce repository layer with BaseRepository and specific implementations (ConfigRepository, StorageRepository)
- Add unified logging system with structured output, levels, and persistence
- Implement centralized error handling with categorization, user-friendly messages, and recovery
- Create component library with ErrorBoundary and reusable UI components
- Add comprehensive test suite with Vitest, setup, and utilities
- Migrate from monolithic files to modular structure with proper separation of concerns
- Update build configuration, add vitest.config.ts, and enhance TypeScript paths
- Remove deprecated files (tauriUpdater.ts, test.ts, storageRepository.ts, etc.)

BREAKING CHANGE: Major API and structural changes require updates to component imports and state access patterns. Migration guide available in docs/LOGGING_MIGRATION_GUIDE.md.
2026-04-05 10:33:27 +08:00