|
| 1 | +# Contributing to @node-oauth/oauth2-server |
| 2 | + |
| 3 | +Thank you for your interest in this project and your aims to improving it. |
| 4 | +This guide will give you the most important info on how to contribute properly |
| 5 | +in order to get your pull requests accepted. |
| 6 | + |
| 7 | +## Disclose security vulnerabilities |
| 8 | + |
| 9 | +First things first: |
| 10 | +This project has strong security implications and we appreciate every help to |
| 11 | +improve security. |
| 12 | + |
| 13 | +**However, please read our [security policy](./SECURITY.md), before taking |
| 14 | +actions.** |
| 15 | + |
| 16 | +## Development |
| 17 | + |
| 18 | +If you want to fix bugs or add new features, please clone the source via |
| 19 | + |
| 20 | +```bash |
| 21 | +$ npm run test |
| 22 | +``` |
| 23 | + |
| 24 | +### No PR without issue |
| 25 | + |
| 26 | +Please make sure your commitment will be appreciated by first opening an issue |
| 27 | +and discuss, whether this is a useful addition to the project. |
| 28 | + |
| 29 | + |
| 30 | +### Run the tests |
| 31 | + |
| 32 | +Please always make sure your code is passing linter and tests **before** |
| 33 | +committing. By doing so you help to make reviews much easier and don't pollute |
| 34 | +the history with commits, that are solely targeting lint fixes. |
| 35 | + |
| 36 | +You can run the tests via |
| 37 | + |
| 38 | +```bash |
| 39 | +$ npm run test |
| 40 | +``` |
| 41 | + |
| 42 | +or |
| 43 | + |
| 44 | +```bash |
| 45 | +$ npm run test:coverage |
| 46 | +``` |
| 47 | + |
| 48 | +to see your coverage. |
| 49 | + |
| 50 | +### Open a pull request (PR) |
| 51 | + |
| 52 | +Once you have implemented your changes and tested them locally, please open |
| 53 | +a [pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). |
| 54 | + |
| 55 | +Note: sometimes a pull request (PR) is also referred to as merge request (MR). |
| 56 | + |
| 57 | +#### Fundamental PR requirements |
| 58 | + |
| 59 | +There are a few basic requirements for your pull request to become accepted: |
| 60 | + |
| 61 | +- Make sure to open your pull request to target the `development` branch and not |
| 62 | +`master` |
| 63 | +- Make sure you are working on a branch, other than `development`; usually you |
| 64 | + can name the branch after the feature or fix you want to provide |
| 65 | +- Resolve any merge conflicts (usually by keeping your branch updated with |
| 66 | + `development`) |
| 67 | +- Have a clear description on what the PR does, including any steps necessary |
| 68 | + for testing, reviewing, reproduction etc. |
| 69 | +- Link to the existing issue |
| 70 | +- Added functions or changed functions need to get documented in compliance with |
| 71 | + JSDoc |
| 72 | +- Make sure all CI Tests are passing |
| 73 | + |
| 74 | +Also make sure, to comply with the following list: |
| 75 | + |
| 76 | +- Do not work on `development` directly |
| 77 | +- Do not implement multiple features in one pull request (this includes bumping |
| 78 | + versions of dependencies that are not related to the PR/issue) |
| 79 | +- Do not bump the release version (unless you are a maintainer) |
| 80 | +- Do not edit the Changelog as this will be done after your PR is merged |
| 81 | +- Do not introduce tight dependencies to a certain package that has not been |
| 82 | + approved during the discussion in the issue |
| 83 | + |
| 84 | +#### Review process |
| 85 | + |
| 86 | +Finally your PR needs to pass the review process: |
| 87 | + |
| 88 | +- A certain amount of maintainers needs to review and accept your PR |
| 89 | +- Please **expect change requests**! They will occur and are intended to improve |
| 90 | + the overall code quality. |
| 91 | +- If your changes have been updated please re-assign the reviewer who asked for |
| 92 | + the changes |
| 93 | +- Once all reviewers have approved your PR it will be merged by one of the |
| 94 | + maintainers :tada: |
| 95 | + |
| 96 | +## For maintainers |
| 97 | + |
| 98 | +### When to release a new version? |
| 99 | + |
| 100 | +- on fixed vulnerabilities |
| 101 | +- on fixed dependency-vulnerabilites |
| 102 | +- on new added features |
| 103 | +- what else? |
| 104 | + |
| 105 | +### When to decide between major, minor and path release? |
| 106 | + |
| 107 | +- major = breaking |
| 108 | +- minor = features and security fixes |
| 109 | +- patch = general fixes and small improvements |
| 110 | + |
| 111 | +### How to release a new version? |
| 112 | + |
| 113 | +What's required to publish to npm, which branches are involved, what should not |
| 114 | +be done etc. |
| 115 | + |
| 116 | +## Become a maintainer |
| 117 | + |
| 118 | +What is required to become a maintainer? |
| 119 | + |
0 commit comments