# SafeDI

> Compile-time-safe dependency injection for Swift without the boilerplate

- **URL**: https://www.freshcrate.ai/projects/SafeDI
- **Author**: dfed
- **Category**: Uncategorized
- **Latest version**: `2.0.0` (2026-05-11)
- **License**: MIT
- **Source**: https://github.com/dfed/SafeDI
- **Language**: Swift
- **GitHub**: 183 stars, 8 forks
- **Registry**: github (`dfed/SafeDI`)
- **Tags**: `code-generation`, `dependency-injection`, `inversion-of-control`, `ios`, `swift`, `testing`, `xcode`

## Description

Compile-time-safe dependency injection for Swift without the boilerplate

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `2.0.0` | 2026-05-11 | High | [SafeDI now generates full-graphs mocks for you!](https://github.com/dfed/SafeDI#tests-and-previews-from-real-feature-roots) Migration guide can be found [here](https://github.com/dfed/SafeDI/blob/main/Documentation/Manual.md#migrating-from-safedi-1x-to-2x).  ## What's Changed * Add @SafeDIConfiguration macro to replace CSV config by @dfed in https://github.com/dfed/SafeDI/pull/199 * Bump to v2.0.0, require Swift 6.3, remove CocoaPods support by @dfed in https://github.com/dfed/SafeDI/pull/2 |
| `2.0.0-beta-5` | 2026-04-21 | High | ## What's Changed * Docs: document SafeDI cycle mechanics, erasure matrix, and selected init by @dfed in https://github.com/dfed/SafeDI/pull/270 * README: remove phantom Features-table header + drop 'Or skip ahead' by @dfed in https://github.com/dfed/SafeDI/pull/274 * Plugin: strip comments and strings before PluginScanner regex match by @dfed in https://github.com/dfed/SafeDI/pull/271 * Tests: enable compile verification on five previously-skipped mock tests by @dfed in https://github.com/dfed/ |
| `2.0.0-alpha-18-xcode-plugin-test` | 2026-04-20 | High | ## What's Changed * Docs: document SafeDI cycle mechanics, erasure matrix, and selected init by @dfed in https://github.com/dfed/SafeDI/pull/270 * README: remove phantom Features-table header + drop 'Or skip ahead' by @dfed in https://github.com/dfed/SafeDI/pull/274 * Plugin: strip comments and strings before PluginScanner regex match by @dfed in https://github.com/dfed/SafeDI/pull/271 * Tests: enable compile verification on five previously-skipped mock tests by @dfed in https://github.com/dfed/ |
| `2.0.0-beta-4` | 2026-04-20 | High | ## What's Changed * Polish beta docs and generator cleanup by @dfed in https://github.com/dfed/SafeDI/pull/253 * Docs: rewrite README and refactor notes Example around User forwarding by @dfed in https://github.com/dfed/SafeDI/pull/254 * Docs polish, test renames, codegen cleanup by @dfed in https://github.com/dfed/SafeDI/pull/255 * Fix mock generation using init signature instead of hand-written mock by @dfed in https://github.com/dfed/SafeDI/pull/257 * Tests: declare Instantiable conformance d |
| `2.0.0-beta-3` | 2026-04-15 | High | ## What's Changed * Add package resolution retry to all CI jobs by @dfed in https://github.com/dfed/SafeDI/pull/252 * Improve mock generation for fulfilledByType and mockOnly coexistence by @dfed in https://github.com/dfed/SafeDI/pull/250 * Fix mock closure types to use property type and handle erased existentials by @dfed in https://github.com/dfed/SafeDI/pull/251   **Full Changelog**: https://github.com/dfed/SafeDI/compare/2.0.0-beta-2...2.0.0-beta-3 |
| `2.0.0-beta-2` | 2026-04-12 | Medium | ## What's Changed * Fix forwarded mock default when mock has required parameters by @dfed in https://github.com/dfed/SafeDI/pull/249   **Full Changelog**: https://github.com/dfed/SafeDI/compare/2.0.0-beta-1...2.0.0-beta-2 |
| `2.0.0-beta-1` | 2026-04-12 | Medium | ## What's Changed * Cover shared mock configuration file generation paths by @dfed in https://github.com/dfed/SafeDI/pull/245 * Remove retroactive sendable conformance by @dfed in https://github.com/dfed/SafeDI/pull/246 * Add mockOnly parameter to @Instantiable by @dfed in https://github.com/dfed/SafeDI/pull/248   **Full Changelog**: https://github.com/dfed/SafeDI/compare/2.0.0-alpha-17...2.0.0-beta-1 |
| `2.0.0-alpha-17` | 2026-04-11 | Medium | ## What's Changed * Rename SafeDIParameters to SafeDIOverrides and add doc comments to generated mock types by @dfed in https://github.com/dfed/SafeDI/pull/244   **Full Changelog**: https://github.com/dfed/SafeDI/compare/2.0.0-alpha-16...2.0.0-alpha-17 |
| `2.0.0-alpha-16` | 2026-04-10 | Medium | ## What's Changed * Add -internalize-at-link to SafeDITool release builds by @dfed in https://github.com/dfed/SafeDI/pull/239 * Speed up CI with concurrency groups and targeted CodeQL builds by @dfed in https://github.com/dfed/SafeDI/pull/240 * Use concreteType for SafeDIMockConfiguration struct extensions by @dfed in https://github.com/dfed/SafeDI/pull/243 * Move onlyIfAvailable received dependencies into SafeDIParameters (simple) by @dfed in https://github.com/dfed/SafeDI/pull/241   **Full Cha |
| `2.0.0-alpha-15` | 2026-04-10 | Medium | ## What's Changed * Revert leaf mock wrapper generation by @dfed in https://github.com/dfed/SafeDI/pull/238   **Full Changelog**: https://github.com/dfed/SafeDI/compare/2.0.0-alpha-14...2.0.0-alpha-15 |

## Dependency audit

- **Score**: 100/100
- **Total deps**: 0
- **Resolved**: 0
- **Unresolved**: 0
- **License conflicts**: 0
- **Warnings**: 0
- **Scanned**: 2026-05-11

## Citation

- HTML: https://www.freshcrate.ai/projects/SafeDI
- Markdown: https://www.freshcrate.ai/projects/SafeDI.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/SafeDI/deps

_Generated by freshcrate.ai. Indexes github releases for AI-agent ecosystem packages._
