|
| 1 | +# Contributing |
| 2 | + |
| 3 | +We would love for you to contribute and help make it even better |
| 4 | +than it is today! As a contributor, here are the guidelines we would like you |
| 5 | +to follow: |
| 6 | + |
| 7 | +- [Question or Problem?](#question) |
| 8 | +- [Issues and Bugs](#issue) |
| 9 | +- [Feature Requests](#feature) |
| 10 | +- [Submission Guidelines](#submit) |
| 11 | +- [Coding Rules](#rules) |
| 12 | +- [Commit Message Guidelines](#commit) |
| 13 | + |
| 14 | +## <a name="question"></a> Got a Question or Problem? |
| 15 | + |
| 16 | +Please, do not open issues for the general support questions as we want to keep GitHub issues for bug reports and feature requests. |
| 17 | + |
| 18 | +## <a name="issue"></a> Found an Issue? |
| 19 | + |
| 20 | +If you find a bug in the source code or a mistake in the documentation, you can help us by |
| 21 | +[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can |
| 22 | +[submit a Pull Request](#submit-pr) with a fix. |
| 23 | + |
| 24 | +## <a name="feature"></a> Want a Feature? |
| 25 | + |
| 26 | +You can _request_ a new feature by [submitting an issue](#submit-issue) to our [GitHub |
| 27 | +Repository][github]. If you would like to _implement_ a new feature, please submit an issue with |
| 28 | +a proposal for your work first, to be sure that we can use it. |
| 29 | + |
| 30 | +First open an issue and outline your proposal so that it can be |
| 31 | +discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, |
| 32 | +and help you to craft the change so that it is successfully accepted into the project. |
| 33 | + |
| 34 | +**All features require a proper design and review by team members and product owners.** Before starting work, you might want to |
| 35 | +discuss with us to figure out: |
| 36 | + |
| 37 | +- Is this something we want? |
| 38 | +- What's the impact? |
| 39 | + |
| 40 | +Answering those questions first in the request might help us make a decision. |
| 41 | + |
| 42 | +## <a name="submit"></a> Submission Guidelines |
| 43 | + |
| 44 | +### <a name="submit-issue"></a> Submitting an Issue |
| 45 | + |
| 46 | +Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you. |
| 47 | + |
| 48 | +We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. Having a reproducible |
| 49 | +scenario gives us wealth of important information without going back & forth to you with additional questions. |
| 50 | + |
| 51 | +You can file new issues by filling out our [new issue form](https://github.com/vuesion/packages/issues/new). |
| 52 | + |
| 53 | +### <a name="submit-pr"></a> Submitting a Pull Request (PR) |
| 54 | + |
| 55 | +Before you submit your Pull Request (PR) consider the following guidelines: |
| 56 | + |
| 57 | +- Search [GitHub](https://github.com/vuesion/packages/pulls) for an open or closed PR |
| 58 | + that relates to your submission. You don't want to duplicate effort. |
| 59 | +- Make your changes in a new git branch: |
| 60 | + |
| 61 | + ```shell |
| 62 | + git checkout -b my-fix-branch |
| 63 | + ``` |
| 64 | + |
| 65 | +- Create your patch, **including appropriate test cases**. |
| 66 | +- Run the full test suite, |
| 67 | + and ensure that all tests pass. |
| 68 | +- Commit your changes using a descriptive commit message that follows our |
| 69 | + [commit message conventions](#commit). Adherence to these conventions |
| 70 | + is necessary because release notes are automatically generated from these messages. |
| 71 | + |
| 72 | + ```shell |
| 73 | + git commit -a |
| 74 | + ``` |
| 75 | + |
| 76 | + Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. |
| 77 | + |
| 78 | +- Push your branch to GitHub: |
| 79 | + |
| 80 | + ```shell |
| 81 | + git push origin my-fix-branch |
| 82 | + ``` |
| 83 | + |
| 84 | +- In GitHub, send a pull request to `packages:master`. |
| 85 | +- If we suggest changes then: |
| 86 | + |
| 87 | + - Make the required updates. |
| 88 | + - Re-run the test suites to ensure tests are still passing. |
| 89 | + - Rebase your branch and force push to your GitHub repository (this will update your Pull Request): |
| 90 | + |
| 91 | + ```shell |
| 92 | + git rebase -i |
| 93 | + git push -f |
| 94 | + ``` |
| 95 | + |
| 96 | +That's it! Thank you for your contribution! |
| 97 | +
|
| 98 | +#### After your pull request is merged |
| 99 | +
|
| 100 | +After your pull request is merged, you can safely delete your branch and pull the changes |
| 101 | +from the main (upstream) repository: |
| 102 | +
|
| 103 | +- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: |
| 104 | +
|
| 105 | + ```shell |
| 106 | + git push origin --delete my-fix-branch |
| 107 | + ``` |
| 108 | +
|
| 109 | +- Check out the master branch: |
| 110 | +
|
| 111 | + ```shell |
| 112 | + git checkout master -f |
| 113 | + ``` |
| 114 | +
|
| 115 | +- Delete the local branch: |
| 116 | +
|
| 117 | + ```shell |
| 118 | + git branch -D my-fix-branch |
| 119 | + ``` |
| 120 | +
|
| 121 | +- Update your master branch with the latest upstream version: |
| 122 | +
|
| 123 | + ```shell |
| 124 | + git pull --ff upstream master |
| 125 | + ``` |
| 126 | +
|
| 127 | +## <a name="rules"></a> Coding Rules |
| 128 | +
|
| 129 | +To ensure consistency throughout the source code, keep these rules in mind as you are working: |
| 130 | +
|
| 131 | +- All features or bug fixes **must be tested** by one or more specs (unit-tests or e2e-tests). |
| 132 | +
|
| 133 | +## <a name="commit"></a> Commit Message Guidelines |
| 134 | +
|
| 135 | +We have very precise rules over how our git commit messages can be formatted. This leads to **more |
| 136 | +readable messages** that are easy to follow when looking through the **project history**. But also, |
| 137 | +we use the git commit messages to **generate the change log**. |
| 138 | +
|
| 139 | +### Commit Message Format |
| 140 | +
|
| 141 | +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special |
| 142 | +format that includes a **type**, a **scope** and a **subject**: |
| 143 | +
|
| 144 | +``` |
| 145 | +<type>(<scope>): <subject> |
| 146 | +<BLANK LINE> |
| 147 | +<body> |
| 148 | +<BLANK LINE> |
| 149 | +<footer> |
| 150 | +``` |
| 151 | +
|
| 152 | +The **header** is mandatory and the **scope** of the header is optional. |
| 153 | +
|
| 154 | +Any line of the commit message cannot be longer 100 characters! This allows the message to be easier |
| 155 | +to read on GitHub as well as in various git tools. |
| 156 | +
|
| 157 | +### Revert |
| 158 | +
|
| 159 | +If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted. |
| 160 | +
|
| 161 | +### Type |
| 162 | +
|
| 163 | +Must be one of the following: |
| 164 | +
|
| 165 | +- **build**: Changes that affect the build system or external dependencies |
| 166 | +- **ci**: Changes to our CI configuration files and scripts |
| 167 | +- **docs**: Documentation only changes |
| 168 | +- **feat**: A new feature |
| 169 | +- **fix**: A bug fix |
| 170 | +- **perf**: A code change that improves performance |
| 171 | +- **refactor**: A code change that neither fixes a bug nor adds a feature |
| 172 | +- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing |
| 173 | + semi-colons, etc) |
| 174 | +- **test**: Adding missing tests or correcting existing tests |
| 175 | +- **chore**: Maintenance |
| 176 | +
|
| 177 | +### Scope |
| 178 | +
|
| 179 | +The scope should be the name of the module affected as perceived by the person reading changelog generated from the commit messages. |
| 180 | +
|
| 181 | +### Subject |
| 182 | +
|
| 183 | +The subject contains succinct description of the change: |
| 184 | +
|
| 185 | +- use the imperative, present tense: "change" not "changed" nor "changes" |
| 186 | +- don't capitalize first letter |
| 187 | +- no dot (.) at the end |
| 188 | + |
| 189 | +### Body |
| 190 | + |
| 191 | +Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". |
| 192 | +The body should include the motivation for the change and contrast this with previous behavior. |
| 193 | + |
| 194 | +### Footer |
| 195 | + |
| 196 | +The footer should contain any information about **Breaking Changes** and is also the place to |
| 197 | +reference GitHub issues that this commit **Closes**. |
| 198 | + |
| 199 | +[github]: https://github.com/vuesion/packages/issues |
0 commit comments