Skip to content

Commit

Permalink
docs: Update documentation to show inits (#252)
Browse files Browse the repository at this point in the history
* Update Jazzy to show async

* documentation nits

* ci should use latest xcode for docs
  • Loading branch information
cbaker6 committed Oct 6, 2021
1 parent 9cab7f1 commit ee67405
Show file tree
Hide file tree
Showing 29 changed files with 205 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ coverage:
status:
patch:
default:
target: 23
target: auto
changes: false
project:
default:
Expand Down
37 changes: 19 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: '*'
env:
CI_XCODE_VER: '/Applications/Xcode_11.7.app/Contents/Developer'
CI_XCODE_13_VER: '/Applications/Xcode_13.0.app/Contents/Developer'
CI_XCODE_13: '/Applications/Xcode_13.0.app/Contents/Developer'

jobs:
xcode-test-ios:
Expand All @@ -16,18 +16,18 @@ jobs:
- name: Version
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -version
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Build-Test
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift\ \(iOS\) -destination platform\=iOS\ Simulator,name\=iPhone\ 12\ Pro\ Max -derivedDataPath DerivedData test | xcpretty
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: IOS
fail_ci_if_error: false
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

xcode-test-macos:
runs-on: macos-11
Expand All @@ -42,13 +42,13 @@ jobs:
- name: Build-Test
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift\ \(macOS\) -destination platform\=macOS -derivedDataPath DerivedData test | xcpretty
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: MACOS
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

xcode-test-tvos:
runs-on: macos-11
Expand All @@ -57,13 +57,13 @@ jobs:
- name: Build
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift\ \(tvOS\) -destination platform\=tvOS\ Simulator,name\=Apple\ TV -derivedDataPath DerivedData test | xcpretty
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: TVOS
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

xcode-build-watchos:
runs-on: macos-11
Expand All @@ -72,13 +72,13 @@ jobs:
- name: Build
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -target ParseSwift\ \(watchOS\) | xcpretty
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: WATCHOS
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

spm-test:
runs-on: macos-11
Expand All @@ -93,25 +93,25 @@ jobs:
- name: Build
run: swift build -v
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Test
run: swift test --enable-code-coverage -v
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Prepare codecov
run: |
XCTEST=$(find .build -type f -name 'ParseSwiftPackageTests')
PROFDATA=$(find .build -type f -name '*.profdata')
xcrun llvm-cov export "${XCTEST}" -format="lcov" -instr-profile "${PROFDATA}" > info_spm.lcov
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: SPM
fail_ci_if_error: true
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

spm-test-5_2:
needs: xcode-build-watchos
Expand All @@ -138,14 +138,14 @@ jobs:
PROFDATA=$(find .build -type f -name '*.profdata')
xcrun llvm-cov export "${XCTEST}" -format="lcov" -instr-profile "${PROFDATA}" > info_spm_5_2.lcov
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: SPM5_2
fail_ci_if_error: true
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

linux:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -188,6 +188,7 @@ jobs:
run: ./Scripts/jazzy.sh
env:
BUILD_VERSION: '1.8.3'
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

cocoapods:
needs: xcode-build-watchos
Expand All @@ -201,7 +202,7 @@ jobs:
- name: CocoaPods
run: pod lib lint --allow-warnings
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

carthage:
needs: xcode-build-watchos
Expand All @@ -211,4 +212,4 @@ jobs:
- name: Carthage
run: ./carthage.sh build --no-skip-current --use-xcframeworks
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types: [published]
env:
CI_XCODE_VER: '/Applications/Xcode_11.7.app/Contents/Developer'
CI_XCODE_13_VER: '/Applications/Xcode_13.0.app/Contents/Developer'
CI_XCODE_13: '/Applications/Xcode_13.0.app/Contents/Developer'

jobs:
cocoapods:
Expand All @@ -20,12 +20,12 @@ jobs:
- name: CocoaPods
run: set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Deploy CocoaPods
run: set -o pipefail && env NSUnbufferedIO=YES pod trunk push ParseSwift.podspec --allow-warnings --verbose
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}

docs:
runs-on: macos-11
Expand All @@ -49,7 +49,7 @@ jobs:
run: ./Scripts/jazzy.sh
env:
BUILD_VERSION: ${{ env.TAG }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13_VER }}
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
- name: Deploy Jazzy Docs
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Parse-Swift Changelog

### main
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.10.2...main)
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.10.3...main)
* _Contributing to this repo? Add info about your change here to be included in the next release_

### 1.10.3
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.10.2...1.10.3)

