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