- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Test it:
cargo test --workspace
- Lint it:
cargo +nightly clippy --all --all-targets -- -D warnings
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
We use rustfmt
to keep our codebase consistently formatted. Please ensure that
you have correctly formatted your code (most editors will do this automatically
when saving) or it may not pass the CI tests.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as in the README, without any additional terms or conditions.
To get started you will need a rust toolchain which can cross-compile to the
wasm32-wasi
target. We currently loosely track the toolchain <-> swc version
that nextjs uses. This is kept in the rust-toolchain
file and should be
used automatically.
❯ rustup target add wasm32-wasi
From there you can run a cargo build
❯ cargo build --release --target wasm32-wasi
❯ file target/wasm32-wasi/release/stailwc.wasm
target/wasm32-wasi/release/stailwc.wasm: WebAssembly (wasm) binary module version 0x1 (MVP)
These are requirements we have that we have not yet lifted to the level of automatic enforcement.
In each file the imports should be grouped into at most 4 groups in the following order:
- stdlib
- non-repository local crates
- repository local other crates
- this crate
Separate each group with a blank line, and rustfmt will sort into a canonical order. Any file that is not grouped like this can be rearranged whenever the file is touched - we're not precious about having it done in a separate commit, though that is helpful.
We ask that contributors keep the clippy status clean. Minimally, run cargo clippy
before submitting code. Clippy is also run in GitHub Actions.
It is expected that code is uniformly formatted. Before submitting code, make sure
to run cargo fmt
to make sure it conforms to the standard.
It is encouraged to open an issue before you create a PR as a place for pre-implementation discussion. If you're unsure about your contribution or simply want to ask a question about anything just open an issue and we'll chat.