Skip to content

Commit

Permalink
Merge pull request Moya#1993 from Moya/development
Browse files Browse the repository at this point in the history
Merging development into master.
  • Loading branch information
sunshinejr authored Feb 15, 2020
2 parents 939b76f + 2dde0fc commit 9cc10d0
Show file tree
Hide file tree
Showing 70 changed files with 1,417 additions and 766 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
defaults: &defaults
macos:
xcode: '10.2.0'
xcode: 11.0.0
parallelism: 1
shell: /bin/bash --login
environment:
Expand Down Expand Up @@ -82,6 +82,9 @@ jobs:
- run:
name: Build Example Project
command: rake build_example
- run:
name: Install MDSpell
command: sudo npm install -g orta/node-markdown-spellcheck
- run:
name: Run Danger
command: brew install danger/tap/danger-swift && danger-swift ci
Expand Down
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ disabled_rules:
opt_in_rules:
- empty_count
- force_unwrapping
- extension_access_modifier

included:
- Sources
Expand Down
7 changes: 3 additions & 4 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github "Alamofire/Alamofire" ~> 4.1
github "ReactiveCocoa/ReactiveSwift" ~> 5.0
github "ReactiveX/RxSwift" ~> 4.0
github "antitypical/Result" ~> 4.1
github "Alamofire/Alamofire" ~> 5.0
github "ReactiveCocoa/ReactiveSwift" ~> 6.0
github "ReactiveX/RxSwift" ~> 5.0
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "AliSoftware/OHHTTPStubs" ~> 7.0.0
github "AliSoftware/OHHTTPStubs" ~> 9.0.0
github "Quick/Quick" ~> 2.0.0
github "Quick/Nimble" ~> 8.0.0
13 changes: 6 additions & 7 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
github "Alamofire/Alamofire" "4.8.2"
github "AliSoftware/OHHTTPStubs" "7.0.0"
github "Quick/Nimble" "v8.0.1"
github "Quick/Quick" "v2.0.0"
github "ReactiveCocoa/ReactiveSwift" "5.0.0"
github "ReactiveX/RxSwift" "4.4.2"
github "antitypical/Result" "4.1.0"
github "Alamofire/Alamofire" "5.0.0"
github "AliSoftware/OHHTTPStubs" "9.0.0"
github "Quick/Nimble" "v8.0.5"
github "Quick/Quick" "v2.2.0"
github "ReactiveCocoa/ReactiveSwift" "6.2.0"
github "ReactiveX/RxSwift" "5.0.1"
67 changes: 67 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
# Next

# [14.0.0] - 2020-02-15

