Skip to content

Commit

Permalink
docs: CONTRIBUTING
Browse files Browse the repository at this point in the history
  • Loading branch information
uhyo committed Jan 2, 2024
1 parent 4973be7 commit 19322b6
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
Thank you for your interest in contributing to this project. Below are instructions for setting up your development environment.
Thank you for your interest in contributing to this project!

## Prerequisites
## Opening Issues

Issues for bug reports, feature requests and others are all welcome!

## Pull Requests

Pull requests of any kind are welcome too. However, please note that we might not always be able to accept feature contributions as-is. Added feature should match nitrogql's goals.

See below for how to set up development environment.

### Documentation

New features may require corresponding documentation updates. Documentation updates accompanying feature contribution is very appreciated, but it is not necessary. A maintainer can supplement the needed documentation.

## Development Environment

Below are instructions for setting up your development environment.

### Prerequisites

This project is written in Rust. You will need to install Rust and Cargo to build this project. You can find instructions for installing Rust [here](https://www.rust-lang.org/tools/install).

Also, this project maintains Node.js integrations. You will need to install Node.js and npm to build the Node.js integrations. You can find instructions for installing Node.js [here](https://nodejs.org/en/download/).

## Build and Test
### Build and Test

Usual commands like `cargo build`, `cargo test` or `cargo watch` (you need [cargo-watch](https://crates.io/crates/cargo-watch) for this) should work.

### Snapshot testing
#### Snapshot testing

When you want to update snapshot tests, [cargo-insta](https://crates.io/crates/cargo-insta) is required. Instead of `cargo test`, run `cargo insta test` for snapshot-testing-aware results. When snapshots are to be added or updated, run `cargo insta review` to review and apply the changes.

### Coverage
#### Coverage

To generate coverage file, run `make coverage`. This will generate a `coverage/lcov.info` file which can be loaded by the [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) extension.

Expand All @@ -23,9 +41,11 @@ Note that this requires below dependencies to be installed:
- `rustup component add llvm-tools-preview`
- `cargo install grcov`

## Building the Node.js integration
### Building the Node.js integration

We have a small set of scripts for building the Node.js integration. You need to have `wasm-opt` and `wasm-snip` installed.
We have a small set of scripts for building the Node.js integration.

1. `./build/build-rust.sh` to build Rust code into WASM.
2. `./build/build-node.sh` to copy the WASM file into the Node.js packages.
2. `./build/build-node.sh` to copy the WASM file into the Node.js packages.

For a production build, you need to have `wasm-opt` and `wasm-snip` installed.

0 comments on commit 19322b6

Please sign in to comment.