Skip to content

Commit

Permalink
Add API Docs (#758)
Browse files Browse the repository at this point in the history
* Update SPI info

* Update CI

* Update API Docs workflow

* Add DocC bundle

* Wrap exports

* Fix the imports

* Expand index

* Address PR review comments

* Exports check is now in the reusable workflow
  • Loading branch information
0xTim authored Feb 24, 2023
1 parent 4db22cc commit 892bfee
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 15 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
name: deploy-api-docs
on:
push:
branches:
- main
push:
branches:
- main

jobs:
deploy:
name: api.vapor.codes
runs-on: ubuntu-latest
steps:
- name: Deploy api-docs
uses: appleboy/ssh-action@master
with:
host: vapor.codes
username: vapor
key: ${{ secrets.VAPOR_CODES_SSH_KEY }}
script: ./github-actions/deploy-api-docs.sh
build-and-deploy:
uses: vapor/api-docs/.github/workflows/build-and-deploy-docs-workflow.yml@main
secrets: inherit
with:
package_name: fluent
modules: Fluent
pathsToInvalidate: /fluent
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
with_coverage: true
with_tsan: true
with_public_api_check: ${{ github.event_name == 'pull_request' }}

4 changes: 3 additions & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 1
metadata:
authors: “Maintained by the Vapor Core Team with hundreds of contributions from the Vapor Community.”
authors: "Maintained by the Vapor Core Team with hundreds of contributions from the Vapor Community."
external_links:
documentation: "https://docs.vapor.codes/fluent/overview/"
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if compiler(>=5.5) && canImport(_Concurrency)
import NIOCore
import Vapor
import FluentKit

@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
extension ModelCredentialsAuthenticatable {
Expand Down
1 change: 1 addition & 0 deletions Sources/Fluent/Concurrency/Pagination+Concurrency.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if compiler(>=5.5) && canImport(_Concurrency)
import NIOCore
import Vapor
import FluentKit

@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
extension QueryBuilder {
Expand Down
1 change: 1 addition & 0 deletions Sources/Fluent/Concurrency/Sessions+Concurrency.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if compiler(>=5.5) && canImport(_Concurrency)
import NIOCore
import Vapor
import FluentKit

@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
extension Model where Self: SessionAuthenticatable, Self.SessionID == Self.IDValue {
Expand Down
5 changes: 5 additions & 0 deletions Sources/Fluent/Docs.docc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ``Fluent``

Fluent makes it easy for you to use FluentKit in your Vapor application. It ties together the FluentKit database abstraction layer with the Vapor application lifecycle. It also provides helpers for mapping FluentKit's models to Vapor's authentication APIs.

For more information, see the [Vapor documentation](https://docs.vapor.codes/fluent/overview/).
4 changes: 4 additions & 0 deletions Sources/Fluent/Exports.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#if !BUILDING_DOCC

@_exported import FluentKit

infix operator ~~
infix operator =~
infix operator !~
infix operator !=~
infix operator !~=

#endif
1 change: 1 addition & 0 deletions Sources/Fluent/Fluent+Cache.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vapor
import FluentKit

extension Application.Caches {
public var fluent: Cache {
Expand Down
1 change: 1 addition & 0 deletions Sources/Fluent/Fluent+Paginate.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vapor
import FluentKit

extension QueryBuilder {
public func paginate(
Expand Down
1 change: 1 addition & 0 deletions Sources/Fluent/Fluent+Sessions.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vapor
import FluentKit

extension Application.Fluent {
public var sessions: Sessions {
Expand Down
1 change: 1 addition & 0 deletions Sources/Fluent/ModelAuthenticatable.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vapor
import FluentKit

public protocol ModelAuthenticatable: Model, Authenticatable {
static var usernameKey: KeyPath<Self, Field<String>> { get }
Expand Down
1 change: 1 addition & 0 deletions Sources/Fluent/ModelCredentialsAuthenticatable.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vapor
import FluentKit

public protocol ModelCredentialsAuthenticatable: Model, Authenticatable {
static var usernameKey: KeyPath<Self, Field<String>> { get }
Expand Down
1 change: 1 addition & 0 deletions Sources/Fluent/ModelTokenAuthenticatable.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vapor
import FluentKit

public protocol ModelTokenAuthenticatable: Model, Authenticatable {
associatedtype User: Model & Authenticatable
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentTests/CredentialTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import XCTFluent
import XCTVapor
import Fluent
import Vapor
import FluentKit

final class CredentialTests: XCTestCase {

Expand Down
1 change: 1 addition & 0 deletions Tests/FluentTests/OperatorTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Fluent
import Vapor
import XCTVapor
import FluentKit

final class OperatorTests: XCTestCase {
func testCustomOperators() throws {
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentTests/PaginationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Fluent
import Vapor
import XCTVapor
import XCTFluent
import FluentKit

final class PaginationTests: XCTestCase {
func testPagination() throws {
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentTests/QueryHistoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Fluent
import Vapor
import XCTFluent
import XCTVapor
import FluentKit

final class QueryHistoryTests: XCTestCase {
func testQueryHistoryDisabled() throws {
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentTests/RepositoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Fluent
import Vapor
import XCTFluent
import XCTVapor
import FluentKit

final class RepositoryTests: XCTestCase {
func testRepositoryPatternStatic() throws {
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentTests/SessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import XCTFluent
import XCTVapor
import Fluent
import Vapor
import FluentKit

final class SessionTests: XCTestCase {
func testSessionMigrationName() {
Expand Down

0 comments on commit 892bfee

Please sign in to comment.