rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
cargo install cargo-nextest
cargo nextest run --workspace --all-features
# To test individual features
for i in {0..3}; do cargo test_$i || break; done
Collect coverage and output as lcov
.
./coverage.sh
Collect coverage and open html
report.
./coverage.sh && cargo coverage_open
-
Update crate versions.
sd -s 'version = "0.0.13"' 'version = "0.0.14"' $(fd -tf -F toml) README.md src/lib.rs # Make sure only `peace` crates are updated. git --no-pager diff | rg '^[+]' | rg -v '(peace)|(\+\+\+)|\+version'
-
Update
CHANGELOG.md
with the version and today's date. -
If dependency versions have changed, update
licenses.html
:cargo about generate --workspace --all-features about.hbs > doc/src/licenses.html
-
Push a tag to the repository.
The
publish
GitHub workflow will automatically publish the crates tocrates.io
.
Note:
An alternative to cargo-release
is cargo-workspaces
, which may be used in case crates need to be published one by one -- if many new crates are being published, cargo-release
gates the number of crates that can be published at one go.
cargo workspaces \
publish \
--from-git \
--allow-branch main \
--force '*' \
--no-verify \
--no-git-tag
These instructions are for Linux. They may work on OS X, but for Windows, please visit each linked site for specific instructions.
-
Install
nvm
:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
-
Install node and set the default version:
nvm install 20 nvm alias default 20
-
Install and set up
pnpm
:npm install -g pnpm pnpm setup
-
Install tailwindcss:
pnpm install --global tailwindcss
-
Install
cargo-leptos
:cargo install --git https://github.com/leptos-rs/cargo-leptos.git --locked cargo-leptos
Notes:
pnpm
is used because it downloads each version of each library once, whereasnpm
downloads all dependencies recursively, even if the same dependency is already existent in the dependency tree.- This is installed as a global binary instead of as a dev dependency within the repository. This is more aligned with Rust's single-binary installation model.
ℹ️ These commands assume you are running them from the repository root directory.
Build and serve the envman
example. Either:
# Watch, build, and `envman` purely as a web server.
cargo leptos watch --project "envman" -v
Or:
# Build `envman` as a cli tool.
cargo +stable leptos build --project envman --bin-features "cli" \
&& test -d /tmp/demo \
|| mkdir /tmp/demo \
&& cp -R target/{debug/envman,web/envman/pkg} /tmp/demo
# In a separate terminal
cd /tmp/demo
./envman web
To uninstall web tooling:
pnpm uninstall --global tailwindcss
nvm uninstall $version
rm -rf ~/.nvm