arm1.ru

Tag: «swift package»

Swift Adwaita 1.1.0

event Apr 10, 2026 at 08:56

Swift Adwaita

Swift Adwaita 1.1.0 has been released. I’ve been working on a first app built with this library, so I’ve extended it and fixed some bugs.

Highlights

  • Added GtkSourceView integration with typed Swift wrappers for source editing, syntax highlighting, languages, and style schemes.
  • Expanded widget APIs around popovers, windows, calendar compatibility, and runtime lifecycle handling.
  • Improved release stability with better GLib main-loop integration, broader CI coverage, and additional regression tests.

Added

  • SourceView, SourceBuffer, SourceLanguage, SourceLanguageManager, SourceStyleScheme, and SourceStyleSchemeManager.
  • Typed identifiers for GtkSource languages and style schemes.
  • A new source editor demo example.
  • MainContext.task { ... }, task(after:), and task(every:) as cancellable GLib main-loop work handles.
  • Async MainContext.run, yield, and sleep(for:) helpers for bridging Swift concurrency onto the GLib loop safely.
  • Widget.unparent() and PopoverMenu.unparent().
  • Convenience presentation helpers for Popover and PopoverMenu.
  • Additional regression tests for widget/window parent-chain lookup and expanded coverage for source editing and media behavior.

Changed

  • GtkWindow.present() now retains windows until close, making transient or locally scoped windows safer to use.
  • Widget.window now resolves the containing window through the widget parent chain instead of assuming the GTK root is always a window.
  • Calendar date handling now uses a GTK compatibility shim so the package builds cleanly across older and newer GTK versions.
  • Documentation generation and hosted docs configuration were updated.
  • CI now installs and tests with GtkSourceView 5 system dependencies.

Fixed

  • Fixed deferred signal/user-data cleanup to release captured closures through the GLib main loop instead of Swift main-queue tasks, avoiding lifecycle issues in GTK applications.
  • Fixed a common GTK scheduling pitfall by offering a Task-like API that stays on the GLib main loop instead of DispatchQueue.main.
  • Fixed Swift 6.1 serialized suite visibility issues in the test suite.
  • Fixed the popover/window regression tests to avoid GTK crash paths in CI while still validating the intended behavior.
  • Fixed release documentation and installation instructions to include GtkSourceView 5 development packages.

Documentation and CI

  • Added an API documentation link to the README.
  • Updated installation instructions for Ubuntu/Debian and Fedora.
  • Improved inline documentation consistency across the wrapper API.
  • Extended CI coverage for documentation, formatting, and Swift 6.1 / 6.2 / 6.3 test runs.

This is an open-source project licensed under the MIT license. The source code is available on GitHub. Documentation with guides is available here.

Star Fork

Swift Adwaita library

event Mar 31, 2026 at 17:43

Swift Adwaita

A project that I’ve always wanted to create: a library that enables the development of GNOME applications using Swift. While there are some similar libraries available, they appear to be incomplete or not actively maintained. Thanks to Vibe Coding, I managed to complete the project in approximately a week.

swift-adwaita is an imperative Swift 6 wrapper for GTK4 and libadwaita, built for creating native GNOME desktop applications on Linux.

It provides a modern Swift API over GTK and Adwaita with type-safe widgets, signals, property bindings, async operations, and ergonomic convenience helpers, while preserving the native behavior, styling, and feel of the GNOME platform.

  • Native GTK4 and libadwaita application development in Swift
  • Imperative API without a custom DSL
  • Type-safe enums, signals, and property APIs
  • Async/await support for common platform integrations
  • Extensive widget coverage with a real demo application

Here’s a demo app built using swift-adwaita:

This is an open-source project licensed under the MIT license. The source code is available on GitHub. Documentation with guides is available here.

Star Fork

CouchDB client for Swift 2.4.0

event Mar 28, 2026 at 20:36

Highlights

  • Refactored the internal request pipeline in CouchDBClient to use cleaner async/await-style flows and reduce duplicated response handling logic.
  • Improved buffering and decoding paths for raw and typed requests, with a focus on safer EventLoopGroup execution and better performance in response processing.
  • Expanded test coverage around EventLoopGroup-backed request execution, including raw and typed get, raw and typed find, attachment download, Mango index listing, and Mango query explanation.
  • Refreshed user-facing documentation across the README, DocC articles, and tutorials.
  • Updated documentation tooling for newer DocC workflows, including Markdown export support.

API and Behavior Improvements

  • Added and refined EventLoopGroup support across more CouchDBClient request paths.
  • Improved internal error-handling paths and response decoding behavior for CouchDB operations.
  • Simplified request helper layering and reduced duplicated request/response processing code.
  • Improved attachment-related behavior and accompanying tests.
  • Added visionOS to supported platforms in the package manifest.

Documentation

  • Fixed and refreshed README examples for CRUD and Mango query usage.
  • Updated DocC landing pages to better reflect the current API surface.
  • Corrected the Advanced Mango Query tutorial snippets to match the current typed query API.
  • Corrected Vapor tutorial examples.
  • Fixed Hummingbird tutorial package setup and dependency snippets.
  • Updated buildDocs.sh to support:
    • configurable output and hosting base path
    • static hosting content embedding
    • experimental Markdown output
    • Markdown manifest generation
  • Added a post-processing step in buildDocs.sh that injects a relative Markdown link into generated DocC HTML pages.

Tooling and Dependencies

  • Updated package dependencies in Package.resolved.
  • Updated the Ubuntu build workflow Swift version matrix.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Star Fork

CouchDB client for Swift 2.3.0

event Aug 1, 2025 at 19:25

CouchDB client for Swift 2.3.0

Recently, I've implemented a feature that I wanted to add to the CouchDB Swift client for a long time. It's Mango Queries support. Finally, it is done in 2.3.0. Feels like the last remaining big feature.

Changelog:

  • Introduced a robust and type-safe MangoQuery API for building complex selectors, projections, sorting, and pagination in CouchDB.
  • Added support for specifying indexes via useIndex in queries to optimize performance.
  • Added first-class support for uploading, downloading, and deleting document attachments (files/images).
  • Comprehensive Attachments API test suite ensures reliability for file operations.
  • Added models and API for creating, listing, and managing Mango indexes (MangoIndex, IndexDefinition).
  • Tutorial and code samples for creating indexes are now included in documentation.
  • Added support for CouchDB Mango _explain endpoint via MangoExplainResponse to inspect how queries are executed and which indexes are used.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Star Fork

CouchDB client for Swift version 2

event Apr 16, 2025 at 09:48

CouchDB client for Swift version 2

Recently, I’ve released a few new versions of the CouchDB client for Swift. The latest version is version 2, and it includes several key changes:

  • Updated the minimum required Swift tools version to 6.0.
  • Adopted Swift Concurrency. CouchDBClient has been updated to be an actor.
  • Renamed the library from couchdb-vapor to couchdb-swift to better reflect its purpose as a general CouchDB client for Swift, beyond Vapor-specific use cases.
  • Made some changes to the initializer. Instead of passing a lot of parameters, it now accepts a Config structure.
  • You can pass your own HTTPClient instance to be used in the client.
  • Added translations for error messages.
  • Introduced a dedicated tutorial for integrating CouchDBClient with the Hummingbird server-side framework.
  • Added a shutdown() method to properly release resources associated with the HTTPClient.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Star Fork

Swift CouchDB client 1.5.0

event Apr 8, 2024 at 21:27

Swift CouchDB client 1.5.0

And here we go, one more new version of the CouchDB client library. After the recent post about 1.4.0, Swift on Server released a new version of async-http-client that includes a new implementation of the client singleton. Now it's HTTPClient.shared, so I've updated the CouchDB library to adopt that change. This also means that you no longer need to call httpClient.syncShutdown() if the singleton is used. Additionally, they've bumped the minimum Swift version to 5.8 (which I aslo did in version 1.4.0 of the CouchDB client library). So, I'm keeping the library up to date.

