Skip to content

Commit e1326d2

Browse files
authored
Elementary moved to elementary-swift (#7)
1 parent a14bc5d commit e1326d2

6 files changed

Lines changed: 85 additions & 35 deletions

File tree

.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 & 23 deletions
This file was deleted.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ let package = Package(
1919
.library(
2020
name: "VaporElementary",
2121
targets: ["VaporElementary"]
22-
),
22+
)
2323
],
2424
dependencies: [
2525
.package(url: "https://github.com/vapor/vapor.git", from: "4.102.0"),
26-
.package(url: "https://github.com/sliemeobn/elementary.git", from: "0.4.3"),
26+
.package(url: "https://github.com/elementary-swift/elementary.git", from: "0.4.3"),
2727
],
2828
targets: [
2929
.target(

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvapor-community%2Fvapor-elementary%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/vapor-community/vapor-elementary)
66
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvapor-community%2Fvapor-elementary%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/vapor-community/vapor-elementary)
77

8-
This packages helps you serve [Elementary](https://swiftpackageindex.com/sliemeobn/elementary) HTML web apps with Vapor.
8+
> [!IMPORTANT]
9+
>
10+
> Elementary has 📦 moved 📦 to its new home at **`https://github.com/elementary-swift`**.
11+
> Please update your URLs to avoid trouble - and reach out if anything breaks!
12+
13+
This packages helps you serve [Elementary](https://swiftpackageindex.com/elementary-swift/elementary) HTML web apps with Vapor.
914

1015
Simply wrap `HTMLResponse` around your HTML content and return it from your routes.
1116

@@ -22,4 +27,4 @@ app.get("index") { _ in
2227
}
2328
```
2429

25-
Check out the docs in the [Elementary repo](https://github.com/sliemeobn/elementary) for more information.
30+
Check out the docs in the [Elementary repo](https://github.com/elementary-swift/elementary) for more information.

Tests/VaporElementaryTests/HTMLResponseTests.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Elementary
22
import Vapor
33
import VaporElementary
4-
import XCTest
54
import XCTVapor
5+
import XCTest
66

77
final class HTMLResponseTests: XCTestCase {
88
var app: Application!
@@ -28,7 +28,10 @@ final class HTMLResponseTests: XCTestCase {
2828
self.app.get { _ in HTMLResponse { TestPage() } }
2929

3030
let response = try await app.sendRequest(.GET, "/")
31-
XCTAssertEqual(String(buffer: response.body), #"<!DOCTYPE html><html><head><title>Test Page</title><link rel="stylesheet" href="/styles.css"></head><body><h1 id="foo">bar</h1></body></html>"#)
31+
XCTAssertEqual(
32+
String(buffer: response.body),
33+
#"<!DOCTYPE html><html><head><title>Test Page</title><link rel="stylesheet" href="/styles.css"></head><body><h1 id="foo">bar</h1></body></html>"#
34+
)
3235
}
3336

3437
func testRespondsWithAFragment() async throws {
@@ -40,11 +43,13 @@ final class HTMLResponseTests: XCTestCase {
4043

4144
func testRespondsWithALargeDocument() async throws {
4245
let count = 1000
43-
self.app.get { _ in HTMLResponse {
44-
for _ in 0..<count {
45-
p {}
46+
self.app.get { _ in
47+
HTMLResponse {
48+
for _ in 0..<count {
49+
p {}
50+
}
4651
}
47-
} }
52+
}
4853

4954
let response = try await app.sendRequest(.GET, "/")
5055
XCTAssertEqual(String(buffer: response.body), Array(repeating: "<p></p>", count: count).joined())

Tests/VaporElementaryTests/NonSendableHTMLResponseTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Elementary
22
import Vapor
33
import VaporElementary
4-
import XCTest
54
import XCTVapor
5+
import XCTest
66

77
final class NonSendableHTMLResponseTests: XCTestCase {
88
var app: Application!
@@ -45,7 +45,7 @@ final class NonSendableHTMLResponseTests: XCTestCase {
4545
extension NonSendableHTML: Sendable {}
4646

4747
struct NonSendableHTML: HTML {
48-
var content: some HTML {
48+
var body: some HTML {
4949
"Hello"
5050
}
5151
}

0 commit comments

Comments
 (0)