{"id":24840388,"url":"https://github.com/swiftylab/swift-contexts","last_synced_at":"2025-08-11T17:05:17.941Z","repository":{"id":199742642,"uuid":"701008841","full_name":"SwiftyLab/swift-contexts","owner":"SwiftyLab","description":"A no-boilerplate dependency management library for Swift.","archived":false,"fork":false,"pushed_at":"2023-11-23T11:28:31.000Z","size":330,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T10:41:18.472Z","etag":null,"topics":["architecture","dependency-injection","dependency-inversion","dependency-management","solid","solid-principles","swift","swiftui"],"latest_commit_sha":null,"homepage":"https://swiftylab.github.io/swift-contexts/documentation/contexts/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwiftyLab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["soumyamahunt"],"patreon":null,"open_collective":"soumyamahunt","ko_fi":"soumyamahunt","tidelift":null,"community_bridge":null,"liberapay":"soumyamahunt","issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-10-05T18:13:18.000Z","updated_at":"2024-11-25T19:38:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a0d837e-1fa8-407b-b06b-49912290258e","html_url":"https://github.com/SwiftyLab/swift-contexts","commit_stats":null,"previous_names":["swiftylab/swift-contexts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SwiftyLab/swift-contexts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fswift-contexts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fswift-contexts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fswift-contexts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fswift-contexts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwiftyLab","download_url":"https://codeload.github.com/SwiftyLab/swift-contexts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fswift-contexts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269922904,"owners_count":24496999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","dependency-injection","dependency-inversion","dependency-management","solid","solid-principles","swift","swiftui"],"created_at":"2025-01-31T06:56:05.929Z","updated_at":"2025-08-11T17:05:17.877Z","avatar_url":"https://github.com/SwiftyLab.png","language":"Swift","funding_links":["https://github.com/sponsors/soumyamahunt","https://opencollective.com/soumyamahunt","https://ko-fi.com/soumyamahunt","https://liberapay.com/soumyamahunt"],"categories":[],"sub_categories":[],"readme":"# swift-contexts\n\n[![API Docs](http://img.shields.io/badge/Read_the-docs-2196f3.svg)](https://swiftylab.github.io/swift-contexts/documentation/Contexts/)\n[![Swift Package Manager Compatible](https://img.shields.io/github/v/tag/SwiftyLab/swift-contexts?label=SPM\u0026color=orange)](https://badge.fury.io/gh/SwiftyLab%2Fswift-contexts)\n[![Swift](https://img.shields.io/badge/Swift-5.2+-orange)](https://img.shields.io/badge/Swift-5-DE5D43)\n[![Platforms](https://img.shields.io/badge/Platforms-all-sucess)](https://img.shields.io/badge/Platforms-all-sucess)\n[![CI/CD](https://github.com/SwiftyLab/swift-contexts/actions/workflows/main.yml/badge.svg)](https://github.com/SwiftyLab/swift-contexts/actions/workflows/main.yml)\n[![CodeFactor](https://www.codefactor.io/repository/github/swiftylab/swift-contexts/badge)](https://www.codefactor.io/repository/github/swiftylab/swift-contexts)\n[![codecov](https://codecov.io/gh/SwiftyLab/swift-contexts/branch/main/graph/badge.svg?token=XcGO9JCN9Q)](https://codecov.io/gh/SwiftyLab/swift-contexts)\n\u003c!-- [![CodeQL](https://github.com/SwiftyLab/swift-contexts/actions/workflows/codeql-analysis.yml/badge.svg?event=schedule)](https://github.com/SwiftyLab/swift-contexts/actions/workflows/codeql-analysis.yml) --\u003e\n\nA no-boilerplate dependency management library for Swift.\n\n## Overview\n\nWhen following [Single responsibility](https://en.wikipedia.org/wiki/Single-responsibility_principle) in [SOLID](https://en.wikipedia.org/wiki/SOLID) principle, code is divided into multiple types/functions each representing a responsibility/goal, i.e. storage access, database and networking, scheduling etc.\n\nThese types/functions can depend on each other and it is important these dependences need to be controlled to deterministically test each responsibility, free from side effects from external components, i.e. file systems, network connectivity and speed, server uptime etc.\n\nThis library addresses this concern by allowing controlling dependencies with following features:\n\n- Propagating dependencies throughout application in a way that is more ergonomic than explicitly passing them around everywhere, but safer than having a global dependency.\n- Override dependencies in different parts of application for testing or customizing experiences in various parts.\n\n## Requirements\n\n| Platform | Minimum Swift Version | Installation | Status |\n| --- | --- | --- | --- |\n| iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ | 5.2 | Swift Package Manager | Fully Tested |\n| Linux | 5.2 | Swift Package Manager | Fully Tested |\n| Windows | 5.2 | Swift Package Manager | Fully Tested |\n\n## Installation\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eSwift Package Manager\u003c/h3\u003e\u003c/summary\u003e\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding `swift-contexts` as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\n.package(url: \"https://github.com/SwiftyLab/swift-contexts.git\", from: \"1.0.0\"),\n```\n\nThen you can add the `Contexts` module product as dependency to the `target`s of your choosing, by adding it to the `dependencies` value of your `target`s.\n\n```swift\n.product(name: \"Contexts\", package: \"swift-contexts\"),\n```\n\n\u003c/details\u003e\n\n## Usage\n\nSee the full [documentation](https://swiftylab.github.io/swift-contexts/documentation/Contexts/) for API details and use cases.\n\n## Contributing\n\nIf you wish to contribute a change, suggest any improvements,\nplease review our [contribution guide](CONTRIBUTING.md),\ncheck for open [issues](https://github.com/SwiftyLab/swift-contexts/issues), if it is already being worked upon\nor open a [pull request](https://github.com/SwiftyLab/swift-contexts/pulls).\n\n## License\n\n`swift-contexts` is released under the MIT license. [See LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftylab%2Fswift-contexts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftylab%2Fswift-contexts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftylab%2Fswift-contexts/lists"}