|
| 1 | +# Contributing to this project |
| 2 | + |
| 3 | +Please take a moment to review this document in order to make the contribution |
| 4 | +process easy and effective for everyone involved. |
| 5 | + |
| 6 | +Following these guidelines will help us get back to you more quickly, and will |
| 7 | +show that you care about making Chosen better just like we do. In return, we'll |
| 8 | +do our best to respond to your issue or pull request as soon as possible with |
| 9 | +the same respect. |
| 10 | + |
| 11 | +_**Please Note:** These guidelines are adapted from [@necolas](https://github.com/necolas)'s |
| 12 | +[issue-guidelines](https://github.com/necolas/issue-guidelines) and serve as |
| 13 | +an excellent starting point for contributing to any open source project._ |
| 14 | + |
| 15 | + |
| 16 | +## Using the issue tracker |
| 17 | + |
| 18 | +The [issue tracker](https://github.com/harvesthq/chosen/issues) is the |
| 19 | +preferred channel for [bug reports](#bugs), [features requests](#features) |
| 20 | +and [submitting pull requests](#pull-requests), but please respect the |
| 21 | +following restrictions: |
| 22 | + |
| 23 | +* Please **do not** use the issue tracker for personal support requests (use |
| 24 | + [Stack Overflow](http://stackoverflow.com)). |
| 25 | + |
| 26 | +* Please **do not** derail or troll issues. Keep the discussion on topic and |
| 27 | + respect the opinions of others. |
| 28 | + |
| 29 | + |
| 30 | +<a name="bugs"></a> |
| 31 | +## Bug reports |
| 32 | + |
| 33 | +A bug is a _demonstrable problem_ that is caused by the code in the repository. |
| 34 | +Good bug reports are extremely helpful — thank you! |
| 35 | + |
| 36 | +Guidelines for bug reports: |
| 37 | + |
| 38 | +1. **Use the [GitHub issue search](https://github.com/harvesthq/chosen/search?type=Issues)** — check if the issue has already been |
| 39 | + reported. |
| 40 | + |
| 41 | +2. **Check if the bug has already been fixed** — try to reproduce it using the |
| 42 | + repository's latest `master` changes. |
| 43 | + |
| 44 | +3. **Isolate the problem** — ideally create a [reduced test |
| 45 | + case](http://css-tricks.com/6263-reduced-test-cases/) and a live example |
| 46 | + (perhaps a [fiddle](http://jsfiddle.net)). |
| 47 | + |
| 48 | +A good bug report shouldn't leave others needing to contact you for more |
| 49 | +information. Please try to be as detailed as possible in your report. What is |
| 50 | +your environment? What steps will reproduce the issue? What browser(s) and OS |
| 51 | +experience the problem? What outcome did you expect, and how did it differ from |
| 52 | +what you actually saw? All these details will help people to fix any potential |
| 53 | +bugs. |
| 54 | + |
| 55 | +Example: |
| 56 | + |
| 57 | +> Short and descriptive example bug report title |
| 58 | +> |
| 59 | +> A summary of the issue and the browser/OS environment in which it occurs. If |
| 60 | +> suitable, include the steps required to reproduce the bug. |
| 61 | +> |
| 62 | +> 1. This is the first step |
| 63 | +> 2. This is the second step |
| 64 | +> 3. Further steps, etc. |
| 65 | +> |
| 66 | +> `<url>` - a link to the reduced test case |
| 67 | +> |
| 68 | +> Any other information you want to share that is relevant to the issue being |
| 69 | +> reported. This might include the lines of code that you have identified as |
| 70 | +> causing the bug, and potential solutions (and your opinions on their |
| 71 | +> merits). |
| 72 | +
|
| 73 | + |
| 74 | +<a name="features"></a> |
| 75 | +## Feature requests |
| 76 | + |
| 77 | +Feature requests are welcome. But take a moment to find out whether your idea |
| 78 | +fits with the scope and aims of the project. It's up to *you* to make a strong |
| 79 | +case to convince the project's developers of the merits of this feature. Please |
| 80 | +provide as much detail and context as possible. |
| 81 | + |
| 82 | +Building something great means choosing features carefully especially because it |
| 83 | +is much, much easier to add features than it is to take them away. Additions |
| 84 | +to Chosen will be evaluated on a combination of scope (how well it fits into the |
| 85 | +project), maintenance burden and general usefulness. |
| 86 | + |
| 87 | +Creating something great often means saying no to seemingly good ideas. Don't |
| 88 | +dispair if your feature request isn't accepted, take action! Fork the |
| 89 | +repository, build your idea and share it with others. We released Chosen under |
| 90 | +the MIT License for this purpose precisely. Open source works best when smart |
| 91 | +and dedicated people riff off of each others' ideas to make even greater things. |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +<a name="pull-requests"></a> |
| 96 | +## Pull requests |
| 97 | + |
| 98 | +Good pull requests — patches, improvements, new features — are a fantastic help. |
| 99 | +They should remain focused in scope and avoid containing unrelated commits. |
| 100 | + |
| 101 | +**Please ask first** before embarking on any significant pull request (e.g. |
| 102 | +implementing features, refactoring code, porting to a different language), |
| 103 | +otherwise you risk spending a lot of time working on something that the |
| 104 | +project's developers might not want to merge into the project. You can solicit |
| 105 | +feedback and opinions in an open feature request thread or create a new one. |
| 106 | + |
| 107 | +Please use the [git flow for pull requesets](#git-flow) and follow Chosen's |
| 108 | +[code conventions](#code-conventions) before submitting your work. Adhering to |
| 109 | +these guidelines is the best way to get your work included in Chosen. |
| 110 | + |
| 111 | +<a name="git-flow"></a> |
| 112 | +#### Git Flow for pull requests |
| 113 | + |
| 114 | +1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, |
| 115 | + and configure the remotes: |
| 116 | + |
| 117 | + ```bash |
| 118 | + # Clone your fork of the repo into the current directory |
| 119 | + git clone [email protected]: <YOUR_USERNAME >/chosen.git |
| 120 | + # Navigate to the newly cloned directory |
| 121 | + cd chosen |
| 122 | + # Assign the original repo to a remote called "upstream" |
| 123 | + git remote add upstream https://github.com/harvesthq/chosen |
| 124 | + ``` |
| 125 | + |
| 126 | +2. If you cloned a while ago, get the latest changes from upstream: |
| 127 | + |
| 128 | + ```bash |
| 129 | + git checkout master |
| 130 | + git pull upstream master |
| 131 | + ``` |
| 132 | + |
| 133 | +3. Create a new topic branch (off the main project development branch) to |
| 134 | + contain your feature, change, or fix: |
| 135 | + |
| 136 | + ```bash |
| 137 | + git checkout -b <topic-branch-name> |
| 138 | + ``` |
| 139 | + |
| 140 | +4. Commit your changes in logical chunks. Please adhere to these [git commit |
| 141 | + message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) |
| 142 | + or your code is unlikely be merged into the main project. Use Git's |
| 143 | + [interactive rebase](https://help.github.com/articles/interactive-rebase) |
| 144 | + feature to tidy up your commits before making them public. |
| 145 | + |
| 146 | +5. Locally merge (or rebase) the upstream development branch into your topic branch: |
| 147 | + |
| 148 | + ```bash |
| 149 | + git pull [--rebase] upstream master |
| 150 | + ``` |
| 151 | + |
| 152 | +6. Push your topic branch up to your fork: |
| 153 | + |
| 154 | + ```bash |
| 155 | + git push origin <topic-branch-name> |
| 156 | + ``` |
| 157 | + |
| 158 | +7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) |
| 159 | + with a clear title and description. |
| 160 | + |
| 161 | +**IMPORTANT**: By submitting a patch, you agree to allow the project owner to |
| 162 | +license your work under the [MIT License](http://en.wikipedia.org/wiki/MIT_License). |
| 163 | + |
| 164 | +<a name="code-conventions"></a> |
| 165 | +#### Chosen Code Conventions |
| 166 | + |
| 167 | +1. Make all changes in CoffeeScript files, **not** JavaScript files. |
| 168 | +2. Use [cake](#cake) to build the JavaScript files. |
| 169 | +3. For feature changes, update both jQuery *and* Prototype versions |
| 170 | +4. Don't touch the `VERSION` file |
| 171 | + |
| 172 | +<a name="cake"></a> |
| 173 | +#### Using CoffeeScript and Cake |
| 174 | + |
| 175 | +First, make sure you have the proper CoffeeScript / Cake setup in place. We have added a package.json that makes this easy: |
| 176 | + |
| 177 | +``` |
| 178 | +npm install -d |
| 179 | +``` |
| 180 | + |
| 181 | +This will install `coffee-script` and `uglifyjs`. |
| 182 | + |
| 183 | +Once you're configured, building the JavaScript from the command line is easy: |
| 184 | + |
| 185 | + cake build # build Chosen from source |
| 186 | + cake watch # watch coffee/ for changes and build Chosen |
| 187 | + |
| 188 | +If you're interested, you can find the recipes in [Cakefile](https://github.com/harvesthq/chosen/blob/master/Cakefile). |
0 commit comments