]> git.gir.st - VimFx.git/blob - CONTRIBUTING.md
Make `require` more like Node.js
[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 Break up your pull request in several commits if necessary. The first line of
85 commit messages should be a short summary. Add a blank line and then a nicely
86 formatted markdown description after it if needed.
87
88 Finally send a pull request to same branch as you based your topic branch on
89 (master or develop).
90
91 ### Building VimFx
92
93 1. Install [Node.js].
94 2. Run `npm install` to download dependencies and development dependencies.
95 3. Run `npm install -g gulp` to be able to run [`gulp`][gulp] commands.
96 (Alternatively, you may use `./node_modules/.bin/gulp`.)
97 4. Create a new Firefox profile for development.
98 5. Install the [Extension Auto-Installer] add-on in your development profile.
99
100 - `gulp build` creates the `build/` directory. It is basically a copy of the
101 `extension/` directory, with the .coffee files compiled to .js.
102 - `gulp xpi` zips up the `build/` directory into `build/VimFx.xpi`.
103 - `gulp push` (or just `gulp`) pushes `build/VimFx.xpi` to
104 `http://localhost:8888`, which causes the Extension Auto-Installer to
105 automatically install it. (No need to restart Firefox.)
106 - `gulp clean` removes the `build/` directory.
107 - `gulp lint` lints your code.
108
109 An easy workflow is code, `gulp`, test, repeat.
110
111 [Node.js]: http://nodejs.org/
112 [gulp]: https://github.com/gulpjs/gulp
113 [Extension Auto-Installer]: https://addons.mozilla.org/firefox/addon/autoinstaller
114
115 ### Making a release
116
117 1. Add a list of changes since the last version at the top of CHANGELOG.md.
118 2. Update the version in package.json (see above about versioning), and, if
119 needed, the min and max Firefox versions.
120 3. Run `gulp release`, which does the following for you:
121 - Adds a heading with the new version number and today’s date at the top of
122 CHANGELOG.md.
123 - Commits CHANGELOG.md and package.json.
124 - Tags the commit.
125 4. Run `gulp xpi` to rebuild with the new version number.
126 5. Push to github. Don’t forget to push the tag!
127 6. Make a “release” out of the new tag on github, and attach VimFx.xpi to it.
128 7. Publish on addons.mozilla.org. Add the release notes list as HTML.
Imprint / Impressum