Debian Codegraph @

extensions/VisualEditor/lib/ve/CONTRIBUTING.md

raw symbols SCIP
1 # Contributing to VisualEditor
2
3 Thank you for helping us develop VisualEditor!
4
5 This document describes how to report bugs, set up your development
6 environment, run tests, and build documentation. It also provides the coding
7 conventions we use in the project.
8
9 ## Bug reports
10
11 Please report bugs to [phabricator.wikimedia.org](https://phabricator.wikimedia.org/maniphest/task/create/?projects=VisualEditor)
12 using the `VisualEditor` project.
13
14 ## Running tests
15
16 VisualEditor's build scripts use the [Grunt](http://gruntjs.com/) task runner.
17 To install it make sure you have [node and npm](http://nodejs.org/download/)
18 installed, then run:
19
20 ```sh
21 # Install Grunt command-line utility
22 $ npm install -g grunt-cli
23
24 # Install VisualEditor's dev dependencies
25 $ npm install
26 ```
27
28 Set `FIREFOX_BIN` – you may wish to add this to your `.bashrc` or equivalent:
29 ```sh
30 export FIREFOX_BIN=`which firefox`
31 ```
32
33 To run the tests, use:
34 ```sh
35 $ grunt test
36 ```
37
38 For other grunt tasks, see:
39 ```sh
40 $ grunt --help
41 ```
42
43 To run the tests in a web browser, open `tests/index.html`.
44
45 ## Building documentation
46
47 VisualEditor uses [jsdoc](https://jsdoc.app/) to process documentation comments
48 embedded in the code. To build the documentation, you will need to run `npm run doc`.
49
50 ## VisualEditor Code Guidelines
51
52 We inherit the code structure (about whitespace, naming and comments) conventions
53 from MediaWiki. See [Manual:Coding conventions/JavaScript](https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript)
54 on mediawiki.org.
55
56 Git commit messages should follow the conventions described in
57 <https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines>.
58
59 ### Documentation comments
60
61 In addition to the [MediaWiki conventions for JavaScript documentation](https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Documentation):
62
63 We have the following custom tags:
64
65 * @until Text: Optional text.
66 * @source Text
67 * @context {Type} Optional text.
68 * @fires name
69
70 They should be used in the order as they are described here. Here's a slightly more complete list
71 indicating their order between the standard tags.
72
73 * @property
74 * @until Text: Optional text.
75 * @source Text
76 * @context {Type} Optional text.
77 * @inheritable
78 * @param
79 * @fires name
80 * @return
81
82 ### Adding a new JavaScript class
83
84 When a new JavaScript class is added, the file must be referenced in the build manifest
85 before it can be used. Add the file to build/modules.json in visualEditor.core.build (or
86 somewhere more specific), and then run `grunt build`.