|
1 | 1 | # Contributing to the Parse JavaScript SDK
|
2 | 2 | We want to make contributing to this project as easy and transparent as possible.
|
3 | 3 |
|
4 |
| -If you're looking to get started, but want to ease yourself into the codebase, look for issues tagged [good first bug](https://github.com/ParsePlatform/Parse-SDK-JS/labels/good%20first%20bug). These are simple yet valuable tasks that should be easy to get started. |
| 4 | +If you're looking to get started, but want to ease yourself into the codebase, look for issues tagged [good first task](https://github.com/parse-community/Parse-SDK-JS/labels/good%20first%20task). These are simple yet valuable tasks that should be easy to get started. |
5 | 5 |
|
6 |
| -## Code of Conduct |
7 |
| -Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated. |
| 6 | +## `master` is unsafe |
| 7 | +Our goal is to keep `master` stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use our specific releases in any production environment. |
8 | 8 |
|
9 |
| -## Our Development Process |
10 |
| -Most of our work will be done in public directly on GitHub. There may be changes done through our internal source control, but it will be rare and only as needed. |
| 9 | +## Setting up the project for debugging and contributing: |
11 | 10 |
|
12 |
| -### `master` is unsafe |
13 |
| -Our goal is to keep `master` stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use our specific releases in any production environment. |
| 11 | +### Recommended setup: |
| 12 | + |
| 13 | +* [vscode](https://code.visualstudio.com), the popular IDE. |
| 14 | +* [Jest Extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) the Jest extension for vscode to run the tests inline and debug quicky. |
| 15 | +* [Jasmine Test Explorer Extension](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer), a very practical test exploration plugin which let you run, debug and see the test results inline. |
| 16 | +* [mongodb-runner](https://github.com/mongodb-js/runner) Easily install and run MongoDB to test your code against it. (install with `npm install -g mongodb-runner`) |
| 17 | + |
| 18 | +### Setting up you local machine: |
| 19 | + |
| 20 | +* [Fork](https://github.com/parse-community/Parse-SDK-JS) this project and clone the fork on your local machine: |
| 21 | + |
| 22 | +```sh |
| 23 | +$ git clone https://github.com/parse-community/Parse-SDK-JS |
| 24 | +$ cd Parse-SDK-JS # go into the clone directory |
| 25 | +$ npm install # install all the node dependencies |
| 26 | +$ code . # launch vscode |
| 27 | +``` |
| 28 | + |
| 29 | +### Testing the code |
| 30 | + |
| 31 | +The SDK is tested through two lenses. unit tests are run with jest and integrationt tests with jasmine. |
| 32 | + |
| 33 | +Two different frameworks are used as the integration tests leverage a stateful server, with the data saved into the database, and Jest is running many tests in parallel, which makes it incompatible with our integration tests. |
| 34 | + |
| 35 | +#### Unit tests |
| 36 | + |
| 37 | +Those tests are located in [/src/__tests__](/src/__tests__) and are responsible for ensuring each class is behaving as expected, without considering the rest of the system. For example, adding a new query helper function would probably require to add relevant tests that ensure the query is properly serialized to a valid Parse REST query object. Unit tests heavily leverage mocking and are an essential part of our testing harness. |
| 38 | + |
| 39 | +To run unit tests, run `npm test`. If you have the vscode Jest plugin extension (as recommended), you can run your tests by clicking the *Debug* lens that appears near by the test. |
| 40 | + |
| 41 | + |
| 42 | +#### Integration tests |
| 43 | + |
| 44 | +Those tests are located in [/integration/test](/integration/test) and are responsible for ensuring a proper communication with parse-server. With the integration tests, we ensure all communications between the SDK and the server are behaving accordingly. |
| 45 | + |
| 46 | +To run the integtation tests, you will need a valid mongodb running on your local machine. You can get easily mongodb running with `mongodb-runner` (see [Recommended setup](#recommended-setup)). |
| 47 | + |
| 48 | +Use `npm run integration` in order to run the integration tests. If you have the vscode Jasmine extension installed (as recommended), you can run your tests by clicking the *Run* or the *Debug* lens that appears near by the test. |
14 | 49 |
|
15 | 50 | ### Pull Requests
|
16 | 51 | We actively welcome your pull requests. When we get one, we'll run some Parse-specific integration tests on it first. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
|
17 | 52 |
|
18 | 53 | 1. Fork the repo and create your branch from `master`.
|
19 | 54 | 2. Add unit tests for any new code you add.
|
20 | 55 | 3. If you've changed APIs, update the documentation.
|
21 |
| -4. Ensure the test suite passes. |
| 56 | +4. Ensure the test suite passes. (run `npm test && npm run integration`) |
22 | 57 | 5. Make sure your code lints.
|
23 |
| -6. If you haven't already, complete the Contributor License Agreement ("CLA"). |
24 |
| - |
25 |
| -### Contributor License Agreement ("CLA") |
26 |
| -In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Facebook's open source projects. |
27 |
| - |
28 |
| -Complete your CLA here: <https://developers.facebook.com/opensource/cla> |
29 |
| - |
30 |
| - |
31 |
| -## Bugs |
32 |
| -Although we try to keep developing on Parse easy, you still may run into some issues. General questions should be asked on [Google Groups][google-group], technical questions should be asked on [Stack Overflow][stack-overflow], and for everything else we'll be using GitHub issues. |
33 | 58 |
|
34 | 59 | ### Known Issues
|
35 | 60 | We use GitHub issues to track public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist.
|
36 | 61 |
|
37 | 62 | ### Reporting New Issues
|
38 | 63 | Not all issues are SDK issues. If you're unsure whether your bug is with the SDK or backend, you can test to see if it reproduces with our [REST API][rest-api] and [Parse API Console][parse-api-console]. If it does, you can report backend bugs [here][bug-reports].
|
| 64 | +If the issue only reproduces with the JS SDK, you can [open an issue](https://github.com/parse-community/parse-server/issues) on this repository. |
39 | 65 |
|
40 | 66 | Details are key. The more information you provide us the easier it'll be for us to debug and the faster you'll receive a fix. Some examples of useful tidbits:
|
41 | 67 |
|
42 | 68 | * A description. What did you expect to happen and what actually happened? Why do you think that was wrong?
|
43 |
| -* A simple unit test that fails. Refer [here][tests-dir] for examples of existing unit tests. See our [README](README.md#usage) for how to run unit tests. You can submit a pull request with your failing unit test so that our CI verifies that the test fails. |
| 69 | +* A simple unit test that fails. Refer [here][tests-dir] for examples of existing unit tests and [here][integration-test-dir] for integration tests examples. See for how to setup your machine and run unit tests in [this](#setting-up-the-project-for-debugging-and-contributing) guide. You can submit a pull request with your failing unit test so that our CI verifies that the test fails. |
44 | 70 | * What version does this reproduce on? What version did it last work on?
|
45 | 71 | * [Stacktrace or GTFO][stacktrace-or-gtfo]. In all honesty, full stacktraces with line numbers make a happy developer.
|
46 | 72 | * Anything else you find relevant.
|
47 | 73 |
|
48 | 74 | ### Security Bugs
|
49 |
| -Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue. |
| 75 | +Parse Community has a [responsible Vulnerability Disclosure Program](https://github.com/parse-community/parse-server/blob/master/SECURITY.md) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue. |
50 | 76 |
|
51 | 77 | ## Coding Style
|
52 | 78 | * Most importantly, match the existing code style as much as possible.
|
53 | 79 | * We use [Flow](http://flowtype.org/) and ES6 for this codebase. Use modern syntax whenever possible.
|
54 | 80 | * Keep lines within 80 characters.
|
55 | 81 | * Always end lines with semicolons.
|
56 | 82 |
|
| 83 | +### Code of Conduct |
| 84 | + |
| 85 | +This project adheres to the [Contributor Covenant Code of Conduct](https://github.com/parse-community/parse-server/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to honor this code. |
| 86 | + |
57 | 87 | ## License
|
58 | 88 | By contributing to the Parse JavaScript SDK, you agree that your contributions will be licensed under its license.
|
59 | 89 |
|
60 | 90 | [google-group]: https://groups.google.com/forum/#!forum/parse-developers
|
61 |
| - [stack-overflow]: http://stackoverflow.com/tags/parse.com |
62 |
| - [bug-reports]: https://www.parse.com/help#report |
63 |
| - [rest-api]: https://www.parse.com/docs/rest/guide |
64 |
| - [parse-api-console]: http://blog.parse.com/announcements/introducing-the-parse-api-console/ |
| 91 | + [stack-overflow]: http://stackoverflow.com/tags/parse-server |
| 92 | + [bug-reports]: https://github.com/parse-community/parse-server/issues |
| 93 | + [rest-api]: https://docs.parseplatform.org/rest/guide |
| 94 | + [parse-api-console]: http://blog.parseplatform.org/announcements/introducing-the-parse-api-console/ |
65 | 95 | [stacktrace-or-gtfo]: http://i.imgur.com/jacoj.jpg
|
66 | 96 | [tests-dir]: /src/__tests__
|
| 97 | + [integration-test-dir]: /integration/test |
0 commit comments