Skip to content

Latest commit

 

History

History
75 lines (48 loc) · 3.82 KB

Contributing.md

File metadata and controls

75 lines (48 loc) · 3.82 KB

How to contribute

We love pull requests. And following this guidelines will make your pull request easier to merge.

If you want to contribute but don’t know what to do, take a look at these two labels: help wanted and good first issue.

Use GitHub interface for simple documentation changes, otherwise follow the steps below.

Prerequisites

  • If it’s your first pull request, watch this amazing course by Kent C. Dodds.
  • Install EditorConfig plugin for your code editor to make sure it uses correct settings.
  • Fork the repository and clone your fork.
  • Install dependencies: npm install.

Development workflow

General

First things first, as obvious as it is, run npm install.

If you are creating a new test suite, first make a new application with npm run nx -- g @nx/nest:application <app-name>.

Git branching is optional, but encourages to keep better track of what you are working on. In the end, make sure you make a pull request to the main repository so your changes can be merged. If your changes do not pass all the tests, you will likely be asked to make refactoring changes. Please make your changes and run the following commands:

git add .
git commit -m "your message here"
git rebase -i
# pick the commit to keep and squash or forget the rest
git push -f origin your_branch

This will trigger the tests to re-run as necessary.

GitHub Actions

When creating a new test suite, please set up a new GitHub Actions workflow with a name <app>.yml or similar. You can take a look at the existing workflows for an idea. Please add your current branch as a trigger for the workflow by adding the branches property to the yml's on array. If you need help, lookup the GitHub Actions workflow syntax and go from there.

Testing

Run all tests:

npm test

Run test for a specific project:

npm run nx -- test <app-name>
# e.g. npm run nx -- test complex-sample

READMEs and Other Updates

At the very least, do your absolute best to achieve 100% test coverage for unit tests, take a screenshot and add it as testCoverage.png in that application's root directory. Also, add the screenshot to the applications README so everyone can see that this is a valid test strategy.

Don’t forget to add tests and update documentation for your changes.

Please update npm lock file (package-lock.json) if you add or update dependencies.

Other notes

  • If you have commit access to repository and want to make big change or not sure about something, make a new branch and open pull request.
  • We’re using Prettier to format code, so don’t worry much about code formatting.
  • We're using Commitlint to checkout our commit messages. Please follow the expected format
  • Don’t commit generated files, like minified JavaScript.
  • Don’t change version number and change log.
  • Make sure to add a new github workflow under the name of <project_name>.yml. You can use any of the others as an example
  • Make sure to update the nightly test job with your new test suite

Need help?

If you want to contribute but have any questions, concerns or doubts, feel free to ping maintainers. Ideally create a pull request with WIP (Work in progress) in its title and ask questions in the pull request description.