]> git.gir.st - VimFx.git/blob - CONTRIBUTING.md
Merge branch 'blacklist-keys' of https://github.com/harsh1618/VimFx into harsh1618...
[VimFx.git] / CONTRIBUTING.md
1 # Contributing
2
3 ## Reporting issues
4
5 First off, write in English!
6
7 Secondly, search both open and closed issues, to avoid duplicates.
8
9 Include this in bug reports:
10
11 - VimFx version, Firefox version, keyboard layout and operating system.
12 - Steps to reproduce.
13 - Whether the bug is a regression or not (if you know). Bonus points for
14 telling since when the bug appeared.
15
16 If you’re suggesting a new feature always state your use case. Try to do it
17 both in general and with a really specific example.
18
19 Lastly, don’t hesitate to open issues!
20
21
22 ## Localizing
23
24 Contribute your localization! See `locale` folder.
25
26 Send your pull request to the **master** branch (no matter if it is a new
27 locale or an update to an existing one).
28
29
30 ## Developing
31
32 ### Versioning and branches
33
34 VimFx uses three numbers to describe its version: x.y.z, or major.minor.patch.
35 However, in reality it is more like 0.y.z. The first number (major) won’t
36 change until we feel that we don’t have any major changes coming. So until then
37 it is only worth describing the two other numbers.
38
39 The middle number (minor) is incremented when a release contains new features,
40 major refactors or changes to defaults. The idea is that when a user installs a
41 new minor release, they should expect changes that they need to get familiar
42 with.
43
44 The last number (patch) is incremented when a release contains only (simple)
45 bugfixes, new localizations and updates to localizations. If a user installs a
46 new patch release they shouldn’t have to get familiar with anything. Things
47 should be like they were before, just a little better.
48
49 VimFx uses two branches: **master** and **develop**. master is the latest
50 stable version plus trivial bugfixes. develop is the next minor version. master
51 is merged into develop when needed, and develop is merged into master before it
52 is going to be released.
53
54 In short, “backwards-incomptaible” changes and new features go into the develop
55 branch, while most other things go into the master branch.
56
57 ### Pull requests
58
59 Create a new topic branch, based on either master or develop. See above.
60
61 git checkout -b myTopicBranch master
62 # or
63 git checkout -b myTopicBranch develop
64
65 Code! Try to follow the following simple rules:
66
67 - Always use parenthesis when calling functions.
68 - Always use explicit `return`s, unless the function is a one-liner.
69 - Always use single quotes, unless you use interpolation.
70 - Prefer interpolation over concatenation, both in strings and in regexes.
71 - Always use the following forms (not any aliases):
72 - `true` and `false`
73 - `==` and `!=`
74 - `and` and `or`
75 - `not`
76 - Put spaces inside `[]` and `{}` when destructuring and interpolating, but not
77 in array and object literals.
78 - Comment when necessary. Comments should be full sentences.
79 - Try to keep lines at most 80 characters long.
80 - Indent using two spaces.
81
82 Please lint your code. See below.
83
84 Run the tests and make sure that all pass. See below. Add tests if possible.
85
86 Break up your pull request in several commits if necessary. The first line of
87 commit messages should be a short summary. Add a blank line and then a nicely
88 formatted markdown description after it if needed.
89
90 Finally send a pull request to same branch as you based your topic branch on
91 (master or develop).
92
93 ### Building VimFx
94
95 1. Install [Node.js].
96 2. Run `npm install` to download dependencies and development dependencies.
97 3. Run `npm install -g gulp` to be able to run [`gulp`][gulp] commands.
98 (Alternatively, you may use `./node_modules/.bin/gulp`.)
99 4. Create a new Firefox profile for development.
100 5. Install the [Extension Auto-Installer] add-on in your development profile.
101
102 - `gulp build` creates the `build/` directory. It is basically a copy of the
103 `extension/` directory, with the .coffee files compiled to .js.
104 - `gulp xpi` zips up the `build/` directory into `build/VimFx.xpi`.
105 - `gulp push` (or just `gulp`) pushes `build/VimFx.xpi` to
106 `http://localhost:8888`, which causes the Extension Auto-Installer to
107 automatically install it. (No need to restart Firefox.)
108 - `gulp clean` removes the `build/` directory.
109 - `gulp lint` lints your code.
110 - Use the `--test` or `-t` option to include the unit test files. The output of
111 the tests are `console.log`ed. See the browser console, or start Firefox from
112 the command line to see it.
113
114 An easy workflow is code, `gulp`, test, repeat. (Use `gulp -t` to also run the
115 unit tests.)
116
117 [Node.js]: http://nodejs.org/
118 [gulp]: https://github.com/gulpjs/gulp
119 [Extension Auto-Installer]: https://addons.mozilla.org/firefox/addon/autoinstaller
120
121 ### Making a release
122
123 1. Add a list of changes since the last version at the top of CHANGELOG.md.
124 2. Update the version in package.json (see above about versioning), and, if
125 needed, the min and max Firefox versions.
126 3. Run `gulp release`, which does the following for you:
127 - Adds a heading with the new version number and today’s date at the top of
128 CHANGELOG.md.
129 - Commits CHANGELOG.md and package.json.
130 - Tags the commit.
131 4. Run `gulp xpi` to rebuild with the new version number.
132 5. Push to github. Don’t forget to push the tag!
133 6. Make a “release” out of the new tag on github, and attach VimFx.xpi to it.
134 7. Publish on addons.mozilla.org. Add the release notes list as HTML.
Imprint / Impressum