Releases: diegotl/MattermostKit
Releases · diegotl/MattermostKit
v0.0.2 - Result Builder API
🎨 Result Builder API
This release introduces a Swifty result builder API for constructing Mattermost messages declaratively, making the code more readable and maintainable.
✨ Features
- Result Builder Syntax: Build messages, attachments, and props using a clean, declarative syntax
- Type-Safe Builders: Compile-time safety with Swift 6 strict concurrency
- Fluent API: Chain properties naturally with intuitive naming
- Comprehensive: Covers all message components including text, username, icon, attachments, fields, actions, confirmations, props, and priority
📝 Example
let message = Message {
"Deployment completed successfully 🚀"
Username("DeployBot")
IconEmoji(":rocket:")
Attachment {
"Good news! Your deployment is complete."
Color("#36a64f")
Field("Environment", "production")
Field("Duration", "2m 15s")
Field("Status", "Success").short()
Action("View Logs", "https://example.com/logs").primary()
Action("Rollback", "https://example.com/rollback").danger()
}
}🧪 Testing
- New comprehensive integration tests
- Result builder test coverage for all components
- Verified against actual Mattermost webhook responses
📦 What's Changed
- Add
Message+Builder.swift- Result builder for messages - Add
Attachment+Builder.swift- Result builder for attachments - Add
Confirmation+Builder.swift- Result builder for action confirmations - Add
Props+Builder.swift- Result builder for Mattermost props - Add
AttachmentBuilderTests.swift- Unit tests for attachment builders - Add
MattermostKitIntegrationTests.swift- Full integration test suite - Update README with result builder examples
Swift Version: 6.2+
Platforms: macOS 12.0+, iOS 15.0+, tvOS 15.0+, watchOS 8.0+
v0.0.1
MattermostKit v0.0.1 First release of MattermostKit - Swift 6 package for sending messages to Mattermost via Incoming Webhooks. Features: - Full support for Mattermost Incoming Webhooks - Slack-compatible attachments - Mattermost-specific features (props.card, priority) - Swift 6 strict concurrency - Zero dependencies - Comprehensive test coverage (13 tests)