| 14217 |
anikendra |
1 |
Contributing to typeahead.js
|
|
|
2 |
============================
|
|
|
3 |
|
|
|
4 |
*These contributing guidelines were proudly stolen from the
|
|
|
5 |
[Flight](https://github.com/flightjs/flight) project*
|
|
|
6 |
|
|
|
7 |
Looking to contribute something to typeahead.js? Here's how you can help.
|
|
|
8 |
|
|
|
9 |
Bugs Reports
|
|
|
10 |
------------
|
|
|
11 |
|
|
|
12 |
A bug is a _demonstrable problem_ that is caused by the code in the
|
|
|
13 |
repository. Good bug reports are extremely helpful – thank you!
|
|
|
14 |
|
|
|
15 |
Guidelines for bug reports:
|
|
|
16 |
|
|
|
17 |
1. **Use the GitHub issue search** — check if the issue has already been
|
|
|
18 |
reported.
|
|
|
19 |
|
|
|
20 |
2. **Check if the issue has been fixed** — try to reproduce it using the
|
|
|
21 |
latest `master` or integration branch in the repository.
|
|
|
22 |
|
|
|
23 |
3. **Isolate the problem** — ideally create a reduced test
|
|
|
24 |
case and a live example.
|
|
|
25 |
|
|
|
26 |
4. Please try to be as detailed as possible in your report. Include specific
|
|
|
27 |
information about the environment – operating system and version, browser
|
|
|
28 |
and version, version of typeahead.js – and steps required to reproduce the
|
|
|
29 |
issue.
|
|
|
30 |
|
|
|
31 |
Feature Requests & Contribution Enquiries
|
|
|
32 |
-----------------------------------------
|
|
|
33 |
|
|
|
34 |
Feature requests are welcome. But take a moment to find out whether your idea
|
|
|
35 |
fits with the scope and aims of the project. It's up to *you* to make a strong
|
|
|
36 |
case for the inclusion of your feature. Please provide as much detail and
|
|
|
37 |
context as possible.
|
|
|
38 |
|
|
|
39 |
Contribution enquiries should take place before any significant pull request,
|
|
|
40 |
otherwise you risk spending a lot of time working on something that we might
|
|
|
41 |
have good reasons for rejecting.
|
|
|
42 |
|
|
|
43 |
Pull Requests
|
|
|
44 |
-------------
|
|
|
45 |
|
|
|
46 |
Good pull requests – patches, improvements, new features – are a fantastic
|
|
|
47 |
help. They should remain focused in scope and avoid containing unrelated
|
|
|
48 |
commits.
|
|
|
49 |
|
|
|
50 |
Make sure to adhere to the coding conventions used throughout the codebase
|
|
|
51 |
(indentation, accurate comments, etc.) and any other requirements (such as test
|
|
|
52 |
coverage).
|
|
|
53 |
|
|
|
54 |
Please follow this process; it's the best way to get your work included in the
|
|
|
55 |
project:
|
|
|
56 |
|
|
|
57 |
1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
|
|
|
58 |
and configure the remotes:
|
|
|
59 |
|
|
|
60 |
```bash
|
|
|
61 |
# Clone your fork of the repo into the current directory
|
|
|
62 |
git clone https://github.com/<your-username>/typeahead.js
|
|
|
63 |
# Navigate to the newly cloned directory
|
|
|
64 |
cd <repo-name>
|
|
|
65 |
# Assign the original repo to a remote called "upstream"
|
|
|
66 |
git remote add upstream git://github.com/twitter/typeahead.js
|
|
|
67 |
```
|
|
|
68 |
|
|
|
69 |
2. If you cloned a while ago, get the latest changes from upstream:
|
|
|
70 |
|
|
|
71 |
```bash
|
|
|
72 |
git checkout master
|
|
|
73 |
git pull upstream master
|
|
|
74 |
```
|
|
|
75 |
|
|
|
76 |
3. Install the dependencies (you must have Node.js and [Bower](http://bower.io)
|
|
|
77 |
installed), and create a new topic branch (off the main project development
|
|
|
78 |
branch) to contain your feature, change, or fix:
|
|
|
79 |
|
|
|
80 |
```bash
|
|
|
81 |
npm install
|
|
|
82 |
bower install
|
|
|
83 |
git checkout -b <topic-branch-name>
|
|
|
84 |
```
|
|
|
85 |
|
|
|
86 |
4. Make sure to update, or add to the tests when appropriate. Patches and
|
|
|
87 |
features will not be accepted without tests. Run `npm test` to check that
|
|
|
88 |
all tests pass after you've made changes.
|
|
|
89 |
|
|
|
90 |
5. Commit your changes in logical chunks. Provide clear and explanatory commit
|
|
|
91 |
messages. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up
|
|
|
92 |
your commits before making them public.
|
|
|
93 |
|
|
|
94 |
6. Locally merge (or rebase) the upstream development branch into your topic branch:
|
|
|
95 |
|
|
|
96 |
```bash
|
|
|
97 |
git pull [--rebase] upstream master
|
|
|
98 |
```
|
|
|
99 |
|
|
|
100 |
7. Push your topic branch up to your fork:
|
|
|
101 |
|
|
|
102 |
```bash
|
|
|
103 |
git push origin <topic-branch-name>
|
|
|
104 |
```
|
|
|
105 |
|
|
|
106 |
8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
|
|
107 |
with a clear title and description.
|
|
|
108 |
|
|
|
109 |
9. If you are asked to amend your changes before they can be merged in, please
|
|
|
110 |
use `git commit --amend` (or rebasing for multi-commit Pull Requests) and
|
|
|
111 |
force push to your remote feature branch. You may also be asked to squash
|
|
|
112 |
commits.
|
|
|
113 |
|
|
|
114 |
License
|
|
|
115 |
-------
|
|
|
116 |
|
|
|
117 |
By contributing your code,
|
|
|
118 |
|
|
|
119 |
You agree to license your contribution under the terms of the MIT License
|
|
|
120 |
https://github.com/twitter/typeahead.js/blob/master/LICENSE
|