Skip to content

Commit 6245a07

Browse files
authored
Add API Docs (#318)
* Update SPI Info * Update API Docs workflow * Update CI * Add DocC bundle * Wrap exports * Fix the imports
1 parent 0d11c45 commit 6245a07

File tree

13 files changed

+58
-18
lines changed

13 files changed

+58
-18
lines changed

.github/workflows/api-docs.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
name: deploy-api-docs
22
on:
3-
push:
4-
branches:
5-
- main
3+
push:
4+
branches:
5+
- main
66

77
jobs:
8-
deploy:
9-
name: api.vapor.codes
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Deploy api-docs
13-
uses: appleboy/ssh-action@master
14-
with:
15-
host: vapor.codes
16-
username: vapor
17-
key: ${{ secrets.VAPOR_CODES_SSH_KEY }}
18-
script: ./github-actions/deploy-api-docs.sh
8+
build-and-deploy:
9+
uses: vapor/api-docs/.github/workflows/build-and-deploy-docs-workflow.yml@main
10+
secrets: inherit
11+
with:
12+
package_name: mysql-kit
13+
modules: MySQLKit
14+
pathsToInvalidate: /mysqlkit

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,14 @@ jobs:
189189
run: swift test --sanitize=thread
190190
env:
191191
MYSQL_HOSTNAME: '127.0.0.1'
192+
193+
test-exports:
194+
name: Test exports
195+
runs-on: ubuntu-latest
196+
steps:
197+
- name: Check out Vapor
198+
uses: actions/checkout@v3
199+
with:
200+
fetch-depth: 0
201+
- name: Build
202+
run: swift build -Xswiftc -DBUILDING_DOCC

.spi.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
version: 1
22
metadata:
3-
authors: “Maintained by the Vapor Core Team with hundreds of contributions from the Vapor Community.”
3+
authors: "Maintained by the Vapor Core Team with hundreds of contributions from the Vapor Community."
4+
external_links:
5+
documentation: "https://api.vapor.codes/postgreskit/documentation/postgreskit/"

Sources/MySQLKit/ConnectionPool+MySQL.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import NIOCore
2+
import AsyncKit
3+
import Logging
4+
import MySQLNIO
5+
16
extension EventLoopConnectionPool where Source == MySQLConnectionSource {
27
public func database(logger: Logger) -> MySQLDatabase {
38
_EventLoopConnectionPoolMySQLDatabase(pool: self, logger: logger)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ``MySQLKit``
2+
3+
MySQLKit is a library to provide a simple Swift interface to MySQLNIO using SQLKit.

Sources/MySQLKit/Exports.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#if !BUILDING_DOCC
2+
13
@_exported import MySQLNIO
24
@_exported import AsyncKit
35
@_exported import SQLKit
6+
@_exported import struct Foundation.URL
7+
@_exported import struct Foundation.Data
8+
@_exported import struct NIOSSL.TLSConfiguration
9+
10+
#endif

Sources/MySQLKit/MySQLConfiguration.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@_exported import struct Foundation.URL
2-
@_exported import struct Foundation.Data
3-
@_exported import struct NIOSSL.TLSConfiguration
1+
import Foundation
2+
import NIOSSL
3+
import NIOCore
44

55
public struct MySQLConfiguration {
66
public var address: () throws -> SocketAddress

Sources/MySQLKit/MySQLConnectionSource.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import NIOCore
2+
import Logging
3+
import MySQLNIO
4+
import AsyncKit
5+
16
public struct MySQLConnectionSource: ConnectionPoolSource {
27
public let configuration: MySQLConfiguration
38

Sources/MySQLKit/MySQLDataEncoder.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Foundation
2+
import MySQLNIO
23

34
public struct MySQLDataEncoder {
45
let json: JSONEncoder

Sources/MySQLKit/MySQLDatabase+SQL.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import MySQLNIO
2+
import SQLKit
3+
14
extension MySQLDatabase {
25
public func sql(
36
encoder: MySQLDataEncoder = .init(),

0 commit comments

Comments
 (0)