Releases: pespinel/RAWGKit
Releases · pespinel/RAWGKit
v3.3
Added
- Security scanning in CI/CD pipeline
- Gitleaks for secret detection and API key exposure prevention
- Runs automatically on all pull requests and main branch pushes
- CodeQL for Swift code security analysis (manual trigger only)
- Quality gates for code standards enforcement
- All PRs must pass SwiftLint strict mode
- All PRs must pass SwiftFormat validation
- All tests must pass on macOS
- Code coverage must be successfully generated
- Consolidated quality gate job validates all checks
- Comprehensive DocC documentation catalog
- Main landing page with topics organization
- Getting Started guide with installation and basic usage
- SwiftUI Integration guide with ViewModels and components
- Advanced Features guide covering query builder and pagination
- Security guide for API keys, certificate pinning, and TLS enforcement
- Performance guide with optimization techniques and best practices
- GitHub Pages documentation hosting
- Automatic documentation generation using xcodebuild docbuild
- Deployed to gh-pages branch on every push to main
- Static hosting at https://pespinel.github.io/RAWGKit/
- Uses peaceiris/actions-gh-pages for clean deployment
- Proper path handling for subdirectory hosting with /RAWGKit/ base path
Fixed
- iOS 15 compatibility in tests by using
Task.sleep(nanoseconds:)instead ofTask.sleep(for:) - DocC documentation paths for GitHub Pages subdirectory hosting
What's Changed
- chore(deps): bump actions/checkout from 4 to 6 by @dependabot[bot] in #3
- chore(deps): bump swift-actions/setup-swift from 2 to 3 by @dependabot[bot] in #2
- chore(deps): bump softprops/action-gh-release from 1 to 2 by @dependabot[bot] in #1
New Contributors
- @dependabot[bot] made their first contribution in #3
Full Changelog: v3.2...v3.3
v3.2
Added
- Certificate pinning for enhanced network security
CertificatePinningactor for SSL/TLS certificate validationCertificatePinningDelegatefor URLSession integration- Domain-based public key pinning with SHA-256 hashes
- Strict and non-strict validation modes
- 12 comprehensive unit tests for certificate pinning
NetworkManagingprotocol for dependency injection- Protocol abstraction enabling mock implementations for testing
- RAWGClient now accepts custom network managers
- Default extension providing convenience methods
MockNetworkManagerfor comprehensive testing- Full NetworkManaging protocol implementation for testing
- Pre-configured responses for specific URLs
- Error injection for error handling tests
- Call verification and tracking
- Customizable network delays simulation
- 15 comprehensive unit tests demonstrating usage
Changed
CacheManagerrefactored to pure actor architecture- Removed manual locking (NSLock) in favor of actor isolation
- All cache operations now use async/await
- Thread-safe by design with Swift 6.0 strict concurrency
- Removed old incomplete MockNetworkManager from RAWGClientTests
- Replaced with comprehensive MockNetworkManager in Mocks/ directory
- Refactored RAWGClient tests into 7 focused modules for better organization
- Split 571-line file into modular test suites
- Each suite focuses on specific functionality (initialization, games, resources, errors, validation, cache, multiple calls)
- Improved test maintainability and compliance with SwiftLint
- Enhanced MockNetworkManager with flexible URL matching
- Order-independent query parameter comparison
- Automatic fallback to component-based matching when exact match fails
- Updated test count from 389 to 421 passing tests
- Added 11 SwiftUI compilation tests
- Tests verify component compilation on supported platforms
- Workaround for Swift Testing @available limitations using MainActor.run
- Comprehensive UI testing conducted through RAWGKitDemo app
- Tests cover GameImageView, RatingBadgeView, GameRowView, and View+Loading extensions
Security
- TLS version enforcement (TLS 1.2+ only)
- NetworkManager now enforces minimum TLS 1.2, maximum TLS 1.3
- Rejects connections using deprecated TLS 1.0/1.1
- Mitigates protocol downgrade attacks
- Enhanced network security with certificate pinning
- Prevents man-in-the-middle attacks
- Validates server certificates against pinned public keys
- Optional feature with flexible configuration
Full Changelog: v3.1...v3.2
v3.1
Added
- Secure Keychain storage for API keys
KeychainManageractor for thread-safe secure storage- iOS Keychain integration for encrypted API key storage
RAWGClient.initWithKeychain()for Keychain-based initializationRAWGClient.saveAPIKeyToKeychain()andRAWGClient.deleteAPIKeyFromKeychain()convenience methods- Comprehensive error handling with
KeychainErrorenum - 14 unit tests for Keychain operations (save, load, delete, error handling, concurrency)
- Comprehensive input validation system
InputValidatorutility with 9 validation methods- Protection against injection attacks, parameter pollution, and malformed requests
- Validation for search queries, page numbers, resource IDs, slugs, dates, and more
- 66 unit tests covering all validation scenarios and edge cases
- Integration with 35+ RAWGClient API methods
- Codecov integration for code coverage tracking
- Automatic coverage report uploads to Codecov
- Coverage badges available for README
- Coverage trending and PR comments
- 5 performance benchmark tests validating SDK performance
- Cache operations < 5ms
- Memory cache efficiency with 100 entries < 1ms average
- Retry policy backoff timing validation
- Pagination memory efficiency verification
- Cache statistics calculation < 10ms
Changed
- CI workflow improvements
- Added dependency caching for Swift packages (40-60% faster builds)
- Cached
.builddirectory and Swift package manager cache - Cache key based on
Package.resolvedhash
- Updated README
- Added Codecov badge
- Updated test count from 254 to 389 passing tests
- Swift 6.0+ badge and requirements
- Enhanced SwiftUI integration section
- Replaced Discussions link with Feature Requests
Security
- API keys now stored securely in iOS Keychain instead of plaintext
- Sanitized production logging to prevent sensitive data exposure
- Detailed request/response logging only in DEBUG builds
- Production logs show generic messages only
- Resolves CWE-532 (Information Exposure Through Log Files)
- Input validation prevents injection attacks and parameter pollution
- Resolves CWE-20 (Improper Input Validation)
- XSS prevention in search queries
- SQL injection protection in parameters
Fixed
- Swift Testing warnings by using
Bool(true)in completion tests forclearCache()andcancelAllRequests() - Race conditions in Keychain tests with serialized test execution
Full Changelog: v3.0...v3.1
v3.0
Added
- 101 new unit tests for improved code coverage
- 32 tests for
RAWGClient(initialization, URL building, method signatures, cache control) - 13 tests for
NetworkManager(edge cases, initialization variants, cache management) - 7 tests for
GamesViewModel(state management, pagination, search, filters) - 53 tests for
RAWGEndpoint(all endpoint paths, edge cases with IDs) - 14 tests for GameContent models (Achievement, Screenshot, Movie, GameStore, etc.)
- Total tests: 254 (was 153)
- 32 tests for
- Comprehensive DocC documentation for all public types, properties, and methods
- Detailed documentation for all model structs (Game, GameDetails, Genres, Platforms, etc.)
- Complete API documentation for RAWGClient with usage examples
- Documentation for all type aliases in Alias.swift
Hashableconformance to all primary models for SwiftUI performance optimizations- Core models:
Game,GameDetail,RAWGResponse - Resources:
Developer,Publisher,GenreDetails,PlatformDetails,DeveloperDetails,PublisherDetails,StoreDetails,TagDetails,CreatorDetails - GameContent:
Achievement,Screenshot,Clip,Clips,Movie,MovieData,RedditPost,GameStore,ScreenshotsResponse - Metadata:
Rating
- Core models:
GamesViewModel- SwiftUI-ready ViewModel with state management- ObservableObject with @published properties for automatic UI updates
- Pagination support with
loadMore()andcanLoadMoreproperty - Search with 300ms debouncing
- Filter support for platforms, genres, and ordering
- Structured error handling with retry support
- Compatible with iOS 15+, macOS 13+
- SwiftUI components and extensions
GameImageView- Async image view with placeholder and error handlingGameRowView- Reusable list row component for gamesRatingBadgeView- Color-coded rating badge viewView+Loadingextensions -.showLoading(),.showError(),.showEmptyState()modifiers- All components compatible with iOS 15+, macOS 13+, tvOS 15+, watchOS 8+
- Complete SwiftUI demo app (RAWGKitDemo)
- Full iOS app demonstrating RAWGKit integration
- Game list with search, filters, and infinite scrolling
- Platform and genre filter selection
- Pull-to-refresh and error handling
- Secure configuration with xcconfig files
- Screenshots and comprehensive setup guide
- iOS 15+ compatible with NavigationView and async/await
- Platform and Genre popular constants for improved developer experience
Platform.Popularnamespace with 10 commonly-used platforms (PC, PlayStation, Xbox, Nintendo, mobile, desktop)Genre.Popularnamespace with 13 popular genres (Action, RPG, Strategy, etc.)- Each constant includes official RAWG API IDs
.allarrays for iteration in UI filters- Replaces arcaic tuple-based approach with type-safe constants
- Query builder convenience methods and extensions
platformsPopular(_:)- Filter by Platform.Popular constantsgenresPopular(_:)- Filter by Genre.Popular constants- Static factory methods for common queries:
.popularGames()- Popular recent releases (30 days, metacritic 75+).newReleases()- Games from last 7 days.upcomingGames()- Upcoming releases (next 180 days).topRated()- Highest-rated games (metacritic 90+).thisYear()- Current year releases.trending()- Trending games (60 days, metacritic 70+)
- RAWGClient convenience methods for quick access
fetchPopularGames()- Direct access to popular gamesfetchNewReleases()- Quick access to new releasesfetchUpcomingGames()- Fetch upcoming games easilyfetchTopRated()- Fetch top-rated gamesfetchThisYear()- Fetch games from current yearfetchTrendingGames()- Fetch trending gamesfetchTopRated()- Get top-rated gamesfetchThisYear()- Current year releasesfetchTrendingGames()- Trending games shortcut
Changed
- Reorganized test structure to mirror Sources/ organization
- Tests now organized in Unit/ (Core/, Networking/, Extensions/) and Integration/ subdirectories
- Improved test discoverability and maintenance
- All primary models now conform to
Hashablefor better SwiftUI List and Set performance - Enhanced SwiftUI compatibility across all data models
- Demo app now uses
Platform.PopularandGenre.Popularconstants instead of hardcoded tuples - Query builder now supports fluent chaining with Platform.Popular and Genre.Popular constants
- All convenience queries support method chaining for customization
Fixed
- Swift 6.0.3 compiler compatibility
- Added
-Xfrontend -disable-round-trip-debug-typesflag to work around Swift 6.0.3 compiler crash with SwiftUI debug types - Replaced
.foregroundStyle()with.foregroundColor()for better compatibility - Simplified GameImageView structure
- Added
Full Changelog: v2.1...v3.0
v2.1
Added
- GitHub issue templates (bug report, feature request, documentation)
- Pull request template with comprehensive checklist
- Coverage reporting in CI pipeline with lcov generation
- Centralized constants in
RAWGConstantsfor API limits, cache settings, and network timeouts - Structured logging with
os.LoggerthroughRAWGLogger - Request deduplication in NetworkManager to prevent duplicate concurrent requests
- Comprehensive DocC documentation for all public APIs
cancelAllRequests()method in NetworkManager for canceling all active network tasks
Changed
- NetworkManager refactored with extracted helper methods for improved maintainability
- README enhanced with badges, requirements section, expanded features, and architecture details
Improved
- Better code organization through centralized constants
- Enhanced debugging with structured logging replacing print statements
- Improved performance through request deduplication
- Better developer experience with comprehensive API documentation
Full Changelog: v2.0...v2.1
v2.0
Added
- visionOS support
- Makefile for development workflow (
make setup,make test,make lint, etc.) - Configurable request timeout in NetworkManager
- Task cancellation support for AsyncSequences
- New AsyncSequences for all resources:
developersSequence()- Stream developers with automatic paginationpublishersSequence()- Stream publishers with automatic paginationstoresSequence()- Stream stores with automatic paginationtagsSequence()- Stream tags with automatic paginationcreatorsSequence()- Stream creators with automatic pagination
- Type-safe query filters with enums for better DX:
KnownPlatform- PC, PlayStation, Xbox, Nintendo, mobile platformsKnownParentPlatform- Platform categories (PlayStation, Xbox, Nintendo, etc.)KnownGenre- Action, RPG, Adventure, Shooter, and moreKnownStore- Steam, Epic Games, PlayStation Store, Nintendo Store, etc.GameOrdering- Type-safe ordering options
- Date helpers in GamesQueryBuilder:
releasedThisYear()- Filter games from current yearreleasedBetween(from:to:)- Filter by date range with Date objectsreleasedAfter(_:)/releasedBefore(_:)- Filter by single datereleasedInLast(days:)- Filter games from last N daysupdatedBetween(from:to:)- Filter by update date range
metacritic(min:max:)- Type-safe Metacritic range filter with clamping- Twitch and YouTube endpoints:
fetchGameTwitchStreams(id:)- Get Twitch streams for a gamefetchGameYouTubeVideos(id:)- Get YouTube videos for a game- New models:
TwitchStream,YouTubeVideo,YouTubeThumbnails
Changed
- NetworkManager now accepts custom URLSession for testing
- Removed unused SwiftLint/SwiftFormat SPM dependencies (use CLI instead)
- AsyncSequences refactored to use generic helper, reducing code duplication
- Enabled StrictConcurrency experimental feature
- CacheManager refactored to use NSCache:
- Automatic memory eviction under system pressure
- Configurable
countLimit(default: 100 entries) - Configurable
totalCostLimit(default: 10MB) - Uses data size as cost for intelligent eviction
- Maintains TTL support via wrapper class
- Test count increased to 103 (was 77)
Removed
- Unused
ResourceProtocol.swiftwith empty protocol definitions (dead code cleanup)
Fixed
- NetworkManager
sessionparameter was being ignored - Unnecessary URLCache configuration removed (we use CacheManager)
Documentation
- Updated README with improved development setup instructions
- Added
make setupfor one-command dev environment setup - Added documentation for type-safe query filters
- Added documentation for AsyncSequences and caching
Full Changelog: v1.2...v2.0
v1.2
Added
- Public API for cache control in RAWGClient
clearCache()- Clear all cached responsescacheStats()- Get cache statisticscacheEnabledparameter in init to enable/disable caching
- Retry logic with exponential backoff
RetryPolicyfor configuring retry behavior- Automatic retry for transient errors (timeout, no internet, 5xx)
- Configurable max retries, delays, and backoff strategy
- AsyncSequence support for infinite pagination
gamesSequence()- Stream games with automatic paginationgenresSequence()- Stream genres with automatic paginationplatformsSequence()- Stream platforms with automatic pagination
- Comprehensive test coverage for new features
- CacheManager tests (7 tests)
- RAWGResponse extensions tests (12 tests)
- NetworkError tests (11 tests)
- RetryPolicy tests (20 tests)
- Total: 77 tests (was 35)
Changed
- Made CacheManager and CacheStats public for external access
- CacheStats now conforms to Sendable for thread-safety
Full Changelog: v1.1...v1.2
v1.1
Added
- In-memory caching system for API responses
- Configurable TTL (default 5 minutes)
- Cache statistics and management methods
- Automatic cache invalidation
- RAWGResponse extensions for better pagination support
currentPage- Calculate current page numberhasPreviousPage- Check for previous pageestimatedTotalPages- Estimate total pagesprogress- Progress through results (0.0-1.0)
- Resource protocols for common model patterns
BasicResource- Base protocol with id, name, slugImageResource- Includes image backgroundGameCountResource- Includes games countDetailedResource- Includes description and details
Changed
- Reorganized Models folder into semantic subcategories
Core/- Main models (Game, GameDetail, RAWGResponse)Resources/- API resources (Genre, Platform, Store, etc.)GameContent/- Game-related content (Achievement, Screenshot, etc.)Metadata/- Metadata and classifications (Rating, ESRBRating, etc.)Protocols/- Shared protocols
- Enhanced NetworkError with more specific cases
.notFound- 404 errors.rateLimitExceeded(retryAfter:)- Rate limiting with retry info.noInternetConnection- Connection errors.timeout- Request timeout.unknown(Error)- Unexpected errors
- NetworkManager now handles rate limiting (429) with Retry-After header
- Improved error messages with recovery suggestions
Improved
- Better code organization and maintainability
- Reduced API calls through caching
- Enhanced error handling and user feedback
- Clearer model organization
Full Changelog: v1.0...v1.1
v1.0
Added
- Complete SDK for RAWG Video Games Database API
- 30+ endpoints covering all major API resources
- Type-safe models with Codable and Sendable support
- Fluent query builder for complex game searches
- Actor-based networking for thread-safety
- Comprehensive error handling
- Support for iOS 15+, macOS 13+, watchOS 8+, tvOS 15+
- 35 tests with Swift Testing framework (100% passing)
- SwiftLint integration for code quality
- SwiftFormat integration for consistent formatting
- CI/CD workflows for automated testing and releases
- Extensive documentation and examples
Core Client
RAWGClientwith async/await support- Automatic API key injection
- Proper error handling with typed errors
Endpoints
- Games: list, details, screenshots, achievements, movies, reddit posts, DLC, series, parent games, development team
- Genres: list and details
- Platforms: list, details, and parent platforms
- Developers: list and details
- Publishers: list and details
- Stores: list and details
- Tags: list and details
- Creators: list, details, and roles
Models
Game- Game informationGameDetails- Extended game detailsGenre- Genre informationPlatform- Platform informationStore- Store informationCreator- Creator informationAchievement- Game achievementsMovie- Game trailers/videosRedditPost- Reddit discussionsRAWGResponse<T>- Generic paginated response wrapper
Developer Tools
- SwiftLint for code style enforcement
- SwiftFormat for automatic code formatting
- CI workflow with linting, formatting, and testing
- Release workflow with automatic GitHub releases