Skip to content

Commit 6cff64c

Browse files
committed
lower the core plugin protocols to the SwiftinitPlugins module
1 parent 49f58ae commit 6cff64c

11 files changed

+22
-4
lines changed

Package.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ let package:Package = .init(
6363
.library(name: "Swiftinit", targets: ["Swiftinit"]),
6464
.library(name: "SwiftinitAssets", targets: ["SwiftinitAssets"]),
6565
.library(name: "SwiftinitPages", targets: ["SwiftinitPages"]),
66+
.library(name: "SwiftinitPlugins", targets: ["SwiftinitPlugins"]),
6667
.library(name: "SwiftinitRender", targets: ["SwiftinitRender"]),
6768

6869
.executable(name: "SwiftinitServer", targets: ["SwiftinitServer"]),
@@ -399,6 +400,16 @@ let package:Package = .init(
399400
.target(name: "UnidocQueries"),
400401
]),
401402

403+
.target(name: "SwiftinitPlugins", dependencies:
404+
[
405+
.target(name: "SwiftinitRender"),
406+
.target(name: "UnidocDB"),
407+
408+
.product(name: "Atomics", package: "swift-atomics"),
409+
.product(name: "NIOPosix", package: "swift-nio"),
410+
.product(name: "NIOSSL", package: "swift-nio-ssl"),
411+
]),
412+
402413
.target(name: "SwiftinitRender", dependencies:
403414
[
404415
.target(name: "HTTP"),
@@ -573,6 +584,7 @@ let package:Package = .init(
573584
.target(name: "Sitemaps"),
574585
.target(name: "SwiftinitAssets"),
575586
.target(name: "SwiftinitPages"),
587+
.target(name: "SwiftinitPlugins"),
576588
]),
577589

578590

Sources/SwiftinitServer/Server/Swiftinit.DB.swift renamed to Sources/SwiftinitPlugins/Swiftinit.DB.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extension Swiftinit
1212
public
1313
let unidoc:UnidocDatabase
1414

15+
@inlinable public
1516
init(sessions:Mongo.SessionPool, unidoc:UnidocDatabase)
1617
{
1718
self.sessions = sessions

Sources/SwiftinitServer/Plugins/Swiftinit.ServerPlugin.swift renamed to Sources/SwiftinitPlugins/Swiftinit.ServerPlugin.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,3 @@ protocol _SwiftinitServerPlugin:Identifiable<String>, Sendable
1414

1515
func run(in context:Swiftinit.ServerPluginContext, with db:Swiftinit.DB) async throws
1616
}
17-
extension Swiftinit.ServerPlugin
18-
{
19-
var page:(any Swiftinit.RenderablePage)? { self.status.load() }
20-
}

Sources/SwiftinitServer/Plugins/Swiftinit.ServerPluginContext.swift renamed to Sources/SwiftinitPlugins/Swiftinit.ServerPluginContext.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extension Swiftinit
1111
public
1212
let niossl:NIOSSLContext
1313

14+
@inlinable public
1415
init(threads:MultiThreadedEventLoopGroup, niossl:NIOSSLContext)
1516
{
1617
self.threads = threads
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@_exported import enum Swiftinit.Swiftinit

Sources/SwiftinitServer/Plugins/GitHub.CrawlerPlugin.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import GitHubAPI
22
import GitHubClient
33
import MongoDB
4+
import SwiftinitPlugins
45
import UnixTime
56

67
extension GitHub

Sources/SwiftinitServer/Plugins/Swiftinit.PolicyPlugin.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import HTTPClient
22
import HTTPServer
33
import IP
4+
import SwiftinitPlugins
45

56
extension Swiftinit
67
{
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
extension Swiftinit.ServerPlugin
2+
{
3+
var page:(any Swiftinit.RenderablePage)? { self.status.load() }
4+
}

0 commit comments

Comments
 (0)