Module versioned

Module versioned 

Source
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:

  1. Check for legacy Settings.toml in the root directory
  2. If it exists, migrate it to the versioned system and delete the old file
  3. Read the manifest to find the most recent version
  4. Load that version’s settings file
  5. If the current version differs, copy to new version file

When the application saves:

  1. Write to the current version file
  2. Update manifest metadata
  3. Remove old files exceeding retention limit

Structs§

SettingsEntry
Metadata for a settings file version in the manifest.
SettingsManager
Manages versioned settings files and migrations.
SettingsManifest
Manifest file that tracks all settings versions.

Constants§

LEGACY_SETTINGS_FILE 🔒
MANIFEST_FILE 🔒
SETTINGS_DIR 🔒