Skip to content

Commit

Permalink
Split ConsoleKit into two functional targets - one for terminal inter…
Browse files Browse the repository at this point in the history
…action, one for command handling, plus an umbrella for compatibility. Also update README, and docs images. Clean up several bits of code.
  • Loading branch information
gwynne committed Nov 13, 2023
1 parent f4ef965 commit a129549
Show file tree
Hide file tree
Showing 76 changed files with 415 additions and 354 deletions.
5 changes: 0 additions & 5 deletions .github/CONTRIBUTING.md

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
secrets: inherit
with:
package_name: console-kit
modules: ConsoleKit
pathsToInvalidate: /consolekit/*
modules: ConsoleKit ConsoleKitTerminal ConsoleKitCommands
pathsToInvalidate: /consolekit/* /consolekitterminal/* /consolekitcommands/*
74 changes: 51 additions & 23 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,62 @@ let package = Package(
],
products: [
.library(name: "ConsoleKit", targets: ["ConsoleKit"]),
.library(name: "ConsoleKitTerminal", targets: ["ConsoleKitTerminal"]),
.library(name: "ConsoleKitCommands", targets: ["ConsoleKitCommands"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.56.0"),
],
targets: [
.target(name: "ConsoleKit", dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio")
]),
.testTarget(name: "ConsoleKitTests", dependencies: [
.target(name: "ConsoleKit"),
]),
.testTarget(name: "AsyncConsoleKitTests", dependencies: [
.target(name: "ConsoleKit"),
]),
.testTarget(name: "ConsoleKitPerformanceTests", dependencies: [
.target(name: "ConsoleKit")
]),
.executableTarget(name: "ConsoleKitExample", dependencies: [
.target(name: "ConsoleKit"),
]),
.executableTarget(name: "ConsoleKitAsyncExample", dependencies: [
.target(name: "ConsoleKit")
]),
.executableTarget(name: "ConsoleLoggerExample", dependencies: [
.target(name: "ConsoleKit"),
.product(name: "Logging", package: "swift-log")
])
.target(
name: "ConsoleKit",
dependencies: [
.target(name: "ConsoleKitCommands"),
.target(name: "ConsoleKitTerminal"),
]
),
.target(
name: "ConsoleKitCommands",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
.target(name: "ConsoleKitTerminal"),
]
),
.target(
name: "ConsoleKitTerminal",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
]
),
.testTarget(
name: "ConsoleKitTests",
dependencies: [.target(name: "ConsoleKit")]
),
.testTarget(
name: "AsyncConsoleKitTests",
dependencies: [.target(name: "ConsoleKit")]
),
.testTarget(
name: "ConsoleKitPerformanceTests",
dependencies: [.target(name: "ConsoleKit")]
),
.executableTarget(
name: "ConsoleKitExample",
dependencies: [.target(name: "ConsoleKit")]
),
.executableTarget(
name: "ConsoleKitAsyncExample",
dependencies: [.target(name: "ConsoleKit")]
),
.executableTarget(
name: "ConsoleLoggerExample",
dependencies: [
.target(name: "ConsoleKit"),
.product(name: "Logging", package: "swift-log"),
]
),
]
)
96 changes: 68 additions & 28 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// swift-tools-version:5.9
import PackageDescription

let swiftSettings: [PackageDescription.SwiftSetting] = [
.enableExperimentalFeature("StrictConcurrency=complete"),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("ConciseMagicFile"),
.enableUpcomingFeature("DisableOutwardActorInference"),
]

let package = Package(
name: "console-kit",
platforms: [
Expand All @@ -11,39 +19,71 @@ let package = Package(
],
products: [
.library(name: "ConsoleKit", targets: ["ConsoleKit"]),
.library(name: "ConsoleKitTerminal", targets: ["ConsoleKitTerminal"]),
.library(name: "ConsoleKitCommands", targets: ["ConsoleKitCommands"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.56.0"),
],
targets: [
.target(name: "ConsoleKit", dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio")
], swiftSettings: [
.enableExperimentalFeature("StrictConcurrency=complete"),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("ConciseMagicFile"),
]),
.testTarget(name: "ConsoleKitTests", dependencies: [
.target(name: "ConsoleKit"),
], swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]),
.testTarget(name: "AsyncConsoleKitTests", dependencies: [
.target(name: "ConsoleKit"),
], swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]),
.testTarget(name: "ConsoleKitPerformanceTests", dependencies: [
.target(name: "ConsoleKit")
], swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]),
.executableTarget(name: "ConsoleKitExample", dependencies: [
.target(name: "ConsoleKit"),
], swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]),
.executableTarget(name: "ConsoleKitAsyncExample", dependencies: [
.target(name: "ConsoleKit")
], swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]),
.executableTarget(name: "ConsoleLoggerExample", dependencies: [
.target(name: "ConsoleKit"),
.product(name: "Logging", package: "swift-log")
])
.target(
name: "ConsoleKit",
dependencies: [
.target(name: "ConsoleKitCommands"),
.target(name: "ConsoleKitTerminal"),
],
swiftSettings: swiftSettings
),
.target(
name: "ConsoleKitCommands",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
.target(name: "ConsoleKitTerminal"),
],
swiftSettings: swiftSettings
),
.target(
name: "ConsoleKitTerminal",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "ConsoleKitTests",
dependencies: [.target(name: "ConsoleKit")],
swiftSettings: swiftSettings
),
.testTarget(
name: "AsyncConsoleKitTests",
dependencies: [.target(name: "ConsoleKit")],
swiftSettings: swiftSettings
),
.testTarget(
name: "ConsoleKitPerformanceTests",
dependencies: [.target(name: "ConsoleKit")],
swiftSettings: swiftSettings
),
.executableTarget(
name: "ConsoleKitExample",
dependencies: [.target(name: "ConsoleKit")],
swiftSettings: swiftSettings
),
.executableTarget(
name: "ConsoleKitAsyncExample",
dependencies: [.target(name: "ConsoleKit")],
swiftSettings: swiftSettings
),
.executableTarget(
name: "ConsoleLoggerExample",
dependencies: [
.target(name: "ConsoleKit"),
.product(name: "Logging", package: "swift-log"),
],
swiftSettings: swiftSettings
),
]
)
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/1130717/261745577-198fc7fb-5d7c-4702-ae46-f7abbcadf2a0.png">
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/1130717/261745583-90f95eb5-fe6f-4e1b-8fe1-268ff889199d.png">
<img src="https://user-images.githubusercontent.com/1130717/261745583-90f95eb5-fe6f-4e1b-8fe1-268ff889199d.png" height="96" alt="ConsoleKit">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/vapor/console-kit/assets/1130717/3c06f3a4-8edb-4341-8b50-eb6aacb47e0b">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/vapor/console-kit/assets/1130717/3bb2255d-f564-43d2-a9e9-386420005adf">
<img src="https://github.com/vapor/console-kit/assets/1130717/3bb2255d-f564-43d2-a9e9-386420005adf" height="96" alt="ConsoleKit">
</picture>
<br>
<br>
<a href="https://docs.vapor.codes/4.0/"><img src="https://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation"></a>
<a href="https://discord.gg/vapor"><img src="https://img.shields.io/discord/431917998102675485.svg" alt="Team Chat"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License"></a>
<a href="https://github.com/vapor/console-kit/actions/workflows/test.yml"><img src="https://github.com/vapor/console-kit/actions/workflows/test.yml/badge.svg" alt="Continuous Integration"></a>
<a href="https://swift.org"><img src="https://img.shields.io/badge/swift-5.6-brightgreen.svg" alt="Swift 5.6"></a>
<a href="https://docs.vapor.codes/4.0/"><img src="https://design.vapor.codes/images/readthedocs.svg?1" alt="Documentation"></a>
<a href="https://discord.gg/vapor"><img src="https://design.vapor.codes/images/discordchat.svg" alt="Team Chat"></a>
<a href="LICENSE"><img src="https://design.vapor.codes/images/mitlicense.svg?1" alt="MIT License"></a>
<a href="https://github.com/vapor/console-kit/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/vapor/console-kit/test.yml?event=push&style=plastic&logo=github&label=test&logoColor=%23ccc" alt="Continuous Integration"></a>
<a href="https://codecov.io/github/vapor/console-kit"><img src="https://img.shields.io/codecov/c/github/vapor/console-kit?style=plastic&logo=codecov&label=Codecov&token=FroD9hgbSC"></a>
<a href="https://swift.org"><img src="https://design.vapor.codes/images/swift57up.svg?1" alt="Swift 5.7+"></a>
</p>
<br>
47 changes: 0 additions & 47 deletions Sources/ConsoleKit/Command/Utilities.swift

This file was deleted.

1 change: 0 additions & 1 deletion Sources/ConsoleKit/Docs.docc/images/article.svg

This file was deleted.

53 changes: 17 additions & 36 deletions Sources/ConsoleKit/Docs.docc/images/vapor-consolekit-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a129549

Please sign in to comment.