feat: Fixes release build failures and get's release dockerfile working.

This commit is contained in:
2025-01-24 16:47:00 -05:00
parent 90c6058d56
commit 978ce8c74f
38 changed files with 233 additions and 217 deletions

View File

@@ -3,24 +3,29 @@ import ElementaryHTMX
import SharedModels
extension HTMLAttribute.hx {
@Sendable
static func get(route: SharedModels.ViewRoute) -> HTMLAttribute {
get(SharedModels.ViewRoute.router.path(for: route))
}
@Sendable
static func post(route: SharedModels.ViewRoute) -> HTMLAttribute {
post(SharedModels.ViewRoute.router.path(for: route))
}
@Sendable
static func put(route: SharedModels.ViewRoute) -> HTMLAttribute {
put(SharedModels.ViewRoute.router.path(for: route))
}
@Sendable
static func delete(route: SharedModels.ApiRoute) -> HTMLAttribute {
delete(SharedModels.ApiRoute.router.path(for: route))
}
}
extension HTMLAttribute.hx {
@Sendable
static func target(_ target: HXTarget) -> HTMLAttribute {
Self.target(target.selector)
}
@@ -28,37 +33,43 @@ extension HTMLAttribute.hx {
extension HTMLAttribute.hx where Tag: HTMLTrait.Attributes.Global {
@Sendable
static func on(_ event: HXOnEvent, value: String) -> HTMLAttribute {
HTMLAttribute.custom(name: "hx-on::\(event.rawValue)", value: value)
}
@Sendable
static func on(_ event: HXOnEvent, _ value: HXOnValue) -> HTMLAttribute {
on(event, value: value.value)
}
@Sendable
static func on(_ event: HXOnEvent, _ values: HXOnValue...) -> HTMLAttribute {
on(event, value: values.value)
}
}
enum HXOnEvent: String {
enum HXOnEvent: String, Sendable {
case afterRequest = "after-request"
}
indirect enum HXOnValue {
indirect enum HXOnValue: Sendable {
case ifSuccessful([Self])
case resetForm
case setWindowLocation(String)
case toggleContent(id: String)
@Sendable
static func toggleContent(_ toggle: Toggle) -> Self {
toggleContent(id: toggle.rawValue)
}
@Sendable
static func setWindowLocation(to route: ViewRoute) -> Self {
setWindowLocation(ViewRoute.router.path(for: route))
}
@Sendable
static func ifSuccessful(_ values: Self...) -> Self {
.ifSuccessful(values)
}
@@ -76,7 +87,7 @@ indirect enum HXOnValue {
}
}
enum Toggle: String {
enum Toggle: String, Sendable {
case float
}
}
@@ -89,12 +100,14 @@ extension Array where Element == HXOnValue {
}
extension HTMLAttribute where Tag: HTMLTrait.Attributes.Global {
@Sendable
static func id(_ key: IDKey) -> Self {
id(key.description)
}
}
enum IDKey: CustomStringConvertible {
enum IDKey: CustomStringConvertible, Sendable {
case branch(Branch)
case employee(Employee)
case float
@@ -115,7 +128,7 @@ enum IDKey: CustomStringConvertible {
}
}
enum Branch: CustomStringConvertible {
enum Branch: CustomStringConvertible, Sendable {
case list
case form
case row(id: VendorBranch.ID)
@@ -129,7 +142,7 @@ enum IDKey: CustomStringConvertible {
}
}
enum Employee: CustomStringConvertible {
enum Employee: CustomStringConvertible, Sendable {
case table
case row(id: SharedModels.Employee.ID)
@@ -141,7 +154,7 @@ enum IDKey: CustomStringConvertible {
}
}
enum PurchaseOrder: CustomStringConvertible {
enum PurchaseOrder: CustomStringConvertible, Sendable {
case content
case row(id: SharedModels.PurchaseOrder.ID)
case search
@@ -157,7 +170,7 @@ enum IDKey: CustomStringConvertible {
}
}
enum User: CustomStringConvertible {
enum User: CustomStringConvertible, Sendable {
case form
case row(id: SharedModels.User.ID)
case table
@@ -171,7 +184,7 @@ enum IDKey: CustomStringConvertible {
}
}
enum Vendor: CustomStringConvertible {
enum Vendor: CustomStringConvertible, Sendable {
case form
case row(id: SharedModels.Vendor.ID)
@@ -185,7 +198,7 @@ enum IDKey: CustomStringConvertible {
}
}
enum HXTarget: CustomStringConvertible {
enum HXTarget: CustomStringConvertible, Sendable {
case body
case id(IDKey)
case this