carton
is a watcher, bundler, and test runner for your SwiftWasm apps. The main goal of carton
is to provide a smooth zero-config experience when developing for WebAssembly.
It is still in development, but it aims to support these features:
- Creating basic package boilerplate for apps built with SwiftWasm with
carton init
. - Watching the app for source code changes and reloading it in your browser with
carton dev
. - Running your XCTest suite in the full JavaScript/DOM environment with
carton test
. - Optimizing and packaging the app for distribution with
carton dist
.
When using carton
you don't have to install Node.js or to write your own webpack configs. carton
itself uses webpack as a dev dependency to precompile and minify the required WASI polyfill and the
reload-on-rebuild code, but you won't need webpack or Node.js when using carton as an end user.
The polyfill is distributed to you precompiled.
It is currently work in progress, so watch the repository for imminent updates!
If this tool saved you any amount of time or money, please consider sponsoring the work of its maintainer. While some of the sponsorship tiers give you priority support or even consulting time, any amount is appreciated and helps in maintaining the project.
This project uses SwiftFormat and SwiftLint to enforce formatting and coding style. We encourage you to run SwiftFormat within a local clone of the repository in whatever way works best for you either manually or automatically via an Xcode extension, build phase or git pre-commit hook etc.
To guarantee that these tools run before you commit your changes on macOS, you're encouraged to run this once to set up the pre-commit hook:
brew bundle # installs SwiftLint, SwiftFormat and pre-commit
pre-commit install # installs pre-commit hook to run checks before you commit
Refer to the pre-commit documentation page for more details and installation instructions for other platforms.
SwiftFormat and SwiftLint also run on CI for every PR and thus a CI build can fail with incosistent formatting or style. We require CI builds to pass for all PRs before merging.
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].