Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit c6fa1ca

Browse files
committed
Merge branch 'release/0.3.0' into versions
2 parents 8c3927d + 60fe24b commit c6fa1ca

50 files changed

Lines changed: 1079 additions & 2459 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, versions]
6+
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
cancel-previous-runs:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Cancel previous runs of this workflow on same branch
16+
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
swiftlint:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Run SwiftLint
27+
uses: norio-nomura/action-swiftlint@3.1.0
28+
with:
29+
args: --strict
30+
31+
test-linux:
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
- name: Run tests
38+
run: swift test -v
39+
40+
test-macos:
41+
runs-on: macOS-latest
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
46+
- name: Run tests
47+
run: swift test -v

.gitignore

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## macOS
2+
# General
3+
.DS_Store
4+
.AppleDouble
5+
.LSOverride
6+
7+
# Icon must end with two \r
8+
Icon
9+
10+
# Thumbnails
11+
._*
12+
13+
# Files that might appear in the root of a volume
14+
.DocumentRevisions-V100
15+
.fseventsd
16+
.Spotlight-V100
17+
.TemporaryItems
18+
.Trashes
19+
.VolumeIcon.icns
20+
.com.apple.timemachine.donotpresent
21+
22+
# Directories potentially created on remote AFP share
23+
.AppleDB
24+
.AppleDesktop
25+
Network Trash Folder
26+
Temporary Items
27+
.apdisk
28+
129
# Xcode
230
#
331
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
@@ -64,4 +92,4 @@ Carthage/Cachefile
6492
fastlane/report.xml
6593
fastlane/Preview.html
6694
fastlane/screenshots
67-
fastlane/test_output
95+
fastlane/test_output

.sourcery/LinuxMain.stencil

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@testable import MicroyaTests
2+
import XCTest
3+
4+
// swiftlint:disable line_length file_length
5+
6+
{% for type in types.classes|based:"XCTestCase" %}
7+
extension {{ type.name }} {
8+
static var allTests: [(String, ({{ type.name }}) -> () throws -> Void)] = [
9+
{% for method in type.methods where method.parameters.count == 0 and method.shortName|hasPrefix:"test" and method|!annotated:"skipTestOnLinux" %} ("{{ method.shortName }}", {{ method.shortName }}){% if not forloop.last %},{% endif %}
10+
{% endfor %}]
11+
}
12+
13+
{% endfor %}
14+
XCTMain([
15+
{% for type in types.classes|based:"XCTestCase" %} testCase({{ type.name }}.allTests){% if not forloop.last %},{% endif %}
16+
{% endfor %}])

.swiftlint.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ opt_in_rules:
2929
- modifier_order
3030
- multiline_arguments
3131
- multiline_arguments_brackets
32-
- multiline_function_chains
3332
- multiline_literal_brackets
3433
- multiline_parameters
3534
- multiline_parameters_brackets
@@ -53,7 +52,6 @@ opt_in_rules:
5352
- sorted_first_last
5453
- sorted_imports
5554
- switch_case_on_newline
56-
- trailing_closure
5755
- type_contents_order
5856
- unavailable_function
5957
- unneeded_parentheses_in_closure_argument
@@ -71,7 +69,7 @@ disabled_rules:
7169
- type_name
7270

7371
included:
74-
- Frameworks
72+
- Sources
7573
- Tests
7674

7775
excluded:
@@ -86,15 +84,8 @@ explicit_type_interface:
8684
excluded:
8785
- local
8886

89-
file_header:
90-
required_pattern: |
91-
\/\/
92-
\/\/ Created by [^\(\)\d\n]+ on \S{6,10}\.
93-
\/\/ Copyright © \d{4} Flinesoft\. All rights reserved\.
94-
\/\/
95-
9687
file_name:
97-
suffix_pattern: "Extensions?|\\+.*"
88+
suffix_pattern: "Ext?|\\+.*"
9889

9990
file_types_order:
10091
order:
@@ -106,7 +97,11 @@ identifier_name:
10697
excluded:
10798
- id
10899

109-
line_length: 160
100+
large_tuple:
101+
warning: 3
102+
error: 5
103+
104+
line_length: 140
110105

111106
type_contents_order:
112107
order:

