|
| 1 | +# Contributing to ng2-admin |
| 2 | + |
| 3 | +We would love for you to contribute to ng2-admin and help make it even better than it is |
| 4 | +today! As a contributor, here are the guidelines we would like you to follow: |
| 5 | + |
| 6 | + - [Question or Problem?](#question) |
| 7 | + - [Issues and Bugs](#issue) |
| 8 | + - [Feature Requests](#feature) |
| 9 | + - [Submission Guidelines](#submit) |
| 10 | + - [Commit Message Guidelines](#commit) |
| 11 | + |
| 12 | +## <a name="question"></a> Got a Question or Problem? |
| 13 | + |
| 14 | +Please, do not open issues for the general support questions as we want to keep GitHub issues for bug reports and feature requests. |
| 15 | + |
| 16 | +StackOverflow is a much better place to ask questions since: |
| 17 | + |
| 18 | +- there are thousands of people willing to help on StackOverflow |
| 19 | +- questions and answers stay available for public viewing so your question / answer might help someone else |
| 20 | +- StackOverflow's voting system assures that the best answers are prominently visible. |
| 21 | + |
| 22 | +To save your and our time we will be systematically closing all the issues that are requests for general support and redirecting people to StackOverflow. |
| 23 | + |
| 24 | +If you would like to chat about the question in real-time, you can reach out via [our gitter channel][gitter]. |
| 25 | + |
| 26 | +## <a name="issue"></a> Found a Bug? |
| 27 | +If you find a bug in the source code, you can help us by |
| 28 | +[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can |
| 29 | +[submit a Pull Request](#submit-pr) with a fix. |
| 30 | + |
| 31 | +## <a name="feature"></a> Missing a Feature? |
| 32 | +You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub |
| 33 | +Repository. If you would like to *implement* a new feature, please submit an issue with |
| 34 | +a proposal for your work first, to be sure that we can use it. |
| 35 | +Please consider what kind of change it is: |
| 36 | + |
| 37 | +* For a **Major Feature**, first open an issue and outline your proposal so that it can be |
| 38 | +discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, |
| 39 | +and help you to craft the change so that it is successfully accepted into the project. |
| 40 | +* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). |
| 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 of workarounds readily available. |
| 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. In order to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario using http://plnkr.co. Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional questions like: |
| 49 | + |
| 50 | +- version of ng2-admin used |
| 51 | +- 3rd-party libraries and their versions |
| 52 | +- and most importantly - a use-case that fails |
| 53 | + |
| 54 | +A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem. |
| 55 | + |
| 56 | +We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it. |
| 57 | + |
| 58 | +Unfortunately we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you we are going to close an issue that don't have enough info to be reproduced. |
| 59 | + |
| 60 | +You can file new issues by filling out our [new issue form](https://github.com/akveo/ng2-admin/issues/new). |
| 61 | + |
| 62 | + |
| 63 | +### <a name="submit-pr"></a> Submitting a Pull Request (PR) |
| 64 | +Before you submit your Pull Request (PR) consider the following guidelines: |
| 65 | + |
| 66 | +* Search [GitHub](https://github.com/akveo/ng2-admin/pulls) for an open or closed PR |
| 67 | + that relates to your submission. You don't want to duplicate effort. |
| 68 | +* Make your changes in a new git branch: |
| 69 | + |
| 70 | + ```shell |
| 71 | + git checkout -b my-fix-branch master |
| 72 | + ``` |
| 73 | + |
| 74 | +* Commit your changes using a descriptive commit message that follows our |
| 75 | + [commit message conventions](#commit). Adherence to these conventions |
| 76 | + is necessary because release notes are automatically generated from these messages. |
| 77 | + |
| 78 | + ```shell |
| 79 | + git commit -a |
| 80 | + ``` |
| 81 | + Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. |
| 82 | + |
| 83 | +* Push your branch to GitHub: |
| 84 | + |
| 85 | + ```shell |
| 86 | + git push origin my-fix-branch |
| 87 | + ``` |
| 88 | + |
| 89 | +* In GitHub, send a pull request to `ng2-admin:master`. |
| 90 | +* If we suggest changes then: |
| 91 | + * Make the required updates. |
| 92 | + * Rebase your branch and force push to your GitHub repository (this will update your Pull Request): |
| 93 | + |
| 94 | + ```shell |
| 95 | + git rebase master -i |
| 96 | + git push -f |
| 97 | + ``` |
| 98 | + |
| 99 | +That's it! Thank you for your contribution! |
| 100 | +
|
| 101 | +#### After your pull request is merged |
| 102 | +
|
| 103 | +After your pull request is merged, you can safely delete your branch and pull the changes |
| 104 | +from the main (upstream) repository: |
| 105 | +
|
| 106 | +* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: |
| 107 | +
|
| 108 | + ```shell |
| 109 | + git push origin --delete my-fix-branch |
| 110 | + ``` |
| 111 | +
|
| 112 | +* Check out the master branch: |
| 113 | +
|
| 114 | + ```shell |
| 115 | + git checkout master -f |
| 116 | + ``` |
| 117 | +
|
| 118 | +* Delete the local branch: |
| 119 | +
|
| 120 | + ```shell |
| 121 | + git branch -D my-fix-branch |
| 122 | + ``` |
| 123 | +
|
| 124 | +* Update your master with the latest upstream version: |
| 125 | +
|
| 126 | + ```shell |
| 127 | + git pull --ff upstream master |
| 128 | + ``` |
| 129 | +
|
| 130 | +## <a name="commit"></a> Commit Message Guidelines |
| 131 | +
|
| 132 | +We have very precise rules over how our git commit messages can be formatted. This leads to **more |
| 133 | +readable messages** that are easy to follow when looking through the **project history**. But also, |
| 134 | +we use the git commit messages to **generate the ng2-admin change log**. |
| 135 | +
|
| 136 | +### Commit Message Format |
| 137 | +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special |
| 138 | +format that includes a **type**, a **scope** and a **subject**: |
| 139 | +
|
| 140 | +``` |
| 141 | +<type>(<scope>): <subject> |
| 142 | +<BLANK LINE> |
| 143 | +<body> |
| 144 | +<BLANK LINE> |
| 145 | +<footer> |
| 146 | +``` |
| 147 | +
|
| 148 | +The **header** is mandatory and the **scope** of the header is optional. |
| 149 | +
|
| 150 | +Any line of the commit message cannot be longer 100 characters! This allows the message to be easier |
| 151 | +to read on GitHub as well as in various git tools. |
| 152 | +
|
| 153 | +Footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any. |
| 154 | +
|
| 155 | +Samples: (even more [samples](https://github.com/akveo/ng2-admin/commits/master)) |
| 156 | +
|
| 157 | +``` |
| 158 | +docs(changelog): update change log to beta.5 |
| 159 | +``` |
| 160 | +``` |
| 161 | +fix(release): need to depend on latest rxjs and zone.js |
| 162 | +
|
| 163 | +The version in our package.json gets copied to the one we publish, and users need the latest of these. |
| 164 | +``` |
| 165 | +
|
| 166 | +### Revert |
| 167 | +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. |
| 168 | +
|
| 169 | +### Type |
| 170 | +Must be one of the following: |
| 171 | +
|
| 172 | +* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
| 173 | +* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
| 174 | +* **docs**: Documentation only changes |
| 175 | +* **feat**: A new feature |
| 176 | +* **fix**: A bug fix |
| 177 | +* **perf**: A code change that improves performance |
| 178 | +* **refactor**: A code change that neither fixes a bug nor adds a feature |
| 179 | +* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing |
| 180 | + semi-colons, etc) |
| 181 | +* **test**: Adding missing tests or correcting existing tests |
| 182 | +
|
| 183 | +### Scope |
| 184 | +The scope should be the name of the npm package affected (as perceived by person reading changelog generated from commit messages. |
| 185 | +
|
| 186 | +The following is the list of supported scopes: |
| 187 | +
|
| 188 | +* **dashboard** |
| 189 | +* **editors** |
| 190 | +* **components** |
| 191 | +* **charts** |
| 192 | +* **ui-features** |
| 193 | +* **form-elements** |
| 194 | +* **tables** |
| 195 | +* **maps** |
| 196 | +* **pages** |
| 197 | +* **menu-level** |
| 198 | +* **external-link** |
| 199 | +* **sidebar** |
| 200 | +* **profile** |
| 201 | +* **settings** |
| 202 | +* **validator** |
| 203 | +
|
| 204 | +### Subject |
| 205 | +The subject contains succinct description of the change: |
| 206 | +
|
| 207 | +* use the imperative, present tense: "change" not "changed" nor "changes" |
| 208 | +* don't capitalize first letter |
| 209 | +* no dot (.) at the end |
| 210 | + |
| 211 | +### Body |
| 212 | +Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". |
| 213 | +The body should include the motivation for the change and contrast this with previous behavior. |
| 214 | + |
| 215 | +### Footer |
| 216 | +The footer should contain any information about **Breaking Changes** and is also the place to |
| 217 | +reference GitHub issues that this commit **Closes**. |
| 218 | + |
| 219 | +**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this. |
| 220 | + |
| 221 | +A detailed explanation can be found in this [document][commit-message-format]. |
| 222 | + |
| 223 | + |
| 224 | +[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# |
| 225 | +[github]: https://github.com/akveo/ng2-admin |
| 226 | +[gitter]: https://gitter.im/ng2-admin |
| 227 | +[jsfiddle]: http://jsfiddle.net |
| 228 | +[plunker]: http://plnkr.co/edit |
0 commit comments