You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 rivejä
3.4 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/), `>= 10.11.0`
  14. - [yarn](https://yarnpkg.com/), `>= 1.17.3`
  15. ### Dependencies
  16. From a terminal, where you have cloned the repository, execute the following command to install the required dependencies:
  17. ```
  18. yarn --frozen-lockfile
  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. yarn 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. yarn 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. yarn 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 `yarn 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 [ESLint](https://eslint.org/) for code linting. You can run ESLint across the code by calling `yarn run lint` from a terminal. Warnings from ESLint 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 [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension.
  52. ### Bundling
  53. To generate a production bundle (without packaging) run the following from a terminal:
  54. ```
  55. yarn run bundle
  56. ```
  57. To generate a VSIX (installation package) run the following from a terminal:
  58. ```
  59. yarn 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).