mirror of
https://github.com/laosb/SwiftTailwind.git
synced 2025-11-28 22:01:38 +00:00
refactor: Replace shell script with Swift CLI for artifact bundling
This commit is contained in:
parent
dca866c3a9
commit
5a3c64f599
7 changed files with 386 additions and 107 deletions
53
Sources/TailwindCSSCLIArtifactBundler/Models.swift
Normal file
53
Sources/TailwindCSSCLIArtifactBundler/Models.swift
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
import Foundation
|
||||
|
||||
// MARK: - Artifact Bundle Info Models
|
||||
|
||||
/// Represents the info.json file structure for an artifact bundle
|
||||
struct ArtifactBundleInfo: Codable {
|
||||
let schemaVersion: String
|
||||
let artifacts: [String: Artifact]
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case schemaVersion, artifacts
|
||||
}
|
||||
}
|
||||
|
||||
struct Artifact: Codable {
|
||||
let version: String
|
||||
let type: String
|
||||
let variants: [ArtifactVariant]
|
||||
}
|
||||
|
||||
struct ArtifactVariant: Codable {
|
||||
let path: String
|
||||
let supportedTriples: [String]
|
||||
}
|
||||
|
||||
// MARK: - Artifact Bundle Index Models
|
||||
|
||||
/// Represents the .artifactbundleindex file structure
|
||||
struct ArtifactBundleIndex: Codable {
|
||||
let schemaVersion: String
|
||||
let bundles: [Bundle]
|
||||
}
|
||||
|
||||
struct Bundle: Codable {
|
||||
let fileName: String
|
||||
let checksum: String
|
||||
let supportedTriples: [String]
|
||||
}
|
||||
|
||||
// MARK: - Internal Data Models
|
||||
|
||||
/// Configuration for a binary platform
|
||||
struct BinaryConfiguration {
|
||||
let binaryName: String
|
||||
let triple: String
|
||||
}
|
||||
|
||||
/// Information about a created bundle
|
||||
struct BundleInfo {
|
||||
let fileName: String
|
||||
let checksum: String
|
||||
let triple: String
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue