Skip to content

Commit a8acfee

Browse files
authored
Package updates (#8)
- improved mail package API - updated tests
1 parent 8f1a6a4 commit a8acfee

31 files changed

Lines changed: 981 additions & 574 deletions

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
with:
3737
enable_windows_checks : false
3838
linux_build_command: "swift test --parallel --enable-code-coverage"
39-
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}, {\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.0\"}, {\"swift_version\": \"nightly-6.1\"}, {\"swift_version\": \"nightly-6.3\"}]"
39+
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}, {\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"nightly-6.0\"}, {\"swift_version\": \"nightly-6.1\"}, {\"swift_version\": \"nightly-6.3\"}]"

.swiftformatignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
Package.swift
2-
Package@swift-6.0.swift
3-
Package@swift-6.1.swift
1+
Package.swift

.unacceptablelanguageignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sources/FeatherMail/Models/Address.swift

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22

33
Copyright (c) 2018-2022 Tibor Bödecs
4-
Copyright (c) 2022-2026 Binary Birds Ltd.
4+
Copyright (c) 2022-2026 Binary Birds Kft.
55

66
Permission is hereby granted, free of charge, to any person
77
obtaining a copy of this software and associated documentation

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ test:
3838
swift test --parallel
3939

4040
docker-test:
41-
docker build -t tests . -f ./Docker/Dockerfile.testing && docker run --rm tests
41+
docker build -t tests . -f ./docker/tests/Dockerfile && docker run --rm tests
4242

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
1-
// swift-tools-version:6.2
1+
// swift-tools-version:6.1
22
import PackageDescription
33

4-
let defaultSwiftSettings: [SwiftSetting] = [
4+
// NOTE: https://github.com/swift-server/swift-http-server/blob/main/Package.swift
5+
var defaultSwiftSettings: [SwiftSetting] = [
6+
7+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0441-formalize-language-mode-terminology.md
58
.swiftLanguageMode(.v6),
6-
.enableExperimentalFeature(
7-
"AvailabilityMacro=FeatherMailAvailability:macOS 13, iOS 16, watchOS 9, tvOS 16, visionOS 1"
8-
),
9+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
910
.enableUpcomingFeature("MemberImportVisibility"),
11+
// https://forums.swift.org/t/experimental-support-for-lifetime-dependencies-in-swift-6-2-and-beyond/78638
1012
.enableExperimentalFeature("Lifetimes"),
13+
// https://github.com/swiftlang/swift/pull/65218
14+
.enableExperimentalFeature("AvailabilityMacro=FeatherMailAvailability:macOS 15, iOS 18, watchOS 9, tvOS 11, visionOS 2"),
1115
]
1216

17+
#if compiler(>=6.2)
18+
defaultSwiftSettings.append(
19+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0461-async-function-isolation.md
20+
.enableUpcomingFeature("NonisolatedNonsendingByDefault")
21+
)
22+
#endif
23+
1324
let package = Package(
1425
name: "feather-mail",
15-
1626
products: [
1727
.library(name: "FeatherMail", targets: ["FeatherMail"]),
18-
.library(name: "FeatherMailTesting", targets: ["FeatherMailTesting"]),
1928
],
2029
dependencies: [
21-
.package(url: "https://github.com/apple/swift-log", from: "1.8.0"),
30+
// [docc-plugin-placeholder]
31+
.package(url: "https://github.com/apple/swift-log", from: "1.6.0"),
2232
],
33+
2334
targets: [
2435
.target(
2536
name: "FeatherMail",
2637
dependencies: [
2738
.product(name: "Logging", package: "swift-log"),
2839
]
2940
),
30-
.target(
31-
name: "FeatherMailTesting",
41+
.testTarget(
42+
name: "FeatherMailTests",
3243
dependencies: [
3344
.target(name: "FeatherMail"),
3445
],
3546
resources: [
3647
.copy("Assets/feather.png")
3748
]
3849
),
39-
.testTarget(
40-
name: "FeatherMailTests",
41-
dependencies: [
42-
.target(name: "FeatherMailTesting"),
43-
]
44-
),
45-
]
50+
],
51+
4652
)

Package@swift-6.0.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.

Package@swift-6.1.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,76 @@
22

33
An abstract mail component for Feather CMS.
44

5-
## Getting started
5+
[
6+
![Release: 1.0.0-beta.1](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E1-F05138)
7+
](
8+
https://github.com/feather-framework/feather-mail/releases/tag/1.0.0-beta.1
9+
)
10+
11+
## Features
12+
13+
- Immutable mail payload model
14+
- Validation helpers and errors
15+
- Raw MIME encoder for transport providers
16+
- Attachments and HTML support
17+
18+
## Requirements
619

7-
⚠️ This repository is a work in progress, things can break until it reaches v1.0.0.
20+
![Swift 6.1+](https://img.shields.io/badge/Swift-6%2E1%2B-F05138)
21+
![Platforms: macOS, iOS, tvOS, watchOS, visionOS](https://img.shields.io/badge/Platforms-macOS_%7C_iOS_%7C_tvOS_%7C_watchOS_%7C_visionOS-F05138)
822

9-
Use at your own risk.
23+
- Swift 6.1+
24+
- Platforms:
25+
- macOS 15+
26+
- iOS 18+
27+
- tvOS 18+
28+
- watchOS 11+
29+
- visionOS 2+
1030

11-
### Adding the dependency
31+
## Installation
1232

13-
To add a dependency on the package, declare it in your `Package.swift`:
33+
Use Swift Package Manager; add the dependency to your `Package.swift` file:
1434

1535
```swift
16-
.package(url: "https://github.com/feather-framework/feather-mail", .upToNextMinor(from: "0.4.0")),
36+
.package(url: "https://github.com/feather-framework/feather-mail", exact: "1.0.0-beta.1"),
1737
```
1838

19-
and to your application target, add `FeatherMail` to your dependencies:
39+
Then add `FeatherMail` to your target dependencies:
2040

2141
```swift
22-
.product(name: "FeatherMail", package: "feather-mail")
42+
.product(name: "FeatherMail", package: "feather-mail"),
2343
```
2444

25-
Example `Package.swift` file with `FeatherMail` as a dependency:
45+
## Usage
2646

27-
```swift
28-
// swift-tools-version:6.2
29-
import PackageDescription
30-
31-
let package = Package(
32-
name: "my-application",
33-
dependencies: [
34-
.package(url: "https://github.com/feather-framework/feather-mail", .upToNextMinor(from: "0.6.0")),
35-
],
36-
targets: [
37-
.target(name: "MyApplication", dependencies: [
38-
.product(name: "FeatherMail", package: "feather-mail")
39-
]),
40-
.testTarget(name: "MyApplicationTests", dependencies: [
41-
.target(name: "MyApplication"),
42-
]),
43-
]
47+
[
48+
![DocC API documentation](https://img.shields.io/badge/DocC-API_documentation-F05138)
49+
](
50+
https://feather-framework.github.io/feather-mail/
4451
)
45-
```
4652

47-
### Documentation
53+
API documentation is available at the following link.
54+
55+
> [!WARNING]
56+
> This repository is a work in progress, things can break until it reaches v1.0.0.
57+
58+
## Mail drivers
59+
60+
The following mail driver implementations are available for use:
61+
62+
- [SES Driver](https://github.com/feather-framework/feather-mail-driver-ses)
63+
- [SMTP Driver](https://github.com/feather-framework/feather-mail-driver-smtp)
64+
- [Memory Driver](https://github.com/feather-framework/feather-memory-mail)
65+
66+
## Development
67+
68+
- Build: `swift build`
69+
- Test:
70+
- local: `make test`
71+
- using Docker: `make docker-test`
72+
- Format: `make format`
73+
- Check: `make check`
74+
75+
## Contributing
4876

49-
The official API reference for this project is available at:
50-
[https://feather-framework.github.io/feather-mail/documentation/](https://feather-framework.github.io/feather-mail/documentation/)
77+
[Pull requests](https://github.com/feather-framework/feather-mail/pulls) are welcome. Please keep changes focused and include tests for new logic.

0 commit comments

Comments
 (0)