We’re thrilled that you want to help! 🎉😍
Here are a few guidelines to help you get on the right tracks.
This project uses the Contributor Covenant code of conduct. Please read it carefully if you’re not already familiar with it. We expect you to behave in accordance with it on all online spaces related to this project.
Before you start spending time on this, it’s best to check that you’re not going to waste your time re-inventing something that is already being worked on (an effort which you could then join), or putting together something that we would end up refusing for various reasons.
Check out existing issues (including closed ones, as such discussions might be resolved already) to verify that your intended contribution is both new and relevant.
If you can't find anything related, please open an issue and discuss your proposal, so we can help you figure out the best way to go about it for a smooth, successful merge in the project. Feel free to at-mention @tdd in there for extra confidence in our getting promptly notified.
Issues are the best place to hash out the details and approaches early, before too much code has been committed to it. You can then proceed to coding (or writing docs, or improving other aspects)!
Getting started is the usual stuff:
- Fork the project
- Clone your forked repo on your local machine
npm install
- Create a well-named branch for your work (
git checkout -b your-branch-name
)
In accordance with the usual “Your House, Your Rules” approach, contributions are expected to honor the codebase’s coding style. To facilitate this, the repo comes with:
- Detailed VS Code workspace settings (in
.vscode/settings.json
), including whitespace management and ESLint / Prettier extension settings. - Recommended VS Code extensions (in
.vscode/extensions.json
), including ESLint and Prettier. If you use other JS linters / beautifiers, make sure you disable them for this workspace to avoid conflicts. - EditorConfig settings for the larger use-case (in
.editorconfig
) - A
npm run lint
script you can use to ensure consistency. It’s part of thenpm test
script, which in turn is run through thepre-commit
andpre-push
Git hooks.
The project files all have full tests. We use Jest for this, and have two npm scripts ready:
npm test
runs both the linter and the tests (test:core
). Run at commit and push time through Git hooks installed by Husky.npm run test:core
does a one-pass; it includes full test coverage reporting.npm run test:watch
runs a developer test watch; this is what you should use when working on your code and tests.
The test suite uses the amazing MongoDB Memory Server package, which means you won't need to have a running MongoDB server with a test database to run our tests! How cool is that!
We use Jest’s built-in expect()
and matchers, along with its native mocking abilities. If you’re not familiar with them, here are the docs for matchers, function mocking and module mocking. Look at the existing tests for inspiration and guidance.
Make sure any new code you send has matching tests, and that the test suite passes.
Once you have something ready to contribute, or if you’re too stuck and need help, send a Pull Request from your fork’s code to our main repository. GitHub makes that easy for you in multiple ways. If you’re new to Pull Requests, check out their neat docs about it.
Any Pull Request submitted to main repository will trigger various Checks, including Continuous Integration on Travis and quality auditing on CodeClimate. These may result in failed checks that would prevent regular merging, but don't worry, we'll work on this together.
We currently achieve 100% test coverage, and we’d love to keep it that way. If you’re not clear on why your tests do not cover 100% of your code in some ways, ask us about it in your Pull Request’s conversation.
We currently achieve a zero-issue, A-level quality grade on CodeClimate; it will be tested on your Pull Requests as well, and we'd love for you to address any issues that may be surfaced. If you’re unsure how, ask us and we'll review it with you.
🙏🏻 Thanks a ton for helping out! That's what Open-Source is all about! 🙏🏻