Updated the names of the targets in the Package file to "HummingbirdDocC".
This commit is contained in:
1 parent
90c4033a49
commit
efedff51d1
40 files changed
+99
-24
No files matched your search
+15
-15
@@ -3,7 +3,7 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: DocCMiddleware.package,
|
||||
name: HummingbirdDocC.package,
|
||||
platforms: [
|
||||
.iOS(.v17),
|
||||
.macCatalyst(.v17),
|
||||
@@ -13,8 +13,8 @@ let package = Package(
|
||||
],
|
||||
products: [
|
||||
.library(
|
||||
name: DocCMiddleware.package,
|
||||
targets: [DocCMiddleware.target]
|
||||
name: HummingbirdDocC.package,
|
||||
targets: [HummingbirdDocC.target]
|
||||
),
|
||||
],
|
||||
dependencies: [
|
||||
@@ -24,12 +24,12 @@ let package = Package(
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
name: DocCMiddleware.sample,
|
||||
name: HummingbirdDocC.sample,
|
||||
dependencies: [
|
||||
.byName(name: DocCMiddleware.target),
|
||||
.byName(name: HummingbirdDocC.target),
|
||||
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
||||
],
|
||||
path: "Samples/DocCMiddleware",
|
||||
path: "Samples/HummingbirdDocC",
|
||||
swiftSettings: [
|
||||
// Enable better optimizations when building in Release configuration. Despite the use of
|
||||
// the `.unsafeFlags` construct required by SwiftPM, this flag is recommended for Release
|
||||
@@ -38,29 +38,29 @@ let package = Package(
|
||||
]
|
||||
),
|
||||
.target(
|
||||
name: DocCMiddleware.target,
|
||||
name: HummingbirdDocC.target,
|
||||
dependencies: [
|
||||
.product(name: "Hummingbird", package: "hummingbird"),
|
||||
],
|
||||
path: "Sources/DocCMiddleware",
|
||||
path: "Sources/HummingbirdDocC",
|
||||
swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]
|
||||
),
|
||||
.testTarget(
|
||||
name: DocCMiddleware.test,
|
||||
name: HummingbirdDocC.test,
|
||||
dependencies: [
|
||||
.product(name: "HummingbirdTesting", package: "hummingbird"),
|
||||
.byName(name: DocCMiddleware.target)
|
||||
.byName(name: HummingbirdDocC.target)
|
||||
],
|
||||
path: "Tests/DocCMiddleware"
|
||||
path: "Tests/HummingbirdDocC"
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
// MARK: - Constants
|
||||
|
||||
enum DocCMiddleware {
|
||||
enum HummingbirdDocC {
|
||||
static let package = "hummingbird-docc"
|
||||
static let sample = "\(DocCMiddleware.target)Sample"
|
||||
static let target = "DocCMiddleware"
|
||||
static let test = "\(DocCMiddleware.target)Test"
|
||||
static let sample = "\(HummingbirdDocC.target)Sample"
|
||||
static let target = "HummingbirdDocC"
|
||||
static let test = "\(HummingbirdDocC.target)Test"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// ===----------------------------------------------------------------------===
|
||||
//
|
||||
// This source file is part of the Hummingbird DocC Middleware open source project
|
||||
//
|
||||
// Copyright (c) 2025 Röck+Cöde VoF. and the Hummingbird DocC Middleware project authors
|
||||
// Licensed under the EUPL 1.2 or later.
|
||||
//
|
||||
// See LICENSE for license information
|
||||
// See CONTRIBUTORS for the list of Hummingbird DocC Middleware project authors
|
||||
//
|
||||
// ===----------------------------------------------------------------------===
|
||||
|
||||
import class Hummingbird.Router
|
||||
|
||||
import protocol Hummingbird.ApplicationProtocol
|
||||
|
||||
import struct Hummingbird.Application
|
||||
import struct Hummingbird.BindAddress
|
||||
import struct Logging.Logger
|
||||
|
||||
struct AppBuilder {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
/// A type that interacts with the logging system.
|
||||
private let logger: Logger
|
||||
|
||||
// MARK: Initializers
|
||||
|
||||
/// Initializes this builder.
|
||||
/// - Parameter logger: A type that interacts with the logging system.
|
||||
init(logger: Logger) {
|
||||
self.logger = logger
|
||||
}
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
func callAsFunction(
|
||||
_ arguments: AppArguments
|
||||
) -> some ApplicationProtocol {
|
||||
let router = Router()
|
||||
|
||||
return Application(
|
||||
router: router,
|
||||
configuration: .init(
|
||||
address: .hostname(arguments.hostname, port: arguments.port)
|
||||
),
|
||||
logger: logger
|
||||
)
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -10,7 +10,10 @@
|
||||
//
|
||||
// ===----------------------------------------------------------------------===
|
||||
|
||||
import protocol ArgumentParser.AsyncParsableCommand
|
||||
|
||||
import struct ArgumentParser.OptionGroup
|
||||
import struct Logging.Logger
|
||||
|
||||
/// A type that implements and runs the sample executable that showcases the `Hummingbird-DocC` middleware.
|
||||
@main struct SampleApp {
|
||||
@@ -22,3 +25,24 @@ import struct ArgumentParser.OptionGroup
|
||||
|
||||
}
|
||||
|
||||
// MARK: - AsyncParsableCommand
|
||||
|
||||
extension SampleApp: AsyncParsableCommand {
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
func run() async throws {
|
||||
let builder = AppBuilder(logger: {
|
||||
var logger = Logger(label: "sample.hummingbird-docc.logger")
|
||||
|
||||
logger.logLevel = arguments.logLevel ?? .trace
|
||||
|
||||
return logger
|
||||
}())
|
||||
|
||||
let application = builder(arguments)
|
||||
|
||||
try await application.run()
|
||||
}
|
||||
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
import Testing
|
||||
|
||||
@testable import enum DocCMiddleware.AssetFile
|
||||
@testable import enum HummingbirdDocC.AssetFile
|
||||
|
||||
@Suite("Asset File", .tags(.enumeration))
|
||||
struct AssetFileTests {
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
import Testing
|
||||
|
||||
@testable import enum DocCMiddleware.AssetFolder
|
||||
@testable import enum HummingbirdDocC.AssetFolder
|
||||
|
||||
@Suite("Asset Folder", .tags(.enumeration))
|
||||
struct AssetFolderTests {
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
import Testing
|
||||
|
||||
@testable import enum DocCMiddleware.DocumentationFolder
|
||||
@testable import enum HummingbirdDocC.DocumentationFolder
|
||||
|
||||
@Suite("Documentation Type", .tags(.enumeration))
|
||||
struct DocumentationTypeTests {
|
||||
+1
-1
@@ -17,7 +17,7 @@ import struct Hummingbird.HTTPResponse
|
||||
import struct Hummingbird.Request
|
||||
import struct Logging.Logger
|
||||
|
||||
@testable import DocCMiddleware
|
||||
@testable import HummingbirdDocC
|
||||
|
||||
@Suite("Logger Metadata Helpers", .tags(.extension))
|
||||
struct LoggerMetadata_HelpersTests {
|
||||
+1
-1
@@ -14,7 +14,7 @@ import Testing
|
||||
|
||||
import struct HummingbirdCore.URI
|
||||
|
||||
@testable import struct DocCMiddleware.CheckURIUseCase
|
||||
@testable import struct HummingbirdDocC.CheckURIUseCase
|
||||
|
||||
@Suite("Check URI use case", .tags(.useCase))
|
||||
struct CheckURIUseCaseTests {
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
import Testing
|
||||
|
||||
@testable import struct DocCMiddleware.PrepareURIPathUseCase
|
||||
@testable import struct HummingbirdDocC.PrepareURIPathUseCase
|
||||
|
||||
@Suite("Prepare URI Path Use Case", .tags(.useCase))
|
||||
struct PrepareURIPathUseCaseTests {
|
||||
+1
-1
@@ -18,7 +18,7 @@ import struct Hummingbird.HTTPResponse
|
||||
import struct Hummingbird.Request
|
||||
import struct Logging.Logger
|
||||
|
||||
@testable import struct DocCMiddleware.RedirectURIUseCase
|
||||
@testable import struct HummingbirdDocC.RedirectURIUseCase
|
||||
|
||||
@Suite("Redirect URI Use Case", .tags(.useCase))
|
||||
struct RedirectURIUseCaseTests {
|
||||
+1
-1
@@ -18,7 +18,7 @@ import struct Hummingbird.HTTPResponse
|
||||
import struct Hummingbird.Request
|
||||
import struct Logging.Logger
|
||||
|
||||
@testable import struct DocCMiddleware.ServeURIUseCase
|
||||
@testable import struct HummingbirdDocC.ServeURIUseCase
|
||||
|
||||
@Suite("Serve URI Use Case", .tags(.useCase))
|
||||
struct ServeURIUseCaseTests {
|
||||
+1
-1
@@ -20,7 +20,7 @@ import struct Hummingbird.LocalFileSystem
|
||||
import struct Hummingbird.Request
|
||||
import struct Logging.Logger
|
||||
|
||||
@testable import struct DocCMiddleware.DocCMiddleware
|
||||
@testable import struct HummingbirdDocC.DocCMiddleware
|
||||
|
||||
@Suite("DocC Middleware", .tags(.middleware))
|
||||
struct DocCMiddlewareTests {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user