Skip to content

Commit

Permalink
Merge pull request #133 from dl-alexandre/swift6
Browse files Browse the repository at this point in the history
Swift 6
  • Loading branch information
twostraws authored Oct 9, 2024
2 parents 02c14ae + 5267ad9 commit ea9708d
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Sources/Ignite/Actions/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// One action that can be triggered on the page. Actions compile
/// to JavaScript.
public protocol Action {
public protocol Action: Sendable {
/// Convert this action into the equivalent JavaScript code.
func compile() -> String
}
4 changes: 2 additions & 2 deletions Sources/Ignite/Actions/ShowModal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import Foundation

/// Shows a modal dialog with the content of the page element identified by ID
public struct ShowModal: Action {
public struct ShowModal: Action, Sendable {

/// The options used to configure the modal presentation
public enum Option {
public enum Option: Sendable {
/// Shows the modal with a backdrop optionally dismissible by clicking on the backdrop.
/// - Parameter dismissible: Whether the modal can be dismissed by clicking on the backdrop. Default is `true`.
case backdrop(dismissible: Bool)
Expand Down
6 changes: 3 additions & 3 deletions Sources/Ignite/Elements/Card.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public struct Card: BlockElement {
}

/// Where to position the content of the card relative to it image.
public enum ContentPosition: CaseIterable {
public static var allCases: [Card.ContentPosition] = [
public enum ContentPosition: CaseIterable, Sendable {
public static let allCases: [Card.ContentPosition] = [
.bottom, .top, .overlay(alignment: .topLeading)
]

Expand Down Expand Up @@ -83,7 +83,7 @@ public struct Card: BlockElement {
case end = "align-content-end"
}

public enum ContentAlignment: CaseIterable {
public enum ContentAlignment: CaseIterable, Sendable {
case topLeading
case top
case topTrailing
Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Elements/MetaLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// An item of metadata that links to an external resource somehow, such as
/// a stylesheet.
public struct MetaLink: HeadElement {
public struct MetaLink: HeadElement, Sendable {
/// The standard CSS you should include on all Ignite pages.
public static let standardCSS = MetaLink(href: "/css/bootstrap.min.css", rel: "stylesheet")

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Elements/MetaTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// An item of metadata that helps browsers and search engines understand
/// your page better.
public struct MetaTag: HeadElement {
public struct MetaTag: HeadElement, Sendable {
/// Allows mobile browsers to scale this page appropriately for the device.
public static let flexibleViewport = MetaTag(name: "viewport", content: "width=device-width, initial-scale=1")

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Framework/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// One event that can trigger a series of actions, such as
/// an onClick event hiding an element on the page.
struct Event {
struct Event: Sendable {
var name: String
var actions: [Action]
}
6 changes: 3 additions & 3 deletions Sources/Ignite/Framework/FeedConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import Foundation

/// Configures feed generation for a site.
public struct FeedConfiguration {
public struct FeedConfiguration: Sendable {
/// How much content should be provided in this feed.
public enum ContentMode {
public enum ContentMode: Sendable {
/// Disable the feed entirely.
case disabled

Expand All @@ -23,7 +23,7 @@ public struct FeedConfiguration {

/// Configures an image to be used with your feed, to customize its
/// appearance in feed readers.
public struct FeedImage {
public struct FeedImage: Sendable {
/// The URL to your feed image.
var url: String

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Framework/UnitPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

// An x/y coordinate in the ranges 0 through 1.
public struct UnitPoint {
public struct UnitPoint: Sendable {
var x: Double // swiftlint:disable:this identifier_name
var y: Double // swiftlint:disable:this identifier_name

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Ignite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public struct Ignite {
public static var bundle: Bundle { Bundle.module }

/// The current version. Used to write generator information.
public static var version = "Ignite v0.1.0"
public static let version = "Ignite v0.2.1"
}
4 changes: 2 additions & 2 deletions Sources/Ignite/Modifiers/Cursor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import Foundation
public enum Cursor: String {
/// The cursor to display based on the current context. E.g., equivalent to text when hovering text.
case auto

/// Default cursor. Typically an arrow.
case `default`

/// No cursor is rendered.
case pointer

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Modifiers/HoverEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public struct EmptyHoverEffect: PageElement {
public func render(context: PublishingContext) -> String {
""
}

public var attributes = CoreAttributes()
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Rendering/AttributeValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/// A simple key-value pair of strings that is able to store custom attributes.
public struct AttributeValue {
public struct AttributeValue: Sendable {
/// The attribute's name, e.g. "target" or "rel".
var name: String

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Styles/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
/// Colors that can be used for backgrounds and foregrounds. Comes with all
/// the standard HTML color names, can be created using RGB values as
/// integer or doubles, can be created a grayscale, or using a hex string.
public struct Color: CustomStringConvertible {
public struct Color: CustomStringConvertible, Sendable {
/// The CSS representation of this color.
public var description: String {
"rgb(\(red) \(green) \(blue) / \(opacity)%)"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Styles/CoreAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// A handful of attributes that all HTML types must support, either for
/// rendering or for publishing purposes.
public struct CoreAttributes {
public struct CoreAttributes: Sendable {
/// A unique identifier. Can be empty.
var id = ""

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Styles/DiagonalEdge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// Describes diagonal edges on an element, e.g. top-leading, or bottom-trailing, along
/// with groups of edges such as "top" (top leading *and* top-trailing).
public struct DiagonalEdge: OptionSet {
public struct DiagonalEdge: OptionSet, Sendable {
/// The internal value used to represent this edge.
public let rawValue: Int

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Styles/Edge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// Describes edges on an element, e.g. top or leading, along
/// with groups of edges such as "horizontal" (leading *and* trailing).
public struct Edge: OptionSet {
public struct Edge: OptionSet, Sendable {
/// The internal value used to represent this edge.
public let rawValue: Int

Expand Down

0 comments on commit ea9708d

Please sign in to comment.