Skip to content

0.6.0

Choose a tag to compare

@nikolainobadi nikolainobadi released this 22 Mar 22:36
· 9 commits to main since this release
a180181

NnFileKit 0.6.0 Release Notes

NnConfigKit — a new module for type-safe JSON configuration management, built on NnFileKit's existing FileSystem and Directory protocols.

What's New

  • NnConfigManager<Config: Codable> — generic manager for loading, saving, and updating JSON config files at ~/.config/NnConfigList/{projectName}/
  • Nested config file support — create, append, remove, and delete files within config directory hierarchies
  • Fully testable — accepts an injected FileSystem, works with MockFileSystem/MockDirectory out of the box
  • Sendable — safe for Swift 6 strict concurrency

Quick Start

import NnConfigKit

struct AppConfig: Codable {
    var theme: String
    var maxRetries: Int
}

let manager = NnConfigManager<AppConfig>(projectName: "MyApp")
try manager.saveConfig(AppConfig(theme: "dark", maxRetries: 3))
let config = try manager.loadConfig()

Installation

.product(name: "NnConfigKit", package: "NnFileKit")