// swift-tools-version: 5.9 import PackageDescription // The platform-neutral core shared by the iOS app, the native Mac app, and the // notification extension: crypto (the native twin of web/static/crypto.js), // models, the REST client, and the thread-list store. No UIKit/AppKit imports — // anything platform-specific stays in the app targets. See docs/native-chat.md. let package = Package( name: "LChatCore", platforms: [.iOS(.v17), .macOS(.v14)], products: [ .library(name: "LChatCore", targets: ["LChatCore"]) ], dependencies: [ // The native half of the twin-parsed CommonMark subset (#531): // cmark-gfm via swift-markdown, walked with the same allowlist as // web/static/markdown.js and held to the same vectors // (Fixtures/markdown-vector.json). Exact pin — like Sparkle in // project.yml — so the twins only ever bump deliberately. .package(url: "https://github.com/swiftlang/swift-markdown.git", exact: "0.8.0") ], targets: [ // Flows/ carries the conversation scripts (byte-derived copies of // web/static/apps/*.flow.js, drift-gated by test/flow.test.mjs). // Schemas/ carries the app-schema JSON (byte-identical copies of the // canonical web/static/apps/schemas/, drift-gated by // test/schema-engine.test.mjs). .target( name: "LChatCore", dependencies: [.product(name: "Markdown", package: "swift-markdown")], resources: [.copy("Flows"), .copy("Icons"), .copy("Schemas"), .copy("Marks"), .copy("Seed")] ), // The cross-implementation drift gates (fixtures generated by the web // crypto — see test/threadkey.test.mjs). `swift test` runs them natively // on the Mac, no simulator needed. .testTarget( name: "LChatCoreTests", dependencies: ["LChatCore"], resources: [.copy("Fixtures")] ), ] )