0.4.0
This release adds a few major features, namely carton init
and carton test
commands, carton sdk local
subcommand, and enables support for linking with Foundation automatically.
Thanks to @carson-katri, @RayZhao1998, @JaapWijnen and @broadwaylamb for their contributions to this release!
New features:
Firstly, carton dev
no longer requires a --destination
flag with a manually crafted destination.json
file to link with Foundation. If your project has import Foundation
anywhere in its source code, a subset of Foundation provided with SwiftWasm is automatically linked. Please check the list of Foundation types currently unavailable in SwiftWasm for more details on Foundation compatibility (mostly filesystem, socket, multi-threading, and APIs depending on those are disabled).
The new carton init
command initializes a new SwiftWasm project for you (similarly to swift package init
) with multiple templates available at your choice. carton init --template tokamak
creates a new Tokamak project, while carton init --template basic
(equivalent to carton init
) creates an empty SwiftWasm project with no dependencies. Also, carton init list-templates
provides a complete list of templates (with only basic
and tokamak
available currently).
The new carton test
command runs your test suite in the wasmer
environment. Unfortunately, this currently requires a presence of LinuxMain.swift
file and explicit test manifests, --enable-test-discovery
flag is not supported yet. Projects that can build their test suite on macOS can use swift test --generate-linuxmain
command to generate this file.
Breaking changes:
The bundled carton dev
JavaScript entrypoint has been updated to fix runtime issues in the Swift-to-JavaScript bridge API. Because of this, projects that depend on JavaScriptKit should specify c90e82f
revision as a dependency:
dependencies: [
.package(url: "https://github.com/kateinoigakukun/JavaScriptKit", .revision("c90e82f")),
],
Unfortunately, specifying a JavaScriptKit version in Package.swift
as a dependency is not supported by SwiftPM due to the use of unsafe flags, see swiftwasm/JavaScriptKit#6 for more details.
Closed issues:
- Avoid running the tests if can't build them (#56)
- Verify SDK is already installed before installing the same version (#45)
- Automatically create destination JSON to allow linking Foundation (#4)
- Watcher should detect custom paths in Package.swift (#1)
Merged pull requests:
- Propagate test build/run failures in the exit code (#61) via @MaxDesiatov
- Update static.zip, automate its release process (#60) via @MaxDesiatov
- Upgrade JavaScriptKit to 0.5.0 (#59) via @carson-katri
- Add
carton init
command (#54) via @carson-katri - Fix
carton test
output skipping lines (#53) via @MaxDesiatov - Implement
carton sdk local
subcommand (#40) via @RayZhao1998 - Add
list
flag andtestCases
argument totest
(#52) via @MaxDesiatov - Implement simple wasmer runner for
test
command (#51) via @MaxDesiatov - Always pass --enable-test-discovery to swift build (#49) via @MaxDesiatov
- Fix watcher missing root directories (#48) via @MaxDesiatov
- Update to Vapor 4.15.2, fix formatting (#47) via @MaxDesiatov
- Add sources to watcher per target (#46) via @JaapWijnen
- Avoid displaying destination files as SDK versions (#44) via @MaxDesiatov
- Automatically link Foundation w/ destination.json (#41) via @MaxDesiatov
- Use Combine instead of OpenCombine where possible (#39) via @MaxDesiatov
- Add separate CartonHelpers/SwiftToolchain modules (#35) via @MaxDesiatov
- Use
from
instead ofupToNextMinor
for OpenCombine (#34) via @MaxDesiatov - Bump OpenCombine version to 0.10.0 (#33) via @broadwaylamb