| 1 | // swift-tools-version: 5.9 |
| 2 | import PackageDescription |
| 3 | |
| 4 | // The platform-neutral core shared by the iOS app, the native Mac app, and the |
| 5 | // notification extension: crypto (the native twin of web/static/crypto.js), |
| 6 | // models, the REST client, and the thread-list store. No UIKit/AppKit imports — |
| 7 | // anything platform-specific stays in the app targets. See docs/native-chat.md. |
| 8 | let package = Package( |
| 9 | name: "LChatCore", |
| 10 | platforms: [.iOS(.v17), .macOS(.v14)], |
| 11 | products: [ |
| 12 | .library(name: "LChatCore", targets: ["LChatCore"]) |
| 13 | ], |
| 14 | dependencies: [ |
| 15 | // The native half of the twin-parsed CommonMark subset (#531): |
| 16 | // cmark-gfm via swift-markdown, walked with the same allowlist as |
| 17 | // web/static/markdown.js and held to the same vectors |
| 18 | // (Fixtures/markdown-vector.json). Exact pin — like Sparkle in |
| 19 | // project.yml — so the twins only ever bump deliberately. |
| 20 | .package(url: "https://github.com/swiftlang/swift-markdown.git", exact: "0.8.0") |
| 21 | ], |
| 22 | targets: [ |
| 23 | // Flows/ carries the conversation scripts (byte-derived copies of |
| 24 | // web/static/apps/*.flow.js, drift-gated by test/flow.test.mjs). |
| 25 | // Schemas/ carries the app-schema JSON (byte-identical copies of the |
| 26 | // canonical web/static/apps/schemas/, drift-gated by |
| 27 | // test/schema-engine.test.mjs). |
| 28 | .target( |
| 29 | name: "LChatCore", |
| 30 | dependencies: [.product(name: "Markdown", package: "swift-markdown")], |
| 31 | resources: [.copy("Flows"), .copy("Icons"), .copy("Schemas"), .copy("Marks"), .copy("Seed")] |
| 32 | ), |
| 33 | // The cross-implementation drift gates (fixtures generated by the web |
| 34 | // crypto — see test/threadkey.test.mjs). `swift test` runs them natively |
| 35 | // on the Mac, no simulator needed. |
| 36 | .testTarget( |
| 37 | name: "LChatCoreTests", |
| 38 | dependencies: ["LChatCore"], |
| 39 | resources: [.copy("Fixtures")] |
| 40 | ), |
| 41 | ] |
| 42 | ) |
| 43 | |