Expand description
Settings versioning and migration support.
This module provides infrastructure for maintaining backward and forward compatibility across application versions. Settings are stored in a versioned directory structure with a manifest file tracking all versions.
§Directory Structure
Settings/
├── .cadmus-index.toml # Manifest file with version metadata
├── Settings-v0.1.2.toml # Version-specific settings files
├── Settings-v0.1.3-5-gabc123.toml
└── Settings-v0.2.0.toml§Migration Strategy
When the application loads:
- Check for legacy
Settings.tomlin the root directory - If it exists, migrate it to the versioned system and delete the old file
- Read the manifest to find the most recent version
- Load that version’s settings file
- If the current version differs, copy to new version file
When the application saves:
- Write to the current version file
- Update manifest metadata
- Remove old files exceeding retention limit
Structs§
- Settings
Entry - Metadata for a settings file version in the manifest.
- Settings
Manager - Manages versioned settings files and migrations.
- Settings
Manifest - Manifest file that tracks all settings versions.