microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
CONTRIBUTING.md
57lines · modeblame
2af998b7Vladimir Kotikov8 years ago | 1 | ## Development setup |
34472878RedMickey5 years ago | 2 | |
2af998b7Vladimir Kotikov8 years ago | 3 | We welcome any quality bugfixes or contributions! |
| 4 | | |
e3278192JiglioNero5 years ago | 5 | To avoid conflicts with your existing installation, it is recommended to delete the installed extension at: |
2af998b7Vladimir Kotikov8 years ago | 6 | |
4d14f563Yuri Skorokhodov5 years ago | 7 | - **Linux and macOS**: `~/.vscode/extensions/msjsdiag.vscode-react-native-<version>` |
| 8 | - **Windows**: `C:\Users\<username>\.vscode\extensions\msjsdiag.vscode-react-native-<version>` | |
34472878RedMickey5 years ago | 9 | |
0541d8edHeniker4 years ago | 10 | ## Build the project |
34472878RedMickey5 years ago | 11 | |
0541d8edHeniker4 years ago | 12 | - `git clone https://github.com/microsoft/vscode-react-native.git` |
| 13 | - `cd vscode-react-native` | |
2974bd80Heniker4 years ago | 14 | - Run `npm ci` |
| 15 | - Run `npm install -g gulp` and add `"gulp.autoDetect": "on"` to your VS Code settings | |
0541d8edHeniker4 years ago | 16 | - Run `gulp` and check `dist` folder for extension files |
2af998b7Vladimir Kotikov8 years ago | 17 | |
| 18 | ## Debugging | |
34472878RedMickey5 years ago | 19 | |
4d14f563Yuri Skorokhodov5 years ago | 20 | There are currently 2 components to our extension: The extension running in the VS Code process with the debug adapter, and some code wrapping the user React Native code which is launched by the debug adapter. These are all debugged in different ways: |
2af998b7Vladimir Kotikov8 years ago | 21 | |
4d14f563Yuri Skorokhodov5 years ago | 22 | - To debug the extension process itself and the debug adapter it provides, in VS Code run the `Launch Extension` debug target which will spawn a new instance of VS Code with the extension installed. You can set breakpoints in the Typescript and debug things such as extension activation and the command palette. |
2af998b7Vladimir Kotikov8 years ago | 23 | |
4d14f563Yuri Skorokhodov5 years ago | 24 | - To debug the code running in the same process as the React Native code, open up an instance of VS Code running the extension on a React Native project. From this instance, open up the Typescript file in the extension codebase that you wish to debug and add breakpoints. Now, when you launch the React Native project, you should hit breakpoints in the extension code wrapper. |
2af998b7Vladimir Kotikov8 years ago | 25 | |
4d14f563Yuri Skorokhodov5 years ago | 26 | - In addition you can also debug the functional indirectly by debugging the `debuggerWorker.js` file which is generated by Metro bundler, but modified by extension and saved in your React Native `.vscode/.react` folder locally. This file is created only when you start debugging against your React Native application and the debugger is already attached to it. The `debuggerWorker.js` is launched in `--inspect-brk` mode so it will wait until debugger is attached to the app. |
2af998b7Vladimir Kotikov8 years ago | 27 | |
| 28 | ## Testing | |
34472878RedMickey5 years ago | 29 | |
e3278192JiglioNero5 years ago | 30 | There is a set of Mocha tests for the extesnion and extension localization which can be run with `npm test` and `npm test-localization` or by `Launch Extension Tests` and `Launch Localization Tests`. Also there are e2e smoke tests placed in [`test/smoke`](https://github.com/microsoft/vscode-react-native/tree/master/test/smoke) folder that can be launched by `npm smoke-tests` command or by `Launch All Smoke Tests` command. Make sure to [prepare test environment](https://github.com/microsoft/vscode-react-native/blob/master/test/smoke/docs/run-locally.md) before launching e2e tests. |
2af998b7Vladimir Kotikov8 years ago | 31 | |
4d14f563Yuri Skorokhodov5 years ago | 32 | Run `gulp lint` to check your code against our linting rules or `gulp format` to try to autofix all linting problems with Prettier. |
2af998b7Vladimir Kotikov8 years ago | 33 | |
| 34 | ## Legal | |
34472878RedMickey5 years ago | 35 | |
2af998b7Vladimir Kotikov8 years ago | 36 | You must complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. |
| 37 | | |
| 38 | Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit [https://cla.microsoft.com](https://cla.microsoft.com) to sign the agreement digitally. Alternatively, download the agreement from ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <cla@microsoft.com>. Be sure to include your github user name along with a copy of the signed agreement. Once we have received the signed CLA, we'll review the request. | |
| 39 | | |
| 40 | ## Sending a PR | |
34472878RedMickey5 years ago | 41 | |
2af998b7Vladimir Kotikov8 years ago | 42 | Pull requests should: |
| 43 | | |
34472878RedMickey5 years ago | 44 | - Include a clear description of the proposed change |
| 45 | - Be a child commit of a reasonably recent commit in the **master** branch | |
| 46 | - Requests need not be a single commit, but should be a linear sequence of commits (i.e. no merge commits in your PR) | |
| 47 | - Have clear commit messages | |
| 48 | - e.g. "Refactor feature", "Fix issue", "Add tests for issue" | |
| 49 | - Include adequate tests | |
| 50 | - At least one test should fail in the absence of your non-test code changes. If your PR does not match this criteria, please specify why | |
| 51 | - Tests should include reasonable permutations of the target fix/change | |
| 52 | - Include baseline changes with your change | |
4d14f563Yuri Skorokhodov5 years ago | 53 | - Have linting issues (`gulp lint`) |
2af998b7Vladimir Kotikov8 years ago | 54 | |
3fe8602cYuri Skorokhodov7 years ago | 55 | It is desirable, but not necessary, for the tests to pass at each commit. |
2af998b7Vladimir Kotikov8 years ago | 56 | |
| 57 | To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your system's git configuration. |