Skip to content

Commit d5c2d37

Browse files
authored
upgrade Elementary dependency to 0.6 (#17)
* dependency upgrade + rename * renamed content in examples * formatting * formatting ci
1 parent 6e8430d commit d5c2d37

File tree

17 files changed

+203
-86
lines changed

17 files changed

+203
-86
lines changed

.github/workflows/api-breakage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
timeout-minutes: 15
1010
container:
11-
image: swift:6.0
11+
image: swift:6.2
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v4

.github/workflows/format.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Swift Format Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "**.swift"
8+
pull_request:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
jobs:
13+
linux:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
strategy:
17+
matrix:
18+
image: ["swift:6.2"]
19+
20+
container:
21+
image: ${{ matrix.image }}
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Check Format
27+
run: swift format lint -prs .

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ DerivedData/
88
.netrc
99
Package.resolved
1010
/.vscode
11-
/.devcontainer
11+
/.devcontainer
12+
.swift-version

.swift-format

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"version": 1,
3+
"indentation": {
4+
"spaces": 4
5+
},
6+
"tabWidth": 4,
7+
"fileScopedDeclarationPrivacy": {
8+
"accessLevel": "private"
9+
},
10+
"spacesAroundRangeFormationOperators": false,
11+
"indentConditionalCompilationBlocks": false,
12+
"indentSwitchCaseLabels": false,
13+
"lineBreakAroundMultilineExpressionChainComponents": false,
14+
"lineBreakBeforeControlFlowKeywords": false,
15+
"lineBreakBeforeEachArgument": true,
16+
"lineBreakBeforeEachGenericRequirement": true,
17+
"lineLength": 140,
18+
"maximumBlankLines": 1,
19+
"respectsExistingLineBreaks": true,
20+
"prioritizeKeepingFunctionOutputTogether": true,
21+
"multiElementCollectionTrailingCommas": true,
22+
"rules": {
23+
"AllPublicDeclarationsHaveDocumentation": false,
24+
"AlwaysUseLiteralForEmptyCollectionInit": false,
25+
"AlwaysUseLowerCamelCase": false,
26+
"AmbiguousTrailingClosureOverload": true,
27+
"BeginDocumentationCommentWithOneLineSummary": false,
28+
"DoNotUseSemicolons": false,
29+
"DontRepeatTypeInStaticProperties": true,
30+
"FileScopedDeclarationPrivacy": true,
31+
"FullyIndirectEnum": true,
32+
"GroupNumericLiterals": true,
33+
"IdentifiersMustBeASCII": true,
34+
"NeverForceUnwrap": false,
35+
"NeverUseForceTry": false,
36+
"NeverUseImplicitlyUnwrappedOptionals": false,
37+
"NoAccessLevelOnExtensionDeclaration": false,
38+
"NoAssignmentInExpressions": true,
39+
"NoBlockComments": true,
40+
"NoCasesWithOnlyFallthrough": true,
41+
"NoEmptyTrailingClosureParentheses": true,
42+
"NoLabelsInCasePatterns": true,
43+
"NoLeadingUnderscores": false,
44+
"NoParensAroundConditions": true,
45+
"NoVoidReturnOnFunctionSignature": true,
46+
"OmitExplicitReturns": true,
47+
"OneCasePerLine": true,
48+
"OneVariableDeclarationPerLine": true,
49+
"OnlyOneTrailingClosureArgument": true,
50+
"OrderedImports": true,
51+
"ReplaceForEachWithForLoop": true,
52+
"ReturnVoidInsteadOfEmptyTuple": true,
53+
"UseEarlyExits": false,
54+
"UseExplicitNilCheckInConditions": false,
55+
"UseLetInEveryBoundCaseVariable": false,
56+
"UseShorthandTypeNames": true,
57+
"UseSingleLinePropertyGetter": false,
58+
"UseSynthesizedInitializer": false,
59+
"UseTripleSlashForDocumentationComments": true,
60+
"UseWhereClausesInForLoops": false,
61+
"ValidateDocumentationComments": false
62+
}
63+
}

.swiftformat

Lines changed: 0 additions & 1 deletion
This file was deleted.

