This document describes the dependencies used in the MiaoYan project and their migration from CocoaPods to Swift Package Manager.
The project now uses Swift Package Manager for all dependencies. The Package.swift file in the root directory documents all dependencies used by the Xcode project.
| Package | Version | Purpose |
|---|---|---|
| Sparkle | 2.7.1+ | Auto-update framework for macOS apps |
| AppCenter | 5.0.6+ | App analytics and crash reporting |
| Alamofire | 5.10.2+ | HTTP networking library |
| SwiftyJSON | 5.0.2+ | JSON parsing library |
| Highlightr | 2.3.0+ | Syntax highlighting for code blocks |
| ZipArchive | 2.6.0+ | ZIP file compression and decompression |
| swift-cmark-gfm | 1.0.2+ | GitHub Flavored Markdown parsing |
| MASShortcut | master | Global keyboard shortcuts for macOS |
The project was successfully migrated from CocoaPods to Swift Package Manager:
- ✅ Removed:
Podfile,Podfile.lock, and all CocoaPods configurations - ✅ Migrated: All dependencies to SPM equivalents
- ✅ Replaced:
libcmark_gfmwithswift-cmark-gfmfor better Swift integration - ✅ Fixed: Module naming conflicts and import issues
-
Markdown Parser: Replaced
libcmark_gfmwithswift-cmark-gfm// Old (libcmark_gfm) import libcmark_gfm // New (swift-cmark-gfm) import CMarkGFM // Usage remains similar with C API wrapper let html = renderMarkdownHTML(markdown: markdownContent)
-
ZIP Archive: Updated import statement
// Old import SSZipArchive // New import ZipArchive
-
AppCenter: Removed
AppCenterDistribute, keptAppCenterAnalyticsandAppCenterCrashes
open MiaoYan.xcodeproj
# Build using Xcode (⌘+B)The Package.swift file is primarily for documentation and dependency tracking. To work with dependencies:
# Show dependency tree
swift package show-dependencies
# Resolve dependencies (for reference)
swift package resolveNote: The actual app build uses the Xcode project, not the Package.swift file.
- In Xcode: File → Add Package Dependencies...
- Update Package.swift: Add the new dependency to the dependencies array for documentation
- In Xcode: File → Packages → Update to Latest Package Versions
- Update Package.swift: Update version numbers to match
- macOS: 11.5+ (Big Sur)
- Swift: 5.9+
- Xcode: 12.0+
- Module not found: Clean build folder (
⌘+Shift+K) and rebuild - Package resolution errors: Delete
Package.resolvedand resolve again - Duplicate dependencies: Check for conflicting SPM/CocoaPods remnants
For dependency-related issues, please check:
- MiaoYan Issues
- Individual package documentation
- Swift Package Manager documentation