A consolidated Swift library bundling essential type-safe packages for domain modeling and data handling.
- Overview
- Included Libraries
- Installation
- Quick Start
- Related Packages
- Requirements
- License
- Contributing
swift-types-foundation provides a single dependency for libraries that need to declare strongly-typed models. Instead of managing multiple individual type-safe package dependencies, import this foundation package to access a curated collection of domain modeling utilities, including email addresses, domains, date parsing, URL routing, translation support, and more.
This foundation consolidates type-safe packages that are commonly used for domain modeling:
- EmailAddress - Type-safe email address handling with RFC standard validation
- Domain - Type-safe domain name handling with multi-RFC standard support
- DateParsing - Date parsing for RFC 2822, RFC 5322, and Unix epoch timestamps
- UnixEpochParsing - Unix epoch timestamp parsing utilities
- FoundationExtensions - Date manipulation, validation, and formatting extensions
- URLRouting - Type-safe URL routing library
- URLRoutingTranslating - Multi-language URL pattern support for routing
- URLFormCoding - Type-safe URL form encoding and decoding
- Translating - Translation and localization framework
- Builders - Result builders for declarative content creation
- Dependencies - Dependency management for controllable and testable applications
- CasePaths - Key path-like functionality for enum cases
- IssueReporting - Runtime issue reporting and debugging utilities
To use swift-types-foundation in your project, add it to your Package.swift dependencies:
dependencies: [
.package(url: "https://github.com/coenttb/swift-types-foundation.git", from: "0.0.1")
]Then add it to your target dependencies:
.target(
name: "YourTarget",
dependencies: [
.product(name: "TypesFoundation", package: "swift-types-foundation")
]
)Instead of importing multiple individual packages:
import EmailAddress
import Domain
import DateParsing
import URLRouting
import Translating
import Builders
// ... and many moreSimply import the foundation:
import TypesFoundation
// All type-safe functionality is now available:
let email = try EmailAddress("user@example.com")
let domain = try Domain("example.com")
let date = Date.now + 1.day
let route = URLRoute<MyRoute>()- swift-builders: A Swift package with result builders for Array, Dictionary, Set, String, and Markdown.
- swift-date-parsing: A Swift package for parsing RFC 2822, RFC 5322, and Unix timestamp formats.
- swift-domain-type: A Swift package with a type-safe Domain model.
- swift-emailaddress-type: A Swift package with a type-safe EmailAddress model.
- swift-foundation-extensions: A Swift package with extensions for dates, times, and date components.
- swift-translating: A Swift package for inline translations.
- swift-url-form-coding: A Swift package for type-safe web form encoding and decoding.
- swift-url-routing-translating: A Swift package integrating multilingual support with URL routing.
- swift-document-templates: A Swift package for data-driven business document creation.
- swift-github-types: A Swift package with foundational types for GitHub.
- swift-identities-types: A Swift package with foundational types for authentication.
- swift-mailgun-types: A Swift package with foundational types for Mailgun.
- swift-server-foundation: A Swift package with tools to simplify server development.
- swift-stripe-types: A Swift package with foundational types for Stripe.
- pointfreeco/swift-case-paths: Case paths bring the benefits of key paths to enums.
- pointfreeco/swift-dependencies: A dependency management library for controlling dependencies in Swift.
- pointfreeco/swift-tagged: A wrapper type for safer, expressive code.
- pointfreeco/swift-url-routing: A bidirectional URL router with more type safety and less fuss.
- pointfreeco/xctest-dynamic-overlay: Define XCTest assertion helpers directly in production code.
- Swift 6.0+
- macOS 14.0+ / iOS 17.0+
This project is licensed under the Apache 2.0 License. See LICENSE for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue.