SwiftFormat is a mature, rule-based Swift source code formatter and linter. It operates as a command-line tool, an Xcode source editor extension, and a Swift Package Manager plugin. The core engine tokenizes Swift source code and applies a configurable set of formatting rules, each defined as a static `FormatRule` with help text, options, and a closure that manipulates the token stream via a `Formatter` API. The architecture is modular: rules are isolated in individual files under `Sources/Rules/`, the formatter provides reusable token manipulation primitives, and reporters (JSON, XML, SARIF, GitHub Actions) handle output. Configuration is hierarchical via `.swiftformat` files, inline directives, and command-line options. The system's primary data flow is: source file → tokenization → rule application (ordered by dependencies) → token stream mutation → output. Rules can be disabled, version-gated, or run once. The test suite uses a shared `testFormatting` helper that verifies formatting output, lint idempotency, and change tracking. The project also includes an Xcode extension with a preferences UI and an SPM plugin for build-time formatting. External dependencies are minimal (Foundation, XcodeKit for the extension, and git for header metadata). Key entry points include `CommandLineTool/main.swift` (CLI), `EditorExtension/Extension/FormatFileCommand.swift` (Xcode), and `Plugins/SwiftFormatPlugin/SwiftFormatPlugin.swift` (SPM). The library target `SwiftFormat` exposes `format()` and `lint()` APIs for programmatic use. The codebase demonstrates high craftsmanship with a declarative rule DSL, auto-updating declaration tracking, and a comprehensive test infrastructure that catches regressions across real-world Swift projects (vendored as snapshot fixtures).
JavaScriptKit is a production-grade Swift framework and Swift Package Manager plugin suite that enables bidirectional JavaScript interop for Swift code compiled to WebAssembly (WASM). The core runtime (JavaScriptKit) provides low-level types such as JSObject, JSValue, JSClosure, JSPromise, and JSBigInt, along with value conversion protocols (ConvertibleToJSValue, ConstructibleFromJSValue) and thread-local storage helpers. The BridgeJS plugin uses Swift macros (@JS, @JSFunction, @JSClass, etc.) to automatically generate Swift and JavaScript glue code, including WebAssembly export/import tables, stack-based marshalling, codec caches, and closure lifecycle management. The PackageToJS plugin packages the compiled WASM module into a deployable JavaScript package with platform-specific instantiation logic for browsers, Node.js, and WASI. The repository includes extensive snapshot-based code generation tests, runtime integration tests, benchmarks, and real-world examples (browser apps, Node.js servers, multithreading with web workers, OffscreenCanvas, actor-based concurrency). The architecture is a layered combination of a Swift library, Swift macros, a CLI tool (bridge-js), and SPM build plugins, all heavily dependent on WebAssembly-specific Swift features (@_expose(wasm), @_cdecl) and the Swift concurrency runtime. The project is actively maintained with a large test surface, but carries medium technical drift due to reliance on experimental Swift features and snapshot brittleness.