Install the prerequisites:
cargo install cargo-dist@0.6.2
cargo install cargo-release@0.25.6
To release, do the following:
- Update & commit the version & release date in
CHANGELOG.md
- Run:
scripts/release.sh x.x.x
Prereleases
To create a prerelease version, append rc
like: x.x.x-rc.x
. cargo-dist
will automatically flag this as a prerelease on GitHub.
If something goes wrong with a deploy:
-
Remove the release on GitHub
-
In order to re-release the version, delete the tag:
git tag -d vx.x.x git push -u origin :refs/tags/vx.x.x
This is useful for manually testing if commands work.
cd examples/basic
cargo run --bin rivet -- <COMMAND>
To run without rebuilding:
cd examples/basic
../../target/debug/rivet <COMMAND>
To install the
cargo install --path packages/cli --debug
To iterate faster on the backend without requiring rebuilding the toolchain for every change, run rivet config edit user
and add this to your config, where /path/to/toolchain
is the path to this repository:
{
"backend": {
"source_path": "/path/to/toolchain/packages/backend/"
}
}
This will direct the toolchain to use the raw source code for the backend instead of the embedded backend source code that requires a rebuild.
See packages/backend/deno.jsonc
for extra scripts for the backend.
The backend package is a TypeScript package located at packages/backend/
. This contains:
packages/backend/toolchain/
– Library to manage the backend in developmentpackages/backend/cli/
– JSON CLI interface to the toolchainpackages/backend/runtime/
– Runtime code used to by the backend at runtime
Backend artifacts are files that are required to be generated for the backend to run.
Artifacts are automatically generated on Cargo build in packages/backend-embed/build.rs
. Under the hood, this calls the scripts/backend/build_artifacts.ts
script.
Deno is automatically downloaded and installed to a temporary path in packages/deno-embed
. This is used both at runtime for the toolchain and any build scripts that depend on Deno.
The backend is embedded using include_dir
. This is automatically inflated to the data dir at runtime. The backend path can be overridden using the backend.source_path
setting.
Tasks are structured in a way where the applciation can make a request and receive a stream of events in response until the task completes.
This allows for a simpler architecture by:
- Allowing CLI commands to map nicely to tasks
- Allow a clean callback format for FFIs