|
| 1 | +# Contributing to ng2-semantic-ui |
| 2 | + |
| 3 | +Your contribution will be greatly appreciated, and will help ng2-semantic-ui get even better! As a contributor, here are the guidelines to follow: |
| 4 | + |
| 5 | +* [Code of Conduct](#codeofconduct) |
| 6 | +* [Bug, Question or Problem?](#bugquestionorproblem) |
| 7 | +* [Feature Requests](#missingafeature) |
| 8 | +* [Submission Guidelines](#submissionguidelines) |
| 9 | +* [Coding Rules](#codingrules) |
| 10 | +* [Commit Messages](#commitmessages) |
| 11 | + |
| 12 | +## Code of Conduct |
| 13 | + |
| 14 | +Please read and follow the [Code of Conduct](https://github.com/edcarroll/ng2-semantic-ui/blob/master/CODE_OF_CONDUCT.md). |
| 15 | + |
| 16 | +## Bug, Question or Problem? |
| 17 | + |
| 18 | +For any usage questions you have, you can join [Gitter](https://gitter.im/ng2-semantic-ui/usage-queries) to ask for help. |
| 19 | + |
| 20 | +If you've found a bug, please submit an issue. Even better would be submitting a Pull Request with a fix. |
| 21 | + |
| 22 | +## Missing a Feature? |
| 23 | + |
| 24 | +You can *request* a new feature by [submitting an issue](#submittinganissue) to the GitHub |
| 25 | +Repository. If you would like to *implement* a new feature, please submit an issue with |
| 26 | +a proposal for your work first, to be sure that it can be used. |
| 27 | +Please consider what kind of change it is: |
| 28 | + |
| 29 | +* For a **Major Feature**, first open an issue and outline your proposal so that it can be |
| 30 | +discussed. This will also allow better coordination of efforts, prevent duplication of work, |
| 31 | +and help you to craft the change so that it is successfully accepted into the project. |
| 32 | +* **Small Features** can be crafted and directly [submitted as a Pull Request](#submittingapullrequest). |
| 33 | + |
| 34 | +## Submission Guidelines |
| 35 | + |
| 36 | +### Submitting an Issue |
| 37 | + |
| 38 | +Before you submit an issue, please search the issue tracker, as an issue for your problem may already exist and the discussion might inform you of readily available workarounds. |
| 39 | + |
| 40 | +Ideally all issues are fixed as soon as possible, but before that can be done the bug must be confirmed. This is done by providing a minimal reproduction scenario using [http://plunkr.co](http://plunkr.co). Having a live, reproducible scenario provides a wealth of important information without needing to go back & forth to you with additional queries such as: |
| 41 | + |
| 42 | +* Angular version used |
| 43 | +* ng2-semantic-ui version used |
| 44 | +* 3rd-party libraries used, if any |
| 45 | +* Most importantly - a use-case that fails |
| 46 | + |
| 47 | +A minimal reproduce scenario using [http://plunkr.co](http://plunkr.co) allows quick confirmation of a bug (or coding problem) and also confirms that the right problem is being fixed. Issues filed that do not include this (or a standalone git repository demonstrating the problem) won't be looked at until they do. |
| 48 | + |
| 49 | +You can file new issues by filling out the [issue form](https://github.com/edcarroll/ng2-semantic-ui/issues/new) |
| 50 | + |
| 51 | +### Submitting a Pull Request |
| 52 | + |
| 53 | +Before submitting a Pull Request (PR) consider the following guidelines: |
| 54 | + |
| 55 | +* Search the Github [pull requests](https://github.com/edcarroll/ng2-semantic-ui/pulls) for an open or closed PR relating to your submission (to avoid duplicating effort). |
| 56 | + |
| 57 | +* Make your changes in a new git branch: |
| 58 | + |
| 59 | + ```shell |
| 60 | + $ git checkout -b my-fix-branch master |
| 61 | + ``` |
| 62 | + |
| 63 | +* Create your patch |
| 64 | + |
| 65 | +* Follow the [Coding Rules](#codingrules), running the linter (`npm run lint`) to catch any errors |
| 66 | + |
| 67 | +* Commit your changes using a descriptive commit message that follows the [commit message conventions](#commitmessages) |
| 68 | + |
| 69 | +* Push your branch to GitHub: |
| 70 | + |
| 71 | + ```shell |
| 72 | + $ git push origin my-fix-branch |
| 73 | + ``` |
| 74 | + |
| 75 | +* In GitHub, send a pull request to `ng2-semantic-ui:master`. |
| 76 | + |
| 77 | +* If changes are suggested: |
| 78 | + - Make the required updates |
| 79 | + - Ensure the changes follow the coding rules |
| 80 | + - Push your changes to GitHub. |
| 81 | + |
| 82 | +## Coding Rules |
| 83 | + |
| 84 | +This project uses [tslint](https://palantir.github.io/tslint/) to maintain a consistent code style. You can run `npm run lint` in the project directory to lint the code. |
| 85 | + |
| 86 | +The primary rules followed by this library are: |
| 87 | + |
| 88 | +* 4 space indentation |
| 89 | +* Double quotes (`"`) rather than single quotes (`'`) |
| 90 | +* No whitespace for type definitions (i.e. `example:string`) |
| 91 | +* PascalCase for class names, interfaces & **exported** constants |
| 92 | + - Interfaces prefixed with I |
| 93 | +* camelCase for local variables (`const`) |
| 94 | + - Private fields prefixed with `_` |
| 95 | +* Label all class members with modifiers (including `public`) |
| 96 | +* Class member ordering, first to last: |
| 97 | + - static fields, instance fields, constructor, static methods, instance methods |
| 98 | +
|
| 99 | +## Commit Messages |
| 100 | +
|
| 101 | +To maintain readability and easy understanding of commits, all messages (excluding body) should be of the format: |
| 102 | +
|
| 103 | +``` |
| 104 | +<type>(<scope>): <subject> |
| 105 | +``` |
| 106 | +
|
| 107 | +The **scope** is optional, if the commit addresses multiple things. Please try to keep messages under 100 characters. |
| 108 | +
|
| 109 | +### Type |
| 110 | +
|
| 111 | +Must be one of the following: |
| 112 | +
|
| 113 | +* chore: Changes to build scripts |
| 114 | +* docs: Changes to the documentation |
| 115 | +* demo: Changes to the demo app (that don't include updated documentation) |
| 116 | +* feat: New feature |
| 117 | +* fix: Bug fix |
| 118 | +* refactor: Code change that neither fixes a bug nor adds a feature |
| 119 | +* style: Changes that don't affect the code's meaning (formatting etc.) |
| 120 | +* test: Adding / updating tests |
| 121 | +
|
| 122 | +### Scope |
| 123 | +
|
| 124 | +Scope is generally the name of the component that is being changed. If a commit affects multiple components, then omit the scope, and add it to the message body. |
0 commit comments