Skip to content

Releases: coenttb/swift-web-foundation

v0.1.0: URL Routing Href Helper

26 Sep 19:22

Choose a tag to compare

What's New

Features

  • 🔗 Href Helper: Added convenient href(for:) method to ParserPrinter for URL routing
    • Converts routes directly to Href instances
    • Provides cleaner API for generating hrefs from URL routes

Usage Example

let router = MyRouter()
let href = router.href(for: .myRoute(id: 123))
// Equivalent to: Href(router.url(for: .myRoute(id: 123)))

Technical Details

  • Extension on ParserPrinter where Input == URLRequestData
  • Returns Href instances for better type safety
  • Simplifies href generation in web applications

Installation

.package(url: "https://github.com/coenttb/swift-web-foundation.git", from: "0.1.0")

Full Changelog: 0.0.2...0.1.0

0.0.1

01 Aug 11:34

Choose a tag to compare

Swift Web Foundation 0.0.1

A comprehensive glue library that consolidates essential Swift packages for web development into a single, convenient import.

What's Included

Type Safety & Domain Modeling

  • EmailAddress - Domain-accurate and type-safe email address handling
  • Domain - Type-safe domain model consistent with web standards
  • JWT - Standards-compliant JSON Web Token creation, signing, and verification

Date & Time Handling

  • DateParsing - Comprehensive date parsing for RFC 2822, RFC 5322, and Unix epoch timestamps
  • FoundationExtensions - Powerful extensions for date manipulation and formatting

Web Standards & Routing

Content Generation

  • HTML - Type-safe HTML and CSS generation with SwiftUI-like syntax
  • Sitemap - XML sitemap generation following sitemaps.org protocol
  • Builders - Result builders for creating collections and content

Parsing & Infrastructure

  • Parsing - Point-Free's composable parsing library
  • Dependencies - SwiftUI Environment-inspired dependency management

Installation

Add to your Package.swift:

dependencies: [
    .package(url: "https://github.com/coenttb/swift-web-foundation.git", from: "0.0.1")
]

Then import everything with a single line:

import WebFoundation

This foundation eliminates the need to manage 15+ individual dependencies while maintaining full type safety and performance.