This project currently consists of 4 components:
- The Rust
ftacrate, incrates/fta - The Rust
fta-wasmcrate, incrates/fta-wasm - The NPM
fta-clipackage, inpackages/fta - The NPM
fta-wasmpackage, an artefact of thefta-wasmRust crate
The NPM fta-cli package is a super thin layer that simply calls the relevant fta binary. For this to work, the NPM package is designed to contain pre-built binaries.
Use PRs into main. GitHub Actions are set up to:
- Compile the Rust crate & run Rust tests, output test coverage (Ubuntu)
- Build binaries for all targets on windows/macos/linux
- Smoke test all built binaries against a sample file
- Construct the NPM package, i.e. install the compiled binaries into
packages/fta/binaries - Publish the NPM package locally using Verdaccio
- Smoke test the verdaccio-published NPM package via a sample file
The NPM CLI package itself is plain JavaScript without any Node.js tests or build step, since those things aren't really warranted.
- Merge changes over time to
main, with green builds to verify everything is healthy - Bump versions and update
CHANGELOG.md. Do this in a PR and merge it tomain.- Set the version in
packages/fta/package.json - Set the version in
crates/fta/Cargo.toml, - Set the version in
crates/fta-wasm/Cargo.toml - From the project root, run
cargo updateso that the lockfile updates too
- Set the version in
- When you're satisfied everything is ready on
main(and the build is green), locally tag the repo with a new version e.g.v1.0.0. Push this tag to trigger the release. This will release both theftaRust crate and thefta-cliNPM package.- Tag locally:
git tag v3.0.0 - Push the tag:
git push origin v3.0.0
- Tag locally:
This should be published manually. From the crates/fta-wasm directory:
- Ensure the crate version is in sync. Similar to the
fta-clipackage, it usually makes sense for the coreftacrate to be published first. - If you already have the
crates/fta-wasm/pkgdir, delete it / clear it out. - Run
wasm-pack build --target web. This'll prep the files inpkg. - If you want to locally debug before publish, you can paste the contents of
pkgto override an existing version innode_modules. - Run
wasm-pack publish pkg. This directly publishes the output to NPM.
Code coverage is reported during the test workflow.
To check the coverage locally, install and run tarpaulin:
cargo install cargo-tarpaulin
cargo tarpaulin
Note that tarpaulin is not installed as a build dependency, hence should be installed manually to generate coverage.