Skip to content

Commit 05f4b26

Browse files
committed
Initial commit
0 parents  commit 05f4b26

35 files changed

+1880
-0
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
macos:
11+
name: macOS (Xcode 16.0, Swift 6.0)
12+
runs-on: macos-15
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Select Xcode 16.0
16+
run: sudo xcode-select -s /Applications/Xcode_16.0.app
17+
- name: Swift version
18+
run: swift --version
19+
- name: Build
20+
run: swift build
21+
- name: Run tests
22+
run: swift test
23+
24+
macos-swift-6-2:
25+
name: macOS (Xcode 16.2, Swift 6.2)
26+
runs-on: macos-15
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Select Xcode 16.2
30+
run: sudo xcode-select -s /Applications/Xcode_16.2.app
31+
- name: Swift version
32+
run: swift --version
33+
- name: Build
34+
run: swift build
35+
- name: Run tests
36+
run: swift test
37+
38+
linux:
39+
name: Linux (Swift 6.0)
40+
runs-on: ubuntu-latest
41+
container: swift:6.0
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Swift version
45+
run: swift --version
46+
- name: Build
47+
run: swift build
48+
- name: Run tests
49+
run: swift test
50+
51+
windows:
52+
name: Windows (Swift 6.0)
53+
runs-on: windows-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: compnerd/gha-setup-swift@main
57+
with:
58+
branch: swift-6.0-release
59+
tag: 6.0-RELEASE
60+
- name: Swift version
61+
run: swift --version
62+
- name: Build
63+
run: swift build
64+
- name: Run tests
65+
run: swift test

.github/workflows/swift-format.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Swift Format
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
swift-format:
11+
name: Swift Format Check
12+
runs-on: macos-15
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Select Xcode 16.0
16+
run: sudo xcode-select -s /Applications/Xcode_16.0.app
17+
- name: Install swift-format
18+
run: |
19+
brew install swift-format
20+
- name: Run swift-format
21+
run: |
22+
swift-format lint --recursive Sources Tests

.github/workflows/swiftlint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: SwiftLint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
swiftlint:
11+
name: SwiftLint Check
12+
runs-on: macos-15
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install SwiftLint
16+
run: brew install swiftlint
17+
- name: Run SwiftLint
18+
run: swiftlint lint --strict

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/
7+
*.xcodeproj
8+
*~

.swift-format

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"lineLength": 100,
4+
"indentation": {
5+
"spaces": 4
6+
},
7+
"maximumBlankLines": 1,
8+
"respectsExistingLineBreaks": true,
9+
"lineBreakBeforeControlFlowKeywords": false,
10+
"lineBreakBeforeEachArgument": false
11+
}

.swiftlint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
disabled_rules:
2+
- trailing_comma
3+
- todo
4+
- line_length
5+
6+
opt_in_rules:
7+
- empty_count
8+
- empty_string
9+
10+
excluded:
11+
- .build
12+
- .swiftpm
13+
14+
line_length:
15+
warning: 120
16+
error: 200
17+
18+
identifier_name:
19+
min_length:
20+
warning: 1
21+
error: 1

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Apache License
2+
Version 2.0, January 2004
3+
http://www.apache.org/licenses/
4+
5+
Copyright 2025 swift-web-standards
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.

Package.swift

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
extension String {
6+
static let rss: Self = "RSS Standard"
7+
static let rssITunes: Self = "RSS Standard iTunes"
8+
static let rssDublinCore: Self = "RSS Standard Dublin Core"
9+
}
10+
11+
extension Target.Dependency {
12+
static var rss: Self { .target(name: .rss) }
13+
static var rssITunes: Self { .target(name: .rssITunes) }
14+
static var rssDublinCore: Self { .target(name: .rssDublinCore) }
15+
static var rfc3986: Self { .product(name: "RFC 3986", package: "swift-rfc-3986") }
16+
}
17+
18+
let package = Package(
19+
name: "swift-rss-standard",
20+
platforms: [
21+
.macOS(.v15),
22+
.iOS(.v18),
23+
.tvOS(.v18),
24+
.watchOS(.v11)
25+
],
26+
products: [
27+
.library(name: .rss, targets: [.rss]),
28+
.library(name: .rssITunes, targets: [.rssITunes]),
29+
.library(name: .rssDublinCore, targets: [.rssDublinCore]),
30+
],
31+
dependencies: [
32+
.package(path: "../swift-rfc-3986")
33+
],
34+
targets: [
35+
.target(
36+
name: .rss,
37+
dependencies: [.rfc3986]
38+
),
39+
.target(
40+
name: .rssITunes,
41+
dependencies: [.rss]
42+
),
43+
.target(
44+
name: .rssDublinCore,
45+
dependencies: [.rss]
46+
),
47+
.testTarget(
48+
name: .rss.tests,
49+
dependencies: [.rss, .rssITunes, .rssDublinCore]
50+
)
51+
],
52+
swiftLanguageModes: [.v6]
53+
)
54+
55+
extension String { var tests: Self { self + " Tests" } }
56+
57+
for target in package.targets {
58+
target.swiftSettings?.append(
59+
contentsOf: [
60+
.enableUpcomingFeature("MemberImportVisibility")
61+
]
62+
)
63+
}

README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# swift-rss-standard
2+
3+
[![CI](https://github.com/swift-web-standards/swift-rss-standard/workflows/CI/badge.svg)](https://github.com/swift-web-standards/swift-rss-standard/actions/workflows/ci.yml)
4+
![Development Status](https://img.shields.io/badge/status-active--development-blue.svg)
5+
6+
Type-safe RSS 2.0 feed type definitions for Swift with support for iTunes podcast extensions and Dublin Core metadata.
7+
8+
## Overview
9+
10+
swift-rss-standard provides complete RSS 2.0 specification support with type-safe Swift types for representing RSS feed data structures. Includes dedicated support for podcast feeds via iTunes extensions and metadata enrichment through Dublin Core.
11+
12+
For RSS feed generation and parsing, see [swift-rss](https://github.com/coenttb/swift-rss).
13+
14+
## Features
15+
16+
- **Complete RSS 2.0 Support**: All required and optional channel and item elements per RSS 2.0 specification
17+
- **iTunes Podcast Extensions**: Full support for podcast-specific metadata (duration, episode type, season/episode numbers)
18+
- **Dublin Core Metadata**: Rich metadata support for creators, subjects, publishers
19+
- **Type Safety**: Compile-time validation with Hashable, Sendable, Codable conformance
20+
- **Validation**: Failable initializers enforce RSS requirements (items require title OR description)
21+
- **Swift 6.0 Concurrency**: Strict concurrency mode with complete Sendable conformance
22+
23+
## Installation
24+
25+
Add swift-rss-standard to your Package.swift dependencies:
26+
27+
```swift
28+
dependencies: [
29+
.package(url: "https://github.com/swift-web-standards/swift-rss-standard", from: "0.1.0")
30+
]
31+
```
32+
33+
Then add the products you need to your target dependencies:
34+
35+
```swift
36+
.target(
37+
name: "YourTarget",
38+
dependencies: [
39+
.product(name: "RSS", package: "swift-rss-standard"),
40+
.product(name: "RSS iTunes", package: "swift-rss-standard"), // Optional: for podcast feeds
41+
.product(name: "RSS Dublin Core", package: "swift-rss-standard") // Optional: for metadata
42+
]
43+
)
44+
```
45+
46+
## Quick Start
47+
48+
```swift
49+
import RSS_Standard
50+
51+
// Create a basic RSS feed model
52+
let channel = RSS.Channel(
53+
title: "My Blog",
54+
link: URL(string: "https://example.com")!,
55+
description: "A blog about Swift development",
56+
language: "en-US",
57+
items: [
58+
try! RSS.Item(
59+
title: "First Post",
60+
description: "Hello, world!",
61+
link: URL(string: "https://example.com/post1")!,
62+
pubDate: Date()
63+
)
64+
]
65+
)
66+
67+
// Use the model with swift-rss for XML generation/parsing
68+
// See: https://github.com/coenttb/swift-rss
69+
```
70+
71+
## Usage Examples
72+
73+
### Podcast Feed with iTunes Extensions
74+
75+
```swift
76+
import RSS_Standard
77+
import RSS_Standard_iTunes
78+
79+
let channel = RSS.Channel(
80+
title: "My Podcast",
81+
link: URL(string: "https://example.com/podcast")!,
82+
description: "A podcast about technology",
83+
items: [
84+
try! RSS.Item(
85+
title: "Episode 1: Getting Started",
86+
description: "In this episode we discuss...",
87+
link: URL(string: "https://example.com/episode1")!,
88+
pubDate: Date()
89+
)
90+
]
91+
)
92+
93+
// Use with swift-rss for XML generation
94+
```
95+
96+
## Related Packages
97+
98+
- [swift-rss](https://github.com/coenttb/swift-rss): RSS feed generation and parsing using these types
99+
- [swift-rfc-4287](https://github.com/swift-web-standards/swift-rfc-4287): Type-safe Atom feed generation and parsing for Swift (RFC 4287 implementation)
100+
- [swift-json-feed](https://github.com/swift-web-standards/swift-json-feed): Type-safe JSON Feed generation and parsing for Swift
101+
- [swift-syndication](https://github.com/coenttb/swift-syndication): Unified syndication API supporting RSS, Atom, and JSON Feed with format conversion
102+
- [swift-rfc-2822](https://github.com/swift-web-standards/swift-rfc-2822): RFC 2822 date formatting for email and RSS dates
103+
104+
## License
105+
106+
This project is licensed under the Apache License 2.0. See LICENSE for details.
107+
108+
## Contributing
109+
110+
Contributions are welcome! Please feel free to submit a Pull Request.

0 commit comments

Comments
 (0)