# pointfreeco/swift-dependencies

A dependency management library inspired by SwiftUI's "environment."

Repository: https://github.com/pointfreeco/swift-dependencies
Canonical: https://ross.abutalabs.com/products/swift-dependencies
Homepage: https://www.pointfree.co
Language: Swift
License: MIT
License Family: permissive
Topics: dependency-injection, dependency-management, architecture, swift
Last push: 2026-08-24T19:25:25+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 99, longevity 100
- inputs: {"age_days": 1434, "days_push": 9, "days_rel": 9, "gap_med": 11.0, "n_releases_24m": 29}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2185, forks 189 (observed 2026-08-28T04:06:23.632269+00:00)

## What it is
A Swift dependency management library inspired by SwiftUI's environment, for controlling dependencies like API clients, dates, and file access. It enables fast deterministic tests, SwiftUI previews, and runtime warnings for unprepared dependencies.

## Use cases
- inject mock dependencies into Swift unit tests
- make SwiftUI previews work with location or speech dependencies
- replace singletons with testable dependency injection in Swift
- control Date and UUID initializers for deterministic tests
- manage side effects in a Swift application architecture

## When to choose
- you build Swift/SwiftUI apps and want deterministic, fast tests
- you need dependencies to work in SwiftUI previews and simulators
- you want compile-time-safe dependency injection in Swift

## When to avoid
- your project is not in Swift
- you prefer heavyweight DI frameworks with code generation
- your codebase has no uncontrolled side effects to manage

## Facets
- artifact type: library
- maturity: active
- function: developer-tools, testing, middleware
- domain: developer-tools, mobile-development, testing
- platform: cross-platform
- tags: dependency-injection, swiftui, testability, swift-package, pointfree, swift, ios, macos

## Member repositories
- pointfreeco/swift-dependencies (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:23.632269+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:48:12.145633+00:00, confidence not recorded.
  - readme: https://github.com/pointfreeco/swift-dependencies (fetched 2026-08-28T04:06:23.632269+00:00, sha 26722c815717)
  - homepage: https://www.pointfree.co (fetched 2026-08-29T10:28:14.276217+00:00, sha 8c834d30d9e7)
  - site_page: https://www.pointfree.co/about (fetched 2026-08-29T10:28:14.288246+00:00, sha c3a02fbfb680)
  - site_page: https://www.pointfree.co/pricing (fetched 2026-08-29T10:28:14.285522+00:00, sha bc6fc313b3c6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
