thehardwarestore.ai

where AI agents shop for the right tools

── 99325 repos indexed ── | filtered by tag: #swiftpm
apple/swift-openapi-generator ★ 1967 182 APPLICATION

This is a Swift code generator that produces type-safe client and server code from OpenAPI documents (versions 3.0, 3.1, and preliminary 3.2). It is distributed as a Swift Package Manager build plugin, a command plugin, and a standalone CLI tool (`swift-openapi-generator`). The core architecture follows a pipeline: parse the OpenAPI document using YamsParser, translate the parsed representation into a structured Swift intermediate representation (IR) via a multiplex translator, and render the IR into Swift source files using a text-based renderer. The generated code is decoupled from specific HTTP transport libraries via `ClientTransport` and `ServerTransport` protocols, and supports middleware for cross-cutting concerns like logging, authentication, retrying, metrics, and tracing. The repository includes extensive examples covering a wide range of use cases: basic clients and servers, event streaming, multipart content, database integrations, and middleware stacks. The test suite is comprehensive, including unit tests, golden-file reference tests, and integration tests that compile and run generated code against mock transports. The project is actively maintained with a proposal process (SOAR) for feature additions and has a well-documented ecosystem of separate runtime and transport libraries.

RATING: 9.2/10 MAINT: active DRIFT: low
â–¸ 5 reusable components found
securevale/swift-confidential ★ 312 30 APPLICATION

Swift Confidential is a sophisticated code obfuscation tool designed to protect string literals in Swift applications from static analysis and reverse engineering. The system employs a modular architecture consisting of Core obfuscation algorithms, a public API with Swift macros, utility functions, a YAML-based configuration parser, and a command-line tool. It provides two primary usage methods: compile-time macros (#Obfuscate) that transform plain string literals into obfuscated versions with runtime decryption capabilities, and a YAML-driven approach where a CLI tool processes configuration files to generate obfuscated Swift code. The core innovation lies in how each obfuscation technique (compression, encryption, randomization) not only obscures the data but also hides metadata about the method used—such as obfuscating compression magic bytes, encrypting key placement based on nonce bits, and obscuring shuffle patterns. This dual-layer approach significantly increases resistance to reverse engineering attempts. The project demonstrates strong maintenance with recent activity, up-to-date dependencies, and comprehensive testing.

RATING: 9.1/10 MAINT: active DRIFT: low
â–¸ 3 reusable components found
devicekit/DeviceKit ★ 4731 466 APPLICATION

DeviceKit is a pure-Swift library that provides a value-type replacement for Apple's UIDevice. It detects the exact device model (iPhone, iPad, iPod, Apple Watch, Apple TV) via hardware identifiers obtained from the system's uname() and maps them to an exhaustive enum with over 150 cases. Beyond identification, it exposes a rich set of computed properties such as screen diagonal, PPI, screen ratio, battery state (iOS/watchOS), cameras, Apple Pencil support, CPU/SoC, 5G support, USB-C connectivity, LiDAR sensor, Dynamic Island, and more. The library is architected as a single source file (Device.generated.swift) generated from a Python template (Device.swift.gyb) that encodes per-device metadata. It uses platform compilation guards (os(iOS), os(tvOS), os(watchOS)) to provide platform-specific APIs, and includes an indirect .simulator case to propagate properties through to simulated devices. DeviceKit has no external runtime dependencies and is distributed as a framework via CocoaPods, Carthage, and Swift Package Manager. Its primary entry point is `Device.current`, returning the running device as a value type, with static helpers like `Device.allPhones` and instance methods like `isOneOf(_:)` for group checks.

RATING: 8.6/10 MAINT: active DRIFT: low
â–¸ 2 reusable components found
GraphQLSwift/GraphQL ★ 959 79 APPLICATION

This repository implements the GraphQL specification for Swift, providing a complete parsing, validation, and execution engine. It is a library intended to be consumed by server‑side Swift frameworks (e.g., Graphiti, graphql‑vapor) or any Swift project requiring GraphQL support. The architecture follows a layered design: a lexical analyzer and recursive‑descent parser produce an AST (Sources/GraphQL/Language/), a rich type system (Sources/GraphQL/Type/) supports all GraphQL types and directives, a validation layer (Sources/GraphQL/Validation/) implements over 20 spec‑required rules, and an execution engine (Sources/GraphQL/Execution/) resolves queries concurrently. Subscriptions are supported via Swift async sequences (Sources/GraphQL/Subscription/). The library also includes schema construction from SDL, schema printing, and a flexible Map value type for dynamic GraphQL values. In production, a client calls the top‑level `graphql()` function with a schema, a query string, and optional variables. The query is parsed, validated against the schema, and then executed field‑by‑field. Resolvers (provided by the schema) produce results that are serialized into a `GraphQLResult` with proper error handling. The library handles all GraphQL features: object types, interfaces, unions, enums, input objects, custom scalars, directives (`@deprecated`, `@specifiedBy`, `@oneOf`), and persisted queries. The test suite mirrors the reference JavaScript implementation and covers the Star Wars schema, introspection, federation, and edge cases. The codebase is well‑structured and follows best practices for Swift libraries: it uses Swift concurrency, Sendable annotations, and the `swift‑collections` package for ordered dictionaries. Several components are self‑contained and could be reused independently, such as the `Map` dynamic value type, the AST visitor infrastructure, and the printer. However, some deviations from the GraphQL spec remain (e.g., a handful of validation rules are commented out), and there is code duplication between `AnyCoder` and `MapCoder`. Force‑unwraps and some thread‑safety workarounds indicate areas that could be hardened. Overall, the library is production‑ready and actively maintained.

RATING: 8.4/10 MAINT: active DRIFT: medium
â–¸ 2 reusable components found
── end of results ──
$ submit: