2021-04-29 05:22:49 +00:00
|
|
|
# Contributing
|
|
|
|
|
|
|
|
Contributors are welcomed!
|
|
|
|
|
2021-05-13 06:49:29 +00:00
|
|
|
We try to keep a number of [`good first issue`](https://github.com/status-im/js-waku/labels/good%20first%20issue) for new contributors.
|
|
|
|
If you feel confident, you can also check out the [`help wanted`](https://github.com/status-im/js-waku/labels/help%20wanted) issues.
|
2021-04-29 05:22:49 +00:00
|
|
|
|
2021-05-13 06:49:29 +00:00
|
|
|
To have an idea of the work in the pipeline, feel free to view the [js-waku project board](https://github.com/status-im/js-waku/projects/1).
|
2021-04-29 05:22:49 +00:00
|
|
|
This project board is to prioritize the work of core contributors so do not be deterred by issues in the `Icebox` or bottom of the `Backlog`.
|
|
|
|
|
|
|
|
Do note that we have a [CI](./.github/workflows/ci.yml) powered by GitHub Action.
|
|
|
|
To help ensure your PR passes, just run before committing:
|
|
|
|
|
2023-04-17 04:59:36 +00:00
|
|
|
- `npm run fix`: To format your code,
|
|
|
|
- `npm run check`: To check your code for linting errors,
|
|
|
|
- `npm run test`: To run all tests
|
2021-04-29 05:22:49 +00:00
|
|
|
|
|
|
|
## Build & Test
|
|
|
|
|
|
|
|
To build and test this repository, you need:
|
2023-04-17 04:59:36 +00:00
|
|
|
|
|
|
|
- [Node.js & npm](https://nodejs.org/en/).
|
|
|
|
- Chrome (for browser testing).
|
2021-04-29 05:22:49 +00:00
|
|
|
|
|
|
|
To ensure interoperability with [nim-waku](https://github.com/status-im/nim-waku/), some tests are run against a nim-waku node.
|
2023-04-17 04:59:36 +00:00
|
|
|
This is why the relevant docker images for the node is pulled as part of the `pretest` script that runs before `npm run test`.
|
2021-04-29 05:22:49 +00:00
|
|
|
|
2023-04-17 04:59:36 +00:00
|
|
|
If you do not want to run `npm run test`, you can still pull the relevant nim-waku docker image by running `npm run pretest`.
|
2021-04-29 05:22:49 +00:00
|
|
|
|
2022-03-01 04:27:35 +00:00
|
|
|
Note that we run tests in both NodeJS and browser environments (using [karma](https://karma-runner.github.io/)).
|
|
|
|
Files named `*.node.spec.ts` are only run in NodeJS environment;
|
|
|
|
Files named `*.spec.ts` are run in both NodeJS and browser environment.
|
2021-07-14 11:11:01 +00:00
|
|
|
|
2021-04-29 05:22:49 +00:00
|
|
|
## Guidelines
|
|
|
|
|
2021-07-14 11:11:01 +00:00
|
|
|
- Please follow [Chris Beam's commit message guide](https://chris.beams.io/posts/git-commit/) for commit patches,
|
2021-07-15 00:26:59 +00:00
|
|
|
- Please test new code, we use [mocha](https://mochajs.org/),
|
|
|
|
[chai](https://www.chaijs.com/),
|
|
|
|
[fast-check](https://github.com/dubzzz/fast-check)
|
|
|
|
and [karma](https://karma-runner.github.io/).
|
2021-04-29 05:22:49 +00:00
|
|
|
|
|
|
|
### Committing Patches
|
|
|
|
|
|
|
|
In general, [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention)
|
|
|
|
and diffs should be easy to read.
|
|
|
|
For this reason, do not mix any formatting fixes or code moves with actual code changes.
|
|
|
|
|
|
|
|
Commit messages should be verbose by default consisting of a short subject line (50 chars max),
|
|
|
|
a blank line and detailed explanatory text as separate paragraph(s),
|
|
|
|
unless the title alone is self-explanatory in which case a single title line is sufficient.
|
|
|
|
|
|
|
|
Commit messages should be helpful to people reading your code in the future, so explain the reasoning for
|
|
|
|
your decisions.
|
|
|
|
|
|
|
|
If a particular commit references another issue, please add the reference.
|
|
|
|
For example: `refs #1234` or `fixes #4321`.
|
|
|
|
Using the `fixes` or `closes` keywords will cause the corresponding issue to be closed when the pull request is merged.
|
|
|
|
|
|
|
|
Commit messages should never contain any `@` mentions (usernames prefixed with "@").
|
|
|
|
|
|
|
|
Please refer to the [Git manual](https://git-scm.com/doc) for more information
|
|
|
|
about Git.
|