Skip to content

nashysolutions/foundation-dependencies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foundation Dependencies

A modular, testable collection of lightweight wrappers for common Foundation types, designed for seamless use with swift-dependencies. This package makes it easy to mock, inject, and override behaviours like UserDefaults, Bundle, and file system operations in both production and test environments.


📦 Installation

Add this package via Swift Package Manager:

.product(name: "FoundationDependencies", package: "foundation-dependencies")

📚 Documentation & API Reference

Comprehensive documentation is available via Swift Package Index:

➡️ Browse Documentation on Swift Package Index


🔧 Included Clients

Client Description
mainBundleClient A wrapper around Bundle, exposing APIs for loading resources via a BundleResourceProvider abstraction.
userDefaultsClient A testable interface for UserDefaults, built using UserDefaultsStoreProtocol. Ideal for dependency injection and isolating persistent state in tests.
fileSystemClient A robust file system interface supporting operations such as reading, writing, copying, moving, and deleting files or directories. Suitable for sandboxed storage and fully mockable for tests.
fileSystemResourceClient A factory for creating typed file stores that conform to FileSystemOperations. Supports saving and loading Codable values and binary data into specific folders and subfolders, without exposing raw file system APIs.
loggerClient An interface to os.Logger, auto-populated with the MainBundle bundle identifier (even if you're logging outside the main bundle).

Note
Many additional dependencies like date, uuid, and calendar are provided transitively via swift-dependencies.
See the complete list of built-ins.

About

Lightweight, testable wrappers for Foundation types like UserDefaults, Bundle, and file system access — built for use with swift-dependencies.

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages