Skip to content

Commit d24cad7

Browse files
authored
General overdue cleanups (#208)
Bump Swift minimum to match Vapor, add platform versions, update README, general cleanup, fix imports, remove old Concurrency conditionals
1 parent 394d957 commit d24cad7

12 files changed

+19
-53
lines changed

Package.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.5.2
22
import PackageDescription
33

44
let package = Package(
55
name: "redis",
66
platforms: [
7-
.macOS(.v10_15)
7+
.macOS(.v10_15),
8+
.iOS(.v13),
9+
.tvOS(.v13),
10+
.watchOS(.v6),
811
],
912
products: [
1013
.library(name: "Redis", targets: ["Redis"])

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src="https://user-images.githubusercontent.com/1342803/60044372-33cc6100-9690-11e9-8ec4-d69afc3dccb1.png" alt="Redis">
33
<br>
44
<br>
5-
<a href="https://docs.vapor.codes/3.0/">
5+
<a href="https://docs.vapor.codes/4.0/">
66
<img src="http://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation">
77
</a>
88
<a href="https://discord.gg/vapor">
@@ -11,11 +11,11 @@
1111
<a href="LICENSE">
1212
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License">
1313
</a>
14-
<a href="https://circleci.com/gh/vapor/redis">
15-
<img src="https://circleci.com/gh/vapor/redis.svg?style=shield" alt="Continuous Integration">
14+
<a href="https://github.com/vapor/redis/actions/workflows/test.yml">
15+
<img src="https://github.com/vapor/redis/actions/workflows/test.yml/badge.svg?event=push" alt="CI">
1616
</a>
1717
<a href="https://swift.org">
18-
<img src="http://img.shields.io/badge/swift-5.0-brightgreen.svg" alt="Swift 5.0">
18+
<img src="http://img.shields.io/badge/swift-5.5-brightgreen.svg" alt="Swift 5.5">
1919
</a>
2020

2121
<span>This project is based off the Redis driver <a href="https://gitlab.com/Mordil/RediStack" target="_blank"><bold>RediStack</bold></a>. For the majority of API documentation, refer to <a href="https://docs.redistack.info" target="_blank">docs.redistack.info</a>.</span>

Sources/Redis/Application+Redis.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Vapor
22
import RediStack
3+
import NIOCore
4+
import Logging
35

46
extension Application {
57
public struct Redis {

Sources/Redis/Redis+Cache.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Vapor
22
import Foundation
33
import RediStack
4+
import NIOCore
45

56
// MARK: RedisCacheCoder
67

Sources/Redis/Redis+Concurrency.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
21
import NIOCore
32
import Vapor
43
import RediStack
4+
import Foundation
55

6-
@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
76
extension Application.Redis {
87
public func send(command: String, with arguments: [RESPValue]) async throws -> RESPValue {
98
try await self.application.redis(self.id)
@@ -55,7 +54,6 @@ extension Application.Redis {
5554
}
5655
}
5756

58-
@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
5957
extension RedisClient {
6058
/// Gets the provided key as a decodable type.
6159
public func get<D>(_ key: RedisKey, asJSON type: D.Type) async throws -> D?
@@ -80,7 +78,6 @@ extension RedisClient {
8078
}
8179
}
8280

83-
@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
8481
extension Request.Redis {
8582
public func send(command: String, with arguments: [RESPValue]) async throws -> RESPValue {
8683
try await self.request.application.redis(self.id)
@@ -132,6 +129,3 @@ extension Request.Redis {
132129
.get()
133130
}
134131
}
135-
136-
137-
#endif

Sources/Redis/Redis+Sessions.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Foundation
22
import Vapor
33
import RediStack
4+
import NIOCore
45

56
/// A delegate object that controls key behavior of an `Application.Redis.Sessions` driver.
67
public protocol RedisSessionsDelegate {

Sources/Redis/RedisClient+Codable.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncKit
22
import Foundation
33
import RediStack
4+
import NIOCore
45

56
extension RedisClient {
67
/// Gets the provided key as a decodable type.

Sources/Redis/Request+Redis.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Vapor
22
import RediStack
3+
import Logging
4+
import NIOCore
35

46
extension Request {
57
public struct Redis {

Tests/RedisTests/MultipleRedisTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Redis
33
import Vapor
44
import Logging
55
import XCTVapor
6+
import XCTest
67

78
private extension RedisID {
89
static let one: RedisID = "one"

Tests/RedisTests/RedisTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Vapor
33
import Logging
44
import XCTVapor
55
import RediStack
6+
import XCTest
67

78
extension String {
89
var int: Int? { Int(self) }

0 commit comments

Comments
 (0)