Skip to content

Commit b8cb79e

Browse files
committed
organize frontend HTML under the Swiftinit namespace
1 parent 64f028d commit b8cb79e

File tree

128 files changed

+772
-768
lines changed

Some content is hidden

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

128 files changed

+772
-768
lines changed

Package.swift

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ let package:Package = .init(
5555
.library(name: "Sitemaps", targets: ["Sitemaps"]),
5656
.library(name: "Sources", targets: ["Sources"]),
5757

58+
.library(name: "Swiftinit", targets: ["Swiftinit"]),
59+
5860
.library(name: "SymbolGraphBuilder", targets: ["SymbolGraphBuilder"]),
5961
.library(name: "SymbolGraphCompiler", targets: ["SymbolGraphCompiler"]),
6062
.library(name: "SymbolGraphLinker", targets: ["SymbolGraphLinker"]),
@@ -66,8 +68,8 @@ let package:Package = .init(
6668

6769
.library(name: "UA", targets: ["UA"]),
6870
.library(name: "Unidoc", targets: ["Unidoc"]),
71+
.library(name: "UnidocAPI", targets: ["UnidocAPI"]),
6972
.library(name: "UnidocAssets", targets: ["UnidocAssets"]),
70-
.library(name: "UnidocAutomation", targets: ["UnidocAutomation"]),
7173
.library(name: "UnidocDB", targets: ["UnidocDB"]),
7274
.library(name: "UnidocDiagnostics", targets: ["UnidocDiagnostics"]),
7375
.library(name: "UnidocLinker", targets: ["UnidocLinker"]),
@@ -365,6 +367,11 @@ let package:Package = .init(
365367

366368
.target(name: "Sources"),
367369

370+
.target(name: "Swiftinit", dependencies:
371+
[
372+
.target(name: "URI"),
373+
]),
374+
368375
.target(name: "Symbols", dependencies:
369376
[
370377
.target(name: "Sources"),
@@ -439,15 +446,16 @@ let package:Package = .init(
439446

440447
.target(name: "Unidoc"),
441448

442-
.target(name: "UnidocAssets", dependencies:
449+
.target(name: "UnidocAPI", dependencies:
443450
[
444-
.target(name: "UnidocPages"),
445-
.target(name: "System"),
451+
.target(name: "JSON"),
452+
.target(name: "Unidoc"),
446453
]),
447454

448-
.target(name: "UnidocAutomation", dependencies:
455+
.target(name: "UnidocAssets", dependencies:
449456
[
450-
.target(name: "JSON"),
457+
.target(name: "UnidocPages"),
458+
.target(name: "System"),
451459
]),
452460

453461
.target(name: "UnidocDB", dependencies:
@@ -478,7 +486,8 @@ let package:Package = .init(
478486
.target(name: "GitHubAPI"),
479487
.target(name: "HTTP"),
480488
.target(name: "MarkdownRendering"),
481-
.target(name: "UnidocAutomation"),
489+
.target(name: "Swiftinit"),
490+
.target(name: "UnidocAPI"),
482491
.target(name: "UnidocProfiling"),
483492
.target(name: "UnidocQueries"),
484493
.target(name: "URI"),
@@ -504,7 +513,7 @@ let package:Package = .init(
504513
.target(name: "JSON"),
505514
.target(name: "MD5"),
506515
.target(name: "SymbolGraphs"),
507-
.target(name: "Unidoc"),
516+
.target(name: "UnidocAPI"),
508517
]),
509518

510519
.target(name: "UnixTime"),
@@ -532,7 +541,7 @@ let package:Package = .init(
532541
[
533542
.target(name: "HTTPClient"),
534543
.target(name: "SymbolGraphBuilder"),
535-
.target(name: "UnidocAutomation"),
544+
.target(name: "UnidocAPI"),
536545
.target(name: "UnidocLinker"),
537546
.target(name: "UnidocRecords"),
538547
]),
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
extension Swiftinit
2+
{
3+
public
4+
typealias Method = _SwiftinitMethod
5+
}
6+
7+
/// The name of this protocol is ``Swiftinit.Method``.
8+
public
9+
protocol _SwiftinitMethod:LosslessStringConvertible
10+
{
11+
}
12+
extension Swiftinit.Method where Self:RawRepresentable<String>
13+
{
14+
@inlinable public
15+
var description:String { self.rawValue }
16+
17+
@inlinable public
18+
init?(_ description:String)
19+
{
20+
self.init(rawValue: description)
21+
}
22+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import URI
2+
3+
extension Swiftinit
4+
{
5+
public
6+
typealias StaticRoot = _SwiftinitStaticRoot
7+
}
8+
9+
/// The name of this protocol is ``Swiftinit.StaticRoot``.
10+
public
11+
protocol _SwiftinitStaticRoot
12+
{
13+
associatedtype Get = Never
14+
associatedtype Post = Never
15+
16+
static
17+
var root:String { get }
18+
}
19+
extension Swiftinit.StaticRoot
20+
{
21+
@inlinable public static
22+
var uri:URI { [.push(self.root)] }
23+
}
24+
extension Swiftinit.StaticRoot where Get:Swiftinit.Method
25+
{
26+
@inlinable public static
27+
subscript(get:Get) -> URI { Self.uri.path / "\(get)" }
28+
}
29+
extension Swiftinit.StaticRoot where Post:Swiftinit.Method
30+
{
31+
@inlinable public static
32+
subscript(post:Post) -> URI { Self.uri.path / "\(post)" }
33+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extension Swiftinit.API
2+
{
3+
@frozen public
4+
enum Get:String, Swiftinit.Method
5+
{
6+
case build
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import UnidocAutomation
2-
3-
extension UnidocAPI
1+
extension Swiftinit.API
42
{
53
@frozen public
6-
enum Post:String
4+
enum Post:String, Swiftinit.Method
75
{
86
case alignPackage = "align-package"
97
case indexRepo = "index-repo"
@@ -12,6 +10,3 @@ extension UnidocAPI
1210
case unlink
1311
}
1412
}
15-
extension UnidocAPI.Post:StaticAPI
16-
{
17-
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
import UnidocAutomation
2-
3-
extension UnidocAPI
1+
extension Swiftinit.API
42
{
53
@frozen public
6-
enum Put:String
4+
enum Put:String, Swiftinit.Method
75
{
86
case snapshot = "snapshot"
97
case graph = "symbolgraph"
108
}
119
}
12-
extension UnidocAPI.Put:StaticAPI
13-
{
14-
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extension Swiftinit
2+
{
3+
@frozen public
4+
enum API:StaticRoot
5+
{
6+
@inlinable public static
7+
var root:String { "api" }
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extension Swiftinit
2+
{
3+
@frozen public
4+
enum Admin:StaticRoot
5+
{
6+
@inlinable public static
7+
var root:String { "admin" }
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extension Swiftinit
2+
{
3+
public
4+
enum Asset:StaticRoot
5+
{
6+
@inlinable public static
7+
var root:String { "asset" }
8+
}
9+
}

0 commit comments

Comments
 (0)