Files
cc-switch/src-tauri
T
YoVinchen b1446d0227 feat(config): add core utilities for config merge and difference extraction
Add comprehensive config merge utilities for both Rust backend and TypeScript frontend
to support the new common config architecture where customConfig overrides commonConfig.

Backend (Rust):
- Add config_merge.rs module with JSON and TOML merge functions
- Support deep merge where source overrides target for nested objects
- Add extract_difference functions to identify custom-only keys
- Include compute_final_*_config functions for runtime merge calculation
- Register module in lib.rs

Frontend (TypeScript):
- Add configMerge.ts with isPlainObject, deepClone, deepEqual, deepMerge utilities
- Implement computeFinalConfig for merging common + custom configs
- Add extractDifference to identify keys unique to live config
- Add tomlConfigMerge.ts with TOML-specific merge/extract functions
- Use smol-toml for parsing and serialization

These utilities form the foundation for the refactored common config system
where providers store only custom config and merge with shared templates at runtime.
b1446d0227 ยท 2026-01-26 13:57:48 +08:00
History
..
2025-11-22 19:18:35 +08:00
2025-12-21 21:10:00 +08:00
2026-01-24 22:15:21 +08:00
2026-01-24 22:15:21 +08:00