Microya.xcodeproj/xcshareddata/xcschemes/Microya watchOS.xcscheme renamed to .swiftpm/xcode/xcshareddata/xcschemes/Microya.xcscheme

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1010"
3+
LastUpgradeVersion = "1220"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -14,10 +14,24 @@
1414
buildForAnalyzing = "YES">
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "A102BD941F02358E000C6B38"
18-
BuildableName = "Microya.framework"
19-
BlueprintName = "Microya watchOS"
20-
ReferencedContainer = "container:Microya.xcodeproj">
17+
BlueprintIdentifier = "Microya"
18+
BuildableName = "Microya"
19+
BlueprintName = "Microya"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "MicroyaTests"
32+
BuildableName = "MicroyaTests"
33+
BlueprintName = "MicroyaTests"
34+
ReferencedContainer = "container:">
2135
</BuildableReference>
2236
</BuildActionEntry>
2337
</BuildActionEntries>
@@ -26,11 +40,21 @@
2640
buildConfiguration = "Debug"
2741
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2842
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES">
43+
shouldUseLaunchSchemeArgsEnv = "YES"
44+
language = "en"
45+
region = "US">
3046
<Testables>
47+
<TestableReference
48+
skipped = "NO">
49+
<BuildableReference
50+
BuildableIdentifier = "primary"
51+
BlueprintIdentifier = "MicroyaTests"
52+
BuildableName = "MicroyaTests"
53+
BlueprintName = "MicroyaTests"
54+
ReferencedContainer = "container:">
55+
</BuildableReference>
56+
</TestableReference>
3157
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3458
</TestAction>
3559
<LaunchAction
3660
buildConfiguration = "Debug"
@@ -42,17 +66,6 @@
4266
debugDocumentVersioning = "YES"
4367
debugServiceExtension = "internal"
4468
allowLocationSimulation = "YES">
45-
<MacroExpansion>
46-
<BuildableReference
47-
BuildableIdentifier = "primary"
48-
BlueprintIdentifier = "A102BD941F02358E000C6B38"
49-
BuildableName = "Microya.framework"
50-
BlueprintName = "Microya watchOS"
51-
ReferencedContainer = "container:Microya.xcodeproj">
52-
</BuildableReference>
53-
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5669
</LaunchAction>
5770
<ProfileAction
5871
buildConfiguration = "Release"
@@ -63,10 +76,10 @@
6376
<MacroExpansion>
6477
<BuildableReference
6578
BuildableIdentifier = "primary"
66-
BlueprintIdentifier = "A102BD941F02358E000C6B38"
67-
BuildableName = "Microya.framework"
68-
BlueprintName = "Microya watchOS"
69-
ReferencedContainer = "container:Microya.xcodeproj">
79+
BlueprintIdentifier = "Microya"
80+
BuildableName = "Microya"
81+
BlueprintName = "Microya"
82+
ReferencedContainer = "container:">
7083
</BuildableReference>
7184
</MacroExpansion>
7285
</ProfileAction>

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1717
### Security
1818
- None.
1919

20+
## [0.3.0] - 2020-11-03
21+
### Added
22+
- New `ApiProvider` type encapsulating different request methods with support for plugins.
23+
- New asynchronous `performRequest` methods with completion callbacks. ([#2](https://github.com/Flinesoft/Microya/issues/2))
24+
- New `Plugin` class to subclass for integrating into the networking logic via callbacks.
25+
- New pre-implemented plugins: `HttpBasicAuth`, `ProgressIndicator`, `RequestLogger`, `ResponseLogger`.
26+
- New `EmptyResponseBody` type to use whenever the body is expected to be empty or should be ignored.
27+
### Changed
28+
- Renamed `JsonApi` protocol to `Endpoint`.
29+
- Renamed `Method` to `HttpMethod` and added `body: Data` to the cases `post` and `patch`.
30+
- Moved the `request` method from `JsonApi` to the new `ApiProvider` & renamed to `performRequestAndWait`.
31+
- Generally improved the cases in `JsonApiError` & renamed the type to `ApiError`.
32+
- Moved CI from [Bitrise](https://www.bitrise.io/) to [GitHub Actions](https://github.com/Flinesoft/Microya/actions).
33+
### Removed
34+
- The `bodyData: Data?` requirement on `JsonApi` (bodies are not part of `HttpMethod`, see above).
35+
- Installation is no longer possible via [CocoaPods](https://github.com/CocoaPods/CocoaPods) or [Carthage](https://github.com/Carthage/Carthage). Please use [SwiftPM](https://github.com/apple/swift-package-manager) instead.
36+
2037
## [0.2.0] - 2020-08-15
2138
### Changed
2239
- Make some fields of the `JsonApi` protocol optional by providing default implementation.

Cartfile

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

Cartfile.resolved

Whitespace-only changes.

Frameworks/Microya/Globals/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)