Skip to content

Latest commit

 

History

History
63 lines (54 loc) · 3.71 KB

CONTRIBUTING.md

File metadata and controls

63 lines (54 loc) · 3.71 KB

Contributing

You can contribute to the project by opening a pull request. People who contribute to AdGuard projects can receive various rewards, see this page for details.

Development & Contribution

Here is a guide on how to set up the development environment and how to submit your changes:

  • Pre-requisites: Node.js (v14 or higher), Yarn (v2 or higher), Git. It is important to use Yarn and not NPM, because the project is optimized for Yarn.
  • Fork the repository on GitHub. You will need to have a GitHub account for this. If you already have a fork, make sure to update it with the latest changes from the main repository.
  • Clone your forked repository to your local machine with git clone <repository-url>. It is important to clone your forked repository and not the main repository, because you will not be able to push your changes to the main repository, since you do not have the permissions to do so.
  • Install dependencies by following this guide.
  • Create a new branch with git checkout -b <branch-name>. Example: git checkout -b feature/add-some-feature. Please add feature/ or fix/ prefix to your branch name, and refer to the issue number if there is one. Example: fix/42.
  • Open the project root folder in your editor.
  • Make your changes and test them.
  • Check code by running yarn check-types, yarn lint and yarn test commands (Husky will run these commands automatically before each commit).
  • If everything is OK, commit your changes and push them to your forked repository. Example:
    • Add files to commit with git add .
    • Commit files with git commit -m "Add some feature"
    • Push changes to your forked repository with git push origin feature/add-some-feature.
  • When you are ready to submit your changes, go to your forked repository on GitHub and create a pull request. Make sure to select the correct branch. Example: feature/add-some-feature branch in your forked repository to master branch in the main repository.
  • After you open a pull request, GitHub Actions will run the tests on your changes. If the tests fail, you can see the error details in the "Checks" tab. If the tests pass, a green checkmark will appear in the "Checks" tab.
  • Finally, wait for the maintainers to review your changes. If there are any issues, you can fix them by pushing new commits to your branch. If everything is OK, the maintainers will merge your pull request.

We would be happy to review your pull request and merge it if it is suitable for the project.

Available commands

During development, you can use the following commands (listed in package.json):

  • yarn build - build the library to the dist folder by using Rollup
  • yarn build-types - build type definitions with TypeScript to the dist/types folder.
  • yarn check-types - check types with TypeScript
  • yarn clean - remove the dist folder.
  • yarn clean-types - remove the dist/types folder.
  • yarn coverage - print test coverage report
  • yarn lint - run all linters.
  • yarn lint:md - lint the markdown files with markdownlint.
  • yarn lint:ts - lint the code with ESLint.
  • yarn test - run tests with Jest (you can also run a specific test with yarn test <test-name>)