|
1 | 1 | # Contributing to MyScript Web Components |
2 | 2 |
|
3 | | -We welcome pull requests to MyScript Web Components. If you'd like to new or larger feature, keep reading. |
| 3 | +We gladly welcome pull requests to MyScript Web Components. If you would like to add or modify new or larger features, see the "Adding features" section. |
4 | 4 | If you have any questions, or want help solving a problem, feel free to stop by the [#MyScript forum](https://dev.myscript.com/support/forum/). |
5 | 5 |
|
6 | | -#### Adding new features |
| 6 | +## Code format |
7 | 7 |
|
8 | | -Components are distributed as sets of HTML and CSS files. If the feature you want to add is similar to an existing component, add your contribution to these files. |
| 8 | +* each filename should be in smallcaps |
| 9 | +* 4 spaces for indentation |
| 10 | +* 120 character-line length |
9 | 11 |
|
10 | | -If you create a new component, you should create a new set of file (HTML and CSS) associated to this new component. File name should be the component name in smallcaps. |
| 12 | +In general, try to make your code blend in with the surrounding code. |
| 13 | + |
| 14 | +## Adding features |
| 15 | + |
| 16 | +Components are distributed as sets of HTML and CSS files. If the feature you want to add belongs to an existing component, add your contribution to the corresponding file. |
| 17 | + |
| 18 | +If you create a component, you should create a new set of files (HTML and CSS) associated to this component. Filename should be the component name in smallcaps. |
11 | 19 |
|
12 | 20 | ## Testing |
13 | 21 |
|
14 | | -Local testing can be using the `web-component-tester` engine through a web server. First, install all dependencies |
15 | | -`bower install` from the root folder of the project, then open the test page from a web browser. |
| 22 | +Local testing can be done using the `web-component-tester` engine through a web server. First, install all dependencies `bower install` from the root folder of the project, then open the test page in a web browser. |
16 | 23 |
|
17 | | -#### Testing in other browsers |
| 24 | +MyScript Web Components supports all major browsers. Unfortunately, it is hard to test new changes so if you can, please test your changes in as many browsers as possible. |
18 | 25 |
|
19 | | -MyScript Web Components supports all major browsers. Unfortunately, it is hard to test new changes in many browsers. If you can, please test your changes in as many browsers as possible. |
| 26 | +Simply navigate to the `/test` directory of your element to run its tests. If |
| 27 | +you are using [Polyserve](https://github.com/PolymerLabs/polyserve): `http://localhost:8080/components/myscript-math/test/` |
20 | 28 |
|
21 | | -## Style guide |
| 29 | +### web-component-tester |
22 | 30 |
|
23 | | -Code |
| 31 | +Install [web-component-tester](https://github.com/Polymer/web-component-tester): `npm install -g web-component-tester` as tests are compatible with it. You can then run your tests on *all* of your local browsers: `wct` |
24 | 32 |
|
25 | | - - 4 spaces for indentation |
26 | | - - 120 character line length |
27 | | - - declare variables in the outermost scope that they are used |
| 33 | +#### WCT Tips |
28 | 34 |
|
29 | | -In general, try to make your code blend in with the surrounding code. |
| 35 | +`wct -l chrome` will only run tests in Google Chrome. |
| 36 | + |
| 37 | +`wct -p` will keep the browsers alive after test runs (refresh to re-run). |
| 38 | + |
| 39 | +`wct test/some-file.html` will test only the files you specify. |
30 | 40 |
|
31 | 41 | ## CLA |
32 | 42 |
|
33 | | -In order to contribute, you must first agree to the **Contributor License Agreement**, found [here](http://goo.gl/forms/YyzZ9VSvYG). |
| 43 | +In order to contribute, you must first agree to the **Contributor License Agreement** available [here](http://goo.gl/forms/YyzZ9VSvYG). |
34 | 44 |
|
35 | | -Make sure you have read the article "[Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/)" to understand the process of contributing. |
| 45 | +Make sure you read the article "[Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/)" to understand the contributing process. |
36 | 46 |
|
37 | 47 |
|
38 | 48 | ## License |
39 | 49 |
|
40 | | -This library is licensed under the [Apache 2.0](http://opensource.org/licenses/Apache-2.0). |
41 | | - |
| 50 | +This library is licensed under the [Apache 2.0](http://opensource.org/licenses/Apache-2.0). |
0 commit comments