Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

112 righe
3.5 KiB

  1. # Contributing
  2. 👍🎉 First off, thanks for taking the time to contribute! 🎉👍
  3. When contributing to this project, please first discuss the changes you wish to make via an issue before making changes.
  4. Please note the [Code of Conduct](CODE_OF_CONDUCT.md) document, please follow it in all your interactions with this project.
  5. ## Your First Code Contribution
  6. Unsure where to begin contributing? You can start by looking through the [`help-wanted`](https://github.com/eamodio/vscode-gitlens/labels/help%20wanted) issues.
  7. ### Getting the code
  8. ```
  9. git clone https://github.com/eamodio/vscode-gitlens.git
  10. ```
  11. Prerequisites
  12. - [Git](https://git-scm.com/)
  13. - [NodeJS](https://nodejs.org/en/), `>= 8.9.1, < 9.0.0`
  14. - [npm](https://npmjs.com/), `>= 6.2.0`
  15. ### Dependencies
  16. From a terminal, where you have cloned the repository, execute the following command to install the required dependencies:
  17. ```
  18. npm install --no-save
  19. ```
  20. ### Build
  21. From a terminal, where you have cloned the repository, execute the following command to re-build the project from scratch:
  22. ```
  23. npm run rebuild
  24. ```
  25. 👉 **NOTE!** This will run a complete rebuild of the project.
  26. Or to just run a quick build, use:
  27. ```
  28. npm run build
  29. ```
  30. ### Watch
  31. During development you can use a watcher to make builds on changes quick and easy. From a terminal, where you have cloned the repository, execute the following command:
  32. ```
  33. npm run watch
  34. ```
  35. Or use the provided `watch` task in VS Code, execute the following from the command palette (be sure there is no `>` at the start):
  36. ```
  37. task watch
  38. ```
  39. This will first do an initial full build and then watch for file changes, compiling those changes incrementally, enabling a fast, iterative coding experience.
  40. 👉 **Tip!** You can press <kbd>CMD+SHIFT+B</kbd> (<kbd>CTRL+SHIFT+B</kbd> on Windows, Linux) to start the watch task.
  41. 👉 **Tip!** You don't need to stop and restart the development version of Code after each change. You can just execute `Reload Window` from the command palette.
  42. ### Formatting
  43. This project uses [prettier](https://prettier.io/) for code formatting. You can run prettier across the code by calling `npm run pretty` from a terminal.
  44. To format the code as you make changes you can install the [Prettier - Code formatter](https://marketplace.visualstudio.com/items/esbenp.prettier-vscode) extension.
  45. Add the following to your User Settings to run prettier:
  46. ```
  47. "editor.formatOnSave": true,
  48. ```
  49. ### Linting
  50. This project uses [tslint](https://palantir.github.io/tslint/) for code linting. You can run tslint across the code by calling `npm run lint` from a terminal. Warnings from tslint show up in the `Errors and Warnings` quick box and you can navigate to them from inside VS Code.
  51. To lint the code as you make changes you can install the [TypeScript TSLint Plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin) extension.
  52. ### Bundling
  53. To generate a production bundle (without packaging) run the following from a terminal:
  54. ```
  55. npm run bundle
  56. ```
  57. To generate a VSIX (installation package) run the following from a terminal:
  58. ```
  59. npm run pack
  60. ```
  61. ### Debugging
  62. #### Using VS Code
  63. 1. Open the `vscode-gitlens` folder
  64. 2. Ensure the required [dependencies](#dependencies) are installed
  65. 3. Start the [`watch`](#watch) task
  66. 4. Choose the `Launch GitLens` launch configuration from the launch dropdown in the Debug viewlet and press `F5`.
  67. ## Submitting a Pull Request
  68. Please follow all the instructions in the [PR template](.github/PULL_REQUEST_TEMPLATE.md).