__Improvements__
- Update documents to show new Swift 5.5 async/await methods ([#251](https://github.com/parse-community/Parse-Swift/pull/251)), thanks to [Corey Baker](https://github.com/cbaker6).

### 1.10.2
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.10.1...1.10.2)

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'jazzy', '~> 0.14.0'
gem 'jazzy', '~> 0.14.1'
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ GEM
httpclient (2.8.3)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jazzy (0.14.0)
jazzy (0.14.1)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4 (~> 1.3)
Expand Down Expand Up @@ -112,7 +112,7 @@ PLATFORMS
universal-darwin-20

DEPENDENCIES
jazzy (~> 0.14.0)
jazzy (~> 0.14.1)

BUNDLED WITH
2.2.2
2 changes: 1 addition & 1 deletion Scripts/jazzy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bundle exec jazzy \
--github_url https://github.com/parse-community/Parse-Swift \
--root-url http://parseplatform.org/Parse-Swift/api/ \
--module-version ${BUILD_VERSION} \
--theme fullwidth \
--theme apple \
--skip-undocumented \
--output ./docs/api \
--module ParseSwift \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public extension ParseApple {
- parameter identityToken: The `identityToken` from `ASAuthorizationAppleIDCredential`.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func login(user: String,
identityToken: Data,
Expand All @@ -31,6 +32,13 @@ public extension ParseApple {
}
}

/**
Login a `ParseUser` *asynchronously* using Apple authentication.
- parameter authData: Dictionary containing key/values.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func login(authData: [String: String],
options: API.Options = []) async throws -> AuthenticatedUser {
try await withCheckedThrowingContinuation { continuation in
Expand All @@ -51,6 +59,7 @@ public extension ParseApple {
- parameter identityToken: The `identityToken` from `ASAuthorizationAppleIDCredential`.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func link(user: String,
identityToken: Data,
Expand All @@ -63,6 +72,13 @@ public extension ParseApple {
}
}

/**
Link the *current* `ParseUser` *asynchronously* using Apple authentication.
- parameter authData: Dictionary containing key/values.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func link(authData: [String: String],
options: API.Options = []) async throws -> AuthenticatedUser {
try await withCheckedThrowingContinuation { continuation in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public extension ParseApple {
}
}

/**
Login a `ParseUser` *asynchronously* using Apple authentication. Publishes when complete.
- parameter authData: Dictionary containing key/values.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: A publisher that eventually produces a single value and then finishes or fails.
*/
func loginPublisher(authData: [String: String],
options: API.Options = []) -> Future<AuthenticatedUser, ParseError> {
Future { promise in
Expand Down Expand Up @@ -64,6 +70,12 @@ public extension ParseApple {
}
}

/**
Link the *current* `ParseUser` *asynchronously* using Apple authentication. Publishes when complete.
- parameter authData: Dictionary containing key/values.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: A publisher that eventually produces a single value and then finishes or fails.
*/
func linkPublisher(authData: [String: String],
options: API.Options = []) -> Future<AuthenticatedUser, ParseError> {
Future { promise in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public extension ParseFacebook {
- parameter expiresIn: Optional expiration in seconds for Facebook login.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func login(userId: String,
authenticationToken: String,
Expand All @@ -41,6 +42,7 @@ public extension ParseFacebook {
- parameter expiresIn: Optional expiration in seconds for Facebook login.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func login(userId: String,
accessToken: String,
Expand All @@ -55,6 +57,12 @@ public extension ParseFacebook {
}
}

/**
Login a `ParseUser` *asynchronously* using Facebook authentication for graph API login.
- parameter authData: Dictionary containing key/values.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func login(authData: [String: String],
options: API.Options = []) async throws -> AuthenticatedUser {
try await withCheckedThrowingContinuation { continuation in
Expand All @@ -75,6 +83,7 @@ public extension ParseFacebook {
- parameter expiresIn: Optional expiration in seconds for Facebook login.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func link(userId: String,
authenticationToken: String,
Expand All @@ -96,6 +105,7 @@ public extension ParseFacebook {
- parameter expiresIn: Optional expiration in seconds for Facebook login.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func link(userId: String,
accessToken: String,
Expand All @@ -110,6 +120,13 @@ public extension ParseFacebook {
}
}

/**
Link the *current* `ParseUser` *asynchronously* using Facebook authentication for graph API login.
- parameter authData: Dictionary containing key/values.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: An instance of the logged in `ParseUser`.
- throws: `ParseError`.
*/
func link(authData: [String: String],
options: API.Options = []) async throws -> AuthenticatedUser {
try await withCheckedThrowingContinuation { continuation in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public extension ParseFacebook {
}
}

/**
Login a `ParseUser` *asynchronously* using Facebook authentication for graph API login. Publishes when complete.
- parameter authData: Dictionary containing key/values.
- returns: A publisher that eventually produces a single value and then finishes or fails.
*/
func loginPublisher(authData: [String: String],
options: API.Options = []) -> Future<AuthenticatedUser, ParseError> {
Future { promise in
Expand Down Expand Up @@ -112,6 +117,12 @@ public extension ParseFacebook {
}
}

/**
Link the *current* `ParseUser` *asynchronously* using Facebook authentication for graph API login.
Publishes when complete.
- parameter authData: Dictionary containing key/values.
- returns: A publisher that eventually produces a single value and then finishes or fails.
*/
func linkPublisher(authData: [String: String],
options: API.Options = []) -> Future<AuthenticatedUser, ParseError> {
Future { promise in
Expand Down
Loading

0 comments on commit ee67405

Please sign in to comment.