# Contributing to NativeScript :+1: First of all, thank you for taking the time to contribute! :+1: Here are some guides on how to do that: - [Code of Conduct](#coc) - [Reporting Bugs](#bugs) - [Requesting New Features](#features) - [Submitting a PR](#pr) - [Check test report](#test-report) - [Commit Message Guidelines](#commit-messages) - [Releasing new versions](#release) ## Code of Conduct Help us keep a healthy and open community. We expect all participants in this project to adhere to the [NativeScript Code Of Conduct](https://github.com/NativeScript/codeofconduct). ## Reporting Bugs 1. Always update to the most recent [release](https://github.com/NativeScript/NativeScript/releases); the bug may already be resolved. 2. Search for similar issues in the issues list for this repo; it may already be an identified problem. 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). > While we are doing all we can to take care of every issue, sometimes we get overwhelmed. That's why > - issues that are not constructive or describe problems that cannot be reproduced will be closed > - feature requests or bug reports with unanswered questions regarding the behavior/reproduction for more than 20 days will be closed ## Requesting Features 1. Use Github Issues to submit feature requests. 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. 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. ## Submitting a PR Before you begin: * Read and sign the [NativeScript Contribution License Agreement](http://www.nativescript.org/cla). * Make sure there is an issue for the bug or feature you will be working on. Following these steps is the best way to get you code included in the project: 1. Fork and clone the NativeScript repo: ```bash git clone https://github.com//NativeScript.git # Navigate to the newly cloned directory cd NativeScript # Add an "upstream" remote pointing to the original {N} repo. git remote add upstream https://github.com/NativeScript/NativeScript.git ``` 2. Set up the project (for detailed info check our [development workflow guide](DevelopmentWorkflow.md)): ```bash #In the repo root npm run setup #View interactive options npm start ``` 3. Create a branch for your PR ```bash git checkout -b main ``` 4. The fun part! Make your code changes. Make sure you: - Follow the [code conventions guide](CodingConvention.md). - Follow the [guide on handling errors and exceptions](HandlingErrors.md). - Write unit tests for your fix or feature. Check out [writing unit tests guide](WritingUnitTests.md). 5. Before you submit your PR: - Rebase your changes to the latest main: `git pull --rebase upstream main`. - Ensure all unit test are green for Android and iOS. Check [running unit tests](DevelopmentWorkflow.md#running-unit-tests). 6. Push your fork. If you have rebased you might have to use force-push your branch: ``` git push origin --force ``` 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. It's our turn from there on! We will review the PR and discuss changes you might have to make before merging it! Thanks! >Note: Sometimes you will see someone from the contributors team writing strange comments like: `test` or `test branch_functional_tests#css-gradients-tests branch_widgets#vultix/css-gradients` - don't worry about it, these are just phrases that trigger the internal CI builds. ## Check test report The purpose of the test report view is to show the tests' results for the PRs for the external contributors. When a NativeScript team member triggers the tests, you can review the result by selecting the `Details` button next to the `ci/jenkins/core-modules-tests` task. > Note: the `Details` button will be available when the execution of the test completes and there is at least one failing test. When you click on the button, you will be redirected to the report page. On the left pane you can find a list of all failed jobs. > Note: Each item name consists of the application name, type of device and platform version: `pr-e2e-tests-[application-name]-[device-type]-[platform-version]`. Usually, the test applications, that are executed for PRs are part of NativeScript repository. Based on the executed suite, one of the following or all of the following files will be generated: `mochawesome.html` | `index.html` | `unit-tests.log`. Some reports also might include `*.png`, `*.logs` or `[page source].xml` files that can help in understanding where is the problem. For example: 1. When you select the `index.html` page, an additional `TestNG Results` sidebar will be displayed. There you can find a list of all failures. 2. When you select one of them, you will see on the right side all tests, that have been executed. The problematic ones will be coloured in red. 3. If you click on one of them, detailed info or error log will be displayed. As we've mentioned above in some test reports, you will also find screenshots, that demonstrates the problem visually. Those images can be found below the info/ error log. ## Commit Message Guidelines Please follow the git commit message format described below when committing your changes or submitting a PR. That allows us to use the commit messages to generate a change log for every new release. ### Commit Message Format Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: ``` ():