### Changed
- **Breaking Change** Minimum version of `Alamofire` is now 5.0. [#1992](https://github.com/Moya/Moya/pull/1992) by [@sunshinejr](https://github.com/sunshinejr).
- **Breaking Change** `MultiTarget` now implements `AccessTokenAuthorizable` so that the inner target's `authorizationType` is correctly returned to the `AccessTokenPlugin` when requested. [#1979](https://github.com/Moya/Moya/pull/1979) by [@amaurydavid](https://github.com/amaurydavid).


# [14.0.0-beta.6] - 2019-12-09

### Changed
- **Breaking Change** In `AccessTokenPlugin`, the token closure now takes a `AuthorizationType` as parameter and `AuthorizationType.none` has been removed in favor of using `AuthorizationType?`. [#1969](https://github.com/Moya/Moya/pull/1969) by [@amaurydavid](https://github.com/amaurydavid).

### Fixed
- Fixed a data race condition issue and enable TSAN on the test action and CI. [#1952](https://github.com/Moya/Moya/pull/1952) by [@LucianoPAlmeida](https://github.com/LucianoPAlmeida).

# [14.0.0-beta.5] - 2019-10-27

### Changed
- **Breaking Change** Minimum version of `Alamofire` is now 5.0.0-rc.3. [#1944](https://github.com/Moya/Moya/pull/1944) by [@sunshinejr](https://github.com/sunshinejr).

# [14.0.0-beta.4] - 2019-10-05

### Removed
- **Breaking Change** Removed Combine extensions for now. Due to problems with weak-linking the framework, it's too difficult to support it with ease using all package managers and also without breaking backwards-compatibility. Probably gonna introduce it once we only support Xcode 11. [#1933](https://github.com/Moya/Moya/pull/1933) by [@sunshinejr](https://github.com/sunshinejr)

# [14.0.0-beta.3] - 2019-09-27

### Fixed
- Fixed an issue with displaying cURL-formatted request in `NetworkLoggerPlugin`. [#1916](https://github.com/Moya/Moya/pull/1916) by [@sunshinejr](https://github.com/sunshinejr).
- Fixed an issue that wouldn't display stubbed response body in `NetworkLoggerPlugin`. [#1916](https://github.com/Moya/Moya/pull/1916) by [@sunshinejr](https://github.com/sunshinejr).
- Fixed an issue where Carthage users using Xcode 11 couldn't install Moya 14. We added weak-linking for the xcodeproj so you might need additional steps for Xcode 10 + Carthage + Moya 14.* users. [#1920](https://github.com/Moya/Moya/pull/1920) by [@fredpi](https://github.com/fredpi) and [@sunshinejr](https://github.com/sunshinejr).
- Fixed an issue that wouldn't persist `URLRequest` changes (created by plugins) when stubbed. [#1921](https://github.com/Moya/Moya/pull/1921) by [@sunshinejr](https://github.com/sunshinejr).
- Fixed an issue with SPM integration - it no longer fetches testing libraries and also doesn't create runtime/Xcode Preview crashes. [#1923](https://github.com/Moya/Moya/pull/1923) by [@sunshinejr](https://github.com/sunshinejr).

# [14.0.0-beta.2] - 2019-09-09

### Changed
- **Breaking Change** Minimum version of `Alamofire` is now 5.0.0-rc.2. [#1912](https://github.com/Moya/Moya/pull/1912) by [@sunshinejr](https://github.com/sunshinejr).

## Added
- Combine support! [#1904](https://github.com/Moya/Moya/pull/1904) by [@sunshinejr](https://github.com/sunshinejr).
- Very raw SPM testing support! Thanks to the work on OHHTTPStubs, we can finally start using `swift test` again. [#1896](https://github.com/Moya/Moya/pull/1896) by [@sunshinejr](https://github.com/sunshinejr).

### Changed
- **Breaking Change** Minimum version of `Alamofire` is now 5.0.0-rc.1. [#1909](https://github.com/Moya/Moya/pull/1909) by [@sunshinejr](https://github.com/sunshinejr).
- **Breaking Change** The NetworkLoggerPlugin have been reworked to allow more customization about the logged request's components. [#1894](https://github.com/Moya/Moya/pull/1894) by [@amaurydavid](https://github.com/amaurydavid).
- **Breaking Change** Bumped ReactiveSwift version to 6.1.0. This should only affect Carthage users, but you'll probably want to use 6.1.0 in all of your Xcode 11 projects. [#1896](https://github.com/Moya/Moya/pull/1896) by [@sunshinejr](https://github.com/sunshinejr).
- `NetworkLoggerPlugin` now logs error when available (using `LogOptions.verbose` or specyfing `errorResponseBody` in your `LogOptions`). [#1880](https://github.com/Moya/Moya/pull/1880) by [@amaurydavid](https://github.com/amaurydavid).

# [14.0.0-alpha.2] - 2019-08-01

## Added
- `RequestType` now has `sessionHeaders`! These are the headers that are added when the request is added to a session. [#1878](https://github.com/Moya/Moya/pull/1878) by [@sunshinejr](https://github.com/sunshinejr).

### Changed
- **Breaking Change** Minimum target version are now in line with Alamofire 5. iOS: 10.0, tvOS: 10.0, macOS: 10.12, watchOS: 3.0. [#1810](https://github.com/Moya/Moya/pull/1810) by [@sunshinejr](https://github.com/sunshinejr).
- **Breaking Change** Minimum version of `Alamofire` is now 5.0.0-beta.7. [#1810](https://github.com/Moya/Moya/pull/1810) by [@sunshinejr](https://github.com/sunshinejr).
- **Breaking Change** Removed `Result` depndency in favor of `Result` introduced in Swift 5. [#1858](https://github.com/Moya/Moya/pull/1858) by [@larryonoff](https://github.com/larryonoff).
- **Breaking Change** Added `TargetType` parameter in the output of `NetworkLoggerPlugin`. [#1866](https://github.com/Moya/Moya/pull/1866) by [@hasankose](https://github.com/hasankose).
- `NetworkLoggerPlugin` uses the newly added `sessionHeaders` and now logs all the headers that the request will produce. [#1878](https://github.com/Moya/Moya/pull/1878) by [@sunshinejr](https://github.com/sunshinejr).

# [14.0.0-alpha.1] - 2019-05-14

### Changed
- **Breaking Change** Minimum version of `RxSwift` is now 5.0. [#1846](https://github.com/Moya/Moya/pull/1846) by [@LucianoPAlmeida](https://github.com/LucianoPAlmeida).
- **Breaking Change** Minimum version of `ReactiveSwift` is now 6.0. [#1849](https://github.com/Moya/Moya/pull/1849) by [@sunshinejr](https://github.com/sunshinejr).``

# [13.0.1] - 2019-05-01

### Fixed
Expand Down
1 change: 1 addition & 0 deletions Examples/Basic/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ViewController: UITableViewController {
func downloadZen() {
gitHubProvider.request(.zen) { result in
var message = "Couldn't access API"

if case let .success(response) = result {
let jsonString = try? response.mapString()
message = jsonString ?? message
Expand Down
2 changes: 1 addition & 1 deletion Examples/Multi-Target/ViewController.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Moya

let provider = MoyaProvider<MultiTarget>(plugins: [NetworkLoggerPlugin(verbose: true)])
let provider = MoyaProvider<MultiTarget>(plugins: [NetworkLoggerPlugin(configuration: .init(logOptions: .verbose))])

class ViewController: UITableViewController {
var progressView = UIView()
Expand Down
11 changes: 6 additions & 5 deletions Examples/_shared/GitHubAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ import Moya

// MARK: - Provider setup

private func JSONResponseDataFormatter(_ data: Data) -> Data {
private func JSONResponseDataFormatter(_ data: Data) -> String {
do {
let dataAsJSON = try JSONSerialization.jsonObject(with: data)
let prettyData = try JSONSerialization.data(withJSONObject: dataAsJSON, options: .prettyPrinted)
return prettyData
let prettyData = try JSONSerialization.data(withJSONObject: dataAsJSON, options: .prettyPrinted)
return String(data: prettyData, encoding: .utf8) ?? String(data: data, encoding: .utf8) ?? ""
} catch {
return data // fallback to original data if it can't be serialized.
return String(data: data, encoding: .utf8) ?? ""
}
}

let gitHubProvider = MoyaProvider<GitHub>(plugins: [NetworkLoggerPlugin(verbose: true, responseDataFormatter: JSONResponseDataFormatter)])
let gitHubProvider = MoyaProvider<GitHub>(plugins: [NetworkLoggerPlugin(configuration: .init(formatter: .init(responseData: JSONResponseDataFormatter),
logOptions: .verbose))])

// MARK: - Provider support

Expand Down
2 changes: 1 addition & 1 deletion Examples/_shared/GitHubUserContentAPI.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Moya

let gitHubUserContentProvider = MoyaProvider<GitHubUserContent>(plugins: [NetworkLoggerPlugin(verbose: true)])
let gitHubUserContentProvider = MoyaProvider<GitHubUserContent>(plugins: [NetworkLoggerPlugin(configuration: .init(logOptions: .verbose))])

public enum GitHubUserContent {
case downloadMoyaWebContent(String)
Expand Down
15 changes: 7 additions & 8 deletions Moya.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Moya"
s.version = "13.0.1"
s.version = "14.0.0"
s.summary = "Network abstraction layer written in Swift"
s.description = <<-EOS
Moya abstracts network commands using Swift Generics to provide developers
Expand All @@ -13,9 +13,9 @@ Pod::Spec.new do |s|
s.license = { :type => "MIT", :file => "License.md" }
s.author = { "Ash Furrow" => "[email protected]" }
s.social_media_url = "http://twitter.com/ashfurrow"
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '3.0'
s.source = { :git => "https://github.com/Moya/Moya.git", :tag => s.version }
s.default_subspec = "Core"
Expand All @@ -24,20 +24,19 @@ Pod::Spec.new do |s|

s.subspec "Core" do |ss|
ss.source_files = "Sources/Moya/", "Sources/Moya/Plugins/"
ss.dependency "Alamofire", "~> 4.1"
ss.dependency "Result", "~> 4.1"
ss.dependency "Alamofire", "~> 5.0"
ss.framework = "Foundation"
end

s.subspec "ReactiveSwift" do |ss|
ss.source_files = "Sources/ReactiveMoya/"
ss.dependency "Moya/Core"
ss.dependency "ReactiveSwift", "~> 5.0"
ss.dependency "ReactiveSwift", "~> 6.0"
end

s.subspec "RxSwift" do |ss|
ss.source_files = "Sources/RxMoya/"
ss.dependency "Moya/Core"
ss.dependency "RxSwift", "~> 4.0"
ss.dependency "RxSwift", "~> 5.0"
end
end
Loading

0 comments on commit 9cc10d0

Please sign in to comment.