|
| 1 | +# Contributing to NativeScript |
| 2 | + |
| 3 | +:+1: First of all, thank you for taking the time to contribute! :+1: |
| 4 | + |
| 5 | +Here are some guides on how to do that: |
| 6 | + - [Code of Conduct](#coc) |
| 7 | + - [Reporting Bugs](#bugs) |
| 8 | + - [Requesting New Features](#features) |
| 9 | + - [Submitting a PR](#pr) |
| 10 | + |
| 11 | +## <a name="coc"></a> Code of Conduct |
| 12 | +Help us keep a healthy and open community. We expect all participants in this project to adhere to the the [NativeScript Code Of Conduct](https://github.com/NativeScript/codeofconduct). |
| 13 | + |
| 14 | + |
| 15 | +## <a name="bugs"></a> Reporting Bugs |
| 16 | + |
| 17 | +1. Always update to the most recent master release; the bug may already be resolved. |
| 18 | +2. Search for similar issues in the issues list for this repo; it may already be an identified problem. |
| 19 | +3. If this is a bug or problem that is clear, simple, and is unlikely to require any discussion -- it is OK to open an issue on GitHub with a reproduction of the bug including workflows and screenshots. If possible, submit a Pull Request with a failing test, entire application or module. If you'd rather take matters into your own hands, fix the bug yourself (jump down to the [Submitting a PR](#pr) section). |
| 20 | + |
| 21 | +## <a name="features"></a> Requesting Features |
| 22 | + |
| 23 | +1. Use Github Issues to submit feature requests. |
| 24 | +2. First, search for a similar request and extend it if applicable. This way it would be easier for the community to track the features. |
| 25 | +3. When requesting a new feature, please provide as much detail as possible about why you need the feature in your apps. We prefer that you explain a need rather than explain a technical solution for it. That might trigger a nice conversation on finding the best and broadest technical solution to a specific need. |
| 26 | + |
| 27 | +## <a name="pr"></a> Submitting a PR |
| 28 | + |
| 29 | +Before you begin: |
| 30 | +* Read and sign the [NativeScript Contribution License Agreement](http://www.nativescript.org/cla). |
| 31 | +* Make sure there is an issue for the bug or feature you will be working on. |
| 32 | + |
| 33 | +Following these steps is the best way to get you code included in the project: |
| 34 | + |
| 35 | +1. Fork and clone the NativeScript repo: |
| 36 | +```bash |
| 37 | +git clone https://github.com/<your-git-username>/NativeScript.git |
| 38 | +# Navigate to the newly cloned directory |
| 39 | +cd NativeScript |
| 40 | +# Add an "upstream" remote pointing to the original {N} repo. |
| 41 | +git remote add upstream https://github.com/NativeScript/NativeScript.git |
| 42 | +``` |
| 43 | + |
| 44 | +2. Set up the project (for detailed info check our [development workflow guide](DevelopmentWorkflow.md)): |
| 45 | + |
| 46 | +```bash |
| 47 | +#In the repo root |
| 48 | +npm install |
| 49 | +npm run setup |
| 50 | +``` |
| 51 | + |
| 52 | +3. Create a branch for your PR |
| 53 | +```bash |
| 54 | +git checkout -b <my-fix-branch> master |
| 55 | +``` |
| 56 | + |
| 57 | +4. The fun part! Make your code changes. Make sure you: |
| 58 | + - Follow the [code conventions guide](CodeConvention.md). |
| 59 | + - Write unit tests for your fix or feature. Check out [writing unit tests guide](WritingUnitTests.md). |
| 60 | + |
| 61 | +5. Before you submit your PR: |
| 62 | + - Rebase your changes to the latest master: `git pull --rebase upstream master`. |
| 63 | + - Ensure all unit test are green for Android and iOS. Check [running unit tests](DevelopmentWorkflow.md#running-unit-tests). |
| 64 | + - Ensure your changes pass tslint validation. (run `npm run tslint` in the root of the repo). |
| 65 | + |
| 66 | +6. Push your fork. If you have rebased you might have to use force-push your branch: |
| 67 | +``` |
| 68 | +git push origin <my-fix-branch> --force |
| 69 | +``` |
| 70 | + |
| 71 | +7. [Submit your pull request](https://github.com/NativeScript/NativeScript/compare). Please, fill in the Pull Request template - it will help us better understand the PR and increase the chances of it getting merged quickly. |
| 72 | + |
| 73 | +It's our turn from there on! We will review the PR and discuss changes you might have to make before merging it! Thanks! |
| 74 | + |
| 75 | + |
| 76 | +### Where to Start |
| 77 | + |
| 78 | +If you want to contribute, but you are not sure where to start - look for [issues marked with up-for-grabs tag](https://github.com/NativeScript/NativeScript/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs). |
0 commit comments