Examples/HummingbirdDemo/Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import PackageDescription
44
let package = Package(
55
name: "HummingbirdDemo",
66
platforms: [
7-
.macOS(.v14),
7+
.macOS(.v14)
88
],
99
products: [
10-
.executable(name: "App", targets: ["App"]),
10+
.executable(name: "App", targets: ["App"])
1111
],
1212
dependencies: [
1313
.package(path: "../../"),
@@ -32,9 +32,9 @@ let package = Package(
3232
.product(name: "ServiceLifecycle", package: "swift-service-lifecycle"),
3333
],
3434
resources: [
35-
.copy("Public"),
35+
.copy("Public")
3636
],
3737
swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]
38-
),
38+
)
3939
]
4040
)

Examples/HummingbirdDemo/Sources/App/App.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Hummingbird
3-
import HummingbirdWebSocket
43
import HummingbirdWSCompression
4+
import HummingbirdWebSocket
55

66
@main
77
struct App {
@@ -22,7 +22,7 @@ struct App {
2222
onServerRunning: { _ in
2323
print("Server running on http://localhost:8080/")
2424
#if DEBUG
25-
browserSyncReload()
25+
browserSyncReload()
2626
#endif
2727
}
2828
)
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import Foundation
22

33
#if DEBUG
4-
func browserSyncReload() {
5-
let p = Process()
6-
p.executableURL = URL(string: "file:///bin/sh")
7-
p.arguments = ["-c", "browser-sync reload"]
8-
do {
9-
try p.run()
10-
} catch {
11-
print("Could not auto-reload: \(error)")
12-
}
4+
func browserSyncReload() {
5+
let p = Process()
6+
p.executableURL = URL(string: "file:///bin/sh")
7+
p.arguments = ["-c", "browser-sync reload"]
8+
do {
9+
try p.run()
10+
} catch {
11+
print("Could not auto-reload: \(error)")
1312
}
13+
}
1414
#endif

Examples/HummingbirdDemo/Sources/App/Views.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ struct MainPage: HTMLDocument {
4141
div(.hx.ext(.ws), .ws.connect("/echo"), .hx.target("#echo")) {
4242
form(.ws.send, .style("display: flex;")) {
4343
input(.type(.text), .name("message"), .value("Hello, World!"), .required)
44-
button(.class("btn btn-primary"), .style("height: 100%; margin-left: 1rem;")) { "Send" }
44+
button(.class("btn btn-primary"), .style("height: 100%; margin-left: 1rem;")) {
45+
"Send"
46+
}
4547
}
4648
div(.id("echo")) {}
4749
}
@@ -52,7 +54,7 @@ struct MainPage: HTMLDocument {
5254
struct ItemList: HTML {
5355
@Environment(EnvironmentValues.$database) var database
5456

55-
var content: some HTML<HTMLTag.div> {
57+
var body: some HTML<HTMLTag.div> {
5658
div(.id("list")) {
5759
let items = await database.model.items
5860

@@ -72,7 +74,7 @@ struct ItemList: HTML {
7274
}
7375

7476
struct TimeHeading: HTML {
75-
var content: some HTML<HTMLTag.h4> {
77+
var body: some HTML<HTMLTag.h4> {
7678
h4 {
7779
"Server Time: \(Date())"
7880
}
@@ -86,8 +88,11 @@ enum EnvironmentValues {
8688
struct WSResponse: HTML {
8789
var echoRequest: EchoRequest
8890

89-
var content: some HTML {
90-
div(.id(echoRequest.headers.hxTarget), .hx.swapOOB(.beforeEnd, "#\(echoRequest.headers.hxTarget)")) {
91+
var body: some HTML {
92+
div(
93+
.id(echoRequest.headers.hxTarget),
94+
.hx.swapOOB(.beforeEnd, "#\(echoRequest.headers.hxTarget)")
95+
) {
9196
"Received: \(echoRequest.message) at \(Date())"
9297
br()
9398
}

Examples/VaporDemo/Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import PackageDescription
44
let package = Package(
55
name: "HummingbirdDemo",
66
platforms: [
7-
.macOS(.v14),
7+
.macOS(.v14)
88
],
99
products: [
10-
.executable(name: "App", targets: ["App"]),
10+
.executable(name: "App", targets: ["App"])
1111
],
1212
dependencies: [
1313
.package(url: "https://github.com/vapor/vapor", from: "4.102.0"),
@@ -27,9 +27,9 @@ let package = Package(
2727
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
2828
],
2929
resources: [
30-
.copy("Public"),
30+
.copy("Public")
3131
],
3232
swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]
33-
),
33+
)
3434
]
3535
)

0 commit comments

Comments
 (0)