Carton is a deprecated development tool for SwiftWasm applications that provided a zero-config experience for building and testing WebAssembly projects written in Swift. The repository is no longer maintained, with the project officially deprecated in favor of a new SwiftPM Plugin from JavaScriptKit. The deprecation notice appears prominently in the README and repository description, directing users to migrate to the successor tool.
The tool was written in Swift and functioned as a bundler, watcher, and test runner specifically designed for SwiftWasm development. It offered three main commands accessed through swift run carton: the dev command for local development with automatic browser reloading, the test command for running XCTest suites in JavaScript or DOM environments, and the bundle command for optimizing and packaging applications for distribution. The dev command started an HTTP server on port 8080 that automatically rebuilt and reloaded the application when source code changed, while the test command could run tests in wasmer, Node.js, or browser environments with optional headless WebDriver support. The bundle command created optimized release builds with content-hash-based filenames for cache busting and could optionally preserve debug information or disable WebAssembly optimizations.
Carton was built as a SwiftPM Plugin using SwiftNIO and supported both macOS and Linux platforms. The tool bundled a WASI polyfill and the JavaScriptKit runtime, eliminating the need for webpack configuration files that the maintainers found cumbersome. The development server established WebSocket connections for hot reloading, bringing the experience closer to Xcode live previews. The tool required only that a Package.swift file contain at least one executable product, with no additional configuration files needed for basic scenarios.
According to GitGenius activity tracking, the repository showed median issue and pull request response latency of 9.4 hours across tracked items, though mean latency was significantly higher at 6637.9 hours, suggesting occasional delays on some items. The most active contributors tracked were k0pernicus with 8 events and kateinoigakukun with 7 events. Bug reports were the most active issue label tracked. The repository shares overlapping contributors with swiftlang/swift, zed-industries/zed, and highlightjs/highlight.js according to GitGenius linking analysis.
The tool maintained compatibility across different versions of SwiftWasm, JavaScriptKit, and Tokamak, with a detailed compatibility matrix provided in the documentation. Version 1.0 and later required Swift 5.9.2 and Xcode 15.1 or later. The project previously embedded JavaScriptKit runtime directly, but this was resolved starting with JavaScriptKit 0.15 and carton 0.15, after which all higher version combinations became compatible with each other.
The project enforced code quality through SwiftFormat and SwiftLint, with pre-commit hooks available for developers. The repository included sponsorship information for the SwiftWasm organization and individual maintainers including carson-katri, kateinoigakukun, and MaxDesiatov. Despite its deprecation, the repository remains publicly available as a historical reference for SwiftWasm development practices and the evolution toward the new SwiftPM Plugin approach.