Skip to content

A Swift package bundling essential type-safe packages for domain modeling.

License

Notifications You must be signed in to change notification settings

coenttb/swift-types-foundation

swift-types-foundation

Swift Platforms License CI

A consolidated Swift library bundling essential type-safe packages for domain modeling and data handling.

Table of Contents

Overview

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.

Included Libraries

This foundation consolidates type-safe packages that are commonly used for domain modeling:

Core Type-Safe Models

  • EmailAddress - Type-safe email address handling with RFC standard validation
  • Domain - Type-safe domain name handling with multi-RFC standard support

Date & Time Types

URL & Form Types

Language & Localization Types

Utilities & Infrastructure

  • 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

Installation

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")
    ]
)

Quick Start

Instead of importing multiple individual packages:

import EmailAddress
import Domain
import DateParsing
import URLRouting
import Translating
import Builders
// ... and many more

Simply 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>()

Related Packages

Dependencies

Used By

Third-Party Dependencies

Requirements

  • Swift 6.0+
  • macOS 14.0+ / iOS 17.0+

License

This project is licensed under the Apache 2.0 License. See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

About

A Swift package bundling essential type-safe packages for domain modeling.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages