๐ ๏ธ Contributing
The usual process to make a contribution is to:
- Check for existing related issues on GitHub
 - Fork the repository and create a new branch
 - Make your changes
 - Make sure formatting, linting and tests passes.
 - Add tests if possible to cover the lines you added.
 - Commit, and send a Pull Request.
 
๐ฅ๏ธ Clone the repository
Clone the nanopub-rs repository, and cd into it:
โ๏ธ Install dependencies
Required for development:
- ๐ฆ Rust
 - ๐ 
uvto easily handle Python scripts and virtual environments - ๐จ NodeJS
 
Install development dependencies:
๐งช Run tests
๐ฆ Test Rust crate
Run tests for the rust crate:
More options
Display prints:
Run a specific test:
If tests panic without telling on which test it failed:
Test the nanopub crate with code coverage (much slower):
๐ Test Python package
Build the pip package and run pytest tests:
Or just run the tests:
๐จ Test JavaScript package
Build the npm package and run jest tests:
Start a web server to access the dev webpage:
Open localhost:3000 in your web browser.
โจ๏ธ Test CLI
Test signing a nanopublication with the commandline interface:
๐ Run all tests
๐งผ Format & lint
Automatically format the codebase using rustfmt:
Lint with clippy:
๐ Generate docs
Start docs website locally with mkdocs:
๐ญ๏ธ Work on the demo webpage
Start a web server at localhost:3000/playground.html
๏ธโ๏ธ Check supply chain
Check the dependency supply chain: licenses (only accept dependencies with OSI or FSF approved licenses), and vulnerabilities (CVE advisories).
Make sure dependencies have been updated:
๐ท๏ธ Publish a new release
Building and publishing artifacts will be done by the build.yml GitHub actions workflow, make sure you have set the following tokens as secrets for this repository: PYPI_TOKEN, NPM_TOKEN, CRATES_IO_TOKEN, CODECOV_TOKEN
Then just run the release script providing the new version following semantic versioning, it will bump the version in the Cargo.toml files, generate the changelog from commit messages, create a new tag, and push to GitHub:
Automated release
The build.yml workflow will automatically build artifacts (binaries, pip wheels, npm package), create a new release on GitHub, and add the generated artifacts to the new release.