Skip to content

Commit 9ea814b

Browse files
authored
Merge pull request #99 from tayloraswift/package-discovery
Package discovery
2 parents 705d897 + 5e1538d commit 9ea814b

File tree

277 files changed

+6076
-2409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

277 files changed

+6076
-2409
lines changed

Assets/css/Admin.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/css/Main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/css/Main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/js/Main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/js/Main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ let package:Package = .init(
3232
.library(name: "HTTPServer", targets: ["HTTPServer"]),
3333

3434
.library(name: "IP", targets: ["IP"]),
35+
.library(name: "ISO", targets: ["ISO"]),
3536
.library(name: "InlineArray", targets: ["InlineArray"]),
3637
.library(name: "InlineBuffer", targets: ["InlineBuffer"]),
3738
.library(name: "InlineDictionary", targets: ["InlineDictionary"]),
@@ -96,7 +97,7 @@ let package:Package = .init(
9697
.package(url: "https://github.com/tayloraswift/swift-hash", .upToNextMinor(
9798
from: "0.5.0")),
9899
.package(url: "https://github.com/tayloraswift/swift-mongodb", .upToNextMinor(
99-
from: "0.9.1")),
100+
from: "0.10.0")),
100101

101102
.package(url: "https://github.com/apple/swift-atomics", .upToNextMinor(
102103
from: "1.2.0")),
@@ -209,6 +210,7 @@ let package:Package = .init(
209210

210211
.target(name: "HTTP", dependencies:
211212
[
213+
.target(name: "ISO"),
212214
.target(name: "Media"),
213215
.target(name: "MD5"),
214216

@@ -249,6 +251,11 @@ let package:Package = .init(
249251

250252
.target(name: "InlineDictionary"),
251253

254+
.target(name: "ISO", dependencies:
255+
[
256+
.target(name: "IntegerEncodingMacros"),
257+
]),
258+
252259
.target(name: "JSONAST"),
253260

254261
.target(name: "JSONDecoding", dependencies:
@@ -326,10 +333,7 @@ let package:Package = .init(
326333
.target(name: "InlineBuffer"),
327334
]),
328335

329-
.target(name: "Media", dependencies:
330-
[
331-
.target(name: "IntegerEncodingMacros"),
332-
]),
336+
.target(name: "Media"),
333337

334338
.target(name: "Multiparts", dependencies:
335339
[

Sources/DOM/Conformances/Character (ext).swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
extension Character:HyperTextOutputStreamable
1+
extension Character:HTML.OutputStreamable
22
{
33
@inlinable public static
44
func += (html:inout HTML.ContentEncoder, self:Self)
55
{
66
html += self.utf8
77
}
88
}
9-
extension Character:ScalableVectorOutputStreamable
9+
extension Character:SVG.OutputStreamable
1010
{
1111
@inlinable public static
1212
func += (svg:inout SVG.ContentEncoder, self:Self)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
extension String:HyperTextOutputStreamable
1+
extension String:HTML.OutputStreamable
22
{
33
}
4-
extension String:ScalableVectorOutputStreamable
4+
extension String:SVG.OutputStreamable
55
{
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
extension Substring:HyperTextOutputStreamable
1+
extension Substring:HTML.OutputStreamable
22
{
33
}
4-
extension Substring:ScalableVectorOutputStreamable
4+
extension Substring:SVG.OutputStreamable
55
{
66
}

Sources/DOM/Conformances/Unicode.Scalar (ext).swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
extension Unicode.Scalar:HyperTextOutputStreamable
1+
extension Unicode.Scalar:HTML.OutputStreamable
22
{
33
@inlinable public static
44
func += (html:inout HTML.ContentEncoder, self:Self)
55
{
66
html += self.utf8
77
}
88
}
9-
extension Unicode.Scalar:ScalableVectorOutputStreamable
9+
extension Unicode.Scalar:SVG.OutputStreamable
1010
{
1111
@inlinable public static
1212
func += (svg:inout SVG.ContentEncoder, self:Self)

Sources/DOM/DOM.Attribute.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
extension DOM
2+
{
3+
@usableFromInline
4+
typealias Attribute = _DOMAttribute
5+
}
6+
7+
/// The name of this protocol is ``DOM.Attribute``.
8+
@usableFromInline
9+
protocol _DOMAttribute
10+
{
11+
var name:String { get }
12+
}
13+
extension DOM.Attribute where Self:RawRepresentable<String>
14+
{
15+
@inlinable internal
16+
var name:String { self.rawValue }
17+
}

Sources/DOM/DOM.Property.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
extension DOM
22
{
3-
@frozen @usableFromInline internal
4-
struct Property<Attribute> where Attribute:RawRepresentable<String>
3+
@frozen @usableFromInline
4+
struct Property<ID> where ID:Attribute
55
{
66
@usableFromInline internal
7-
let attribute:Attribute
7+
let attribute:ID
88
@usableFromInline internal
99
let value:String
1010

1111
@inlinable internal
12-
init(_ attribute:Attribute, _ value:String)
12+
init(_ attribute:ID, _ value:String)
1313
{
1414
self.attribute = attribute
1515
self.value = value
@@ -22,7 +22,7 @@ extension DOM.Property
2222
func += (utf8:inout [UInt8], self:Self)
2323
{
2424
utf8.append(0x20) // ' '
25-
utf8 += self.attribute.rawValue.utf8
25+
utf8 += self.attribute.name.utf8
2626

2727
if self.value.isEmpty
2828
{

Sources/DOM/HTML/HTML.Attribute.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extension HTML
44
{
55
@GenerateDynamicMemberFactory(excluding: "rel")
66
@frozen public
7-
enum Attribute:String, Equatable, Hashable, Sendable
7+
enum Attribute:String, DOM.Attribute, Equatable, Hashable, Sendable
88
{
99
case accept
1010
case accept_charset = "accept-charset"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
extension HTML.AttributeEncoder
2+
{
3+
@frozen @usableFromInline
4+
enum CustomData
5+
{
6+
case data(String)
7+
}
8+
}
9+
extension HTML.AttributeEncoder.CustomData:DOM.Attribute
10+
{
11+
@inlinable internal
12+
var name:String
13+
{
14+
switch self
15+
{
16+
case .data(let suffix): "data-\(suffix)"
17+
}
18+
}
19+
}

Sources/DOM/HTML/HTML.AttributeEncoder.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,25 @@ extension HTML.AttributeEncoder
4747
}
4848
}
4949
}
50+
extension HTML.AttributeEncoder
51+
{
52+
@inlinable public
53+
subscript(data suffix:String) -> String?
54+
{
55+
get
56+
{
57+
nil
58+
}
59+
set(text)
60+
{
61+
if let text:String
62+
{
63+
self.utf8 += DOM.Property<CustomData>.init(.data(suffix), text)
64+
}
65+
}
66+
}
67+
}
68+
5069
extension HTML.AttributeEncoder
5170
{
5271
@inlinable public

0 commit comments

Comments
 (0)