Changelog:

  • Bumped the minimum version of async-http-client to the new 1.21.0. If you can't use it in your project, you can still stay on 1.4.0.
  • The library will now use HTTPClient.shared (new in async-http-client 1.21.0) internally for requests if no EventLoopGroup is provided.
  • No more internal calls for httpClient.syncShutdown() in case of HTTPClient.shared usage.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Swift CouchDB client 1.4.0

event Apr 8, 2024 at 11:11

Swift CouchDB client

A new version of CouchDB Client has been released:

  • The library migrated from HTTPClient.Response to HTTPClientResponse, which is similar to HTTPClient.Response but used for the Swift Concurrency API. It also migrated from HTTPClient.Body to HTTPClientRequest.Body. These changes impact the get and find methods. Old methods are marked as deprecated, please refer to the documentation for the updated methods.
  • The minimum Swift version is now 5.8.
  • The CouchDBRepresentable protocol is now marked as Codable.
  • Additionally, a new data model called RowsResponse has been added. It accepts a generic CouchDBRepresentable type, making it easier to retrieve rows from a database. For example:
    let decodeResponse = try JSONDecoder().decode(RowsResponse<MyApp>.self, from: data)
  • Lastly, there have been small improvements in the documentation and tutorials.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Swift CouchDB client 1.3.2

event Mar 29, 2024 at 22:27

Swift CouchDB client

Recently, there have been a couple of new releases for my Swift CouchDB library. Here are the recent changes:

  • dateDecodingStrategy and dateEncodingStrategy can now be passed as parameters for get, update and insert methods.
  • Added a check to handle expired authentication cookies.
  • Comparing the set-cookie header in the response as lowercased.
  • Introduced new methods to utilize the _find API, allowing you to find documents using a declarative JSON querying syntax
  • Fixed an issue where the update method didn’t use dateEncodingStrategy parameter.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Swift CouchDB client 1.2.1

event Dec 26, 2022 at 22:50

Swift CouchDB client 1.2.1

Just a small update for Swift CouchDB client lib with couple new methods that I needed by myself:

  • Added a new method to create a database [docs].
  • Added a new method to delete a database [docs].
  • Added a new method to check if a database exists [docs].
  • Every request handles unauthorised errors now.
  • CouchDBClientError model has a description text now.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Swift CouchDB client 1.2.0

event Oct 4, 2022 at 23:18

Swift CouchDB client 1.2.0

Couple months ago I started learning Apple's DocC tool that generates documentation from your source code. I've decided to use as many features as possible so I took my small lib CouchDB Client and added docs to every method including usage examples that Xcode will show in the autocomplete popup. As it often happens, during adding docs and examples I found that many things in the library can be done in a much better way. So I've updated existing methods and added some more that can take a doc as a param and use generic types.

Next step was tutorials. Apple allows devs to create exactly the same tutorials as they have for SwiftUI on their own website. So I've added a couple. They're also part of the repo on GitHub.

Pretty sure that I've spent more time on the documentation than on the lib itself but I hope it's worth it.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Swift CouchDB client 1.0.0

event Nov 30, 2020 at 17:46

Swift CouchDB client library

Finished new version of Swift CouchDB client. Now it's using only async-http-client as a dependency to make http/https requests. Can be used with Vapor 4.

Available on Github: https://github.com/makoni/couchdb-swift

Syntax sugar for JSON parsing in Swift

event Sep 23, 2019 at 22:43

JSON decoding and encoding became easy after adding Codable protocol in Swift 4.0. But during coding I wanted to have something shorter and more elegant than Do-Catch statement that looks like this:

var myModel: MyModel?
let decoder = JSONDecoder()

do {
    myModel = try decoder.decode(MyModel.self, from: data)
} catch {
    print(error.localizedDescription)
}

Or like this:

let myModel: MyModel? = try? decoder.decode(MyModel.self, from: data)

So I wrote a protocol with default implementation that allows to do decoding just like that:

let myModel = MyModel.decodeFromData(data: data)

And the same for encoding:

let data = MyModel.encode(fromEncodable: myModel)

All you need is just to add protocol conformance:

extension MyModel: Parseable {
    typealias ParseableType = Self
}

It's available on GitHub as a Swift Package: https://github.com/makoni/parsable