Jodit is an open source project and we would really appreciate your contributions. You can help us by fixing bugs, reporting them, or translating the editor interface.
git clone git@github.com:xdan/jodit.git
cd jodit
nvm use
npm ci
Change code + add autotest in test/tests/
folder. Run
npm run lint && npm test
Fix it and commit your changes:
git checkout -b i/GITHUB-ISSUE-NUMBER
git add . && git commit -m "Fixed issue smt"
git push
In your repository in the GitHub interface, create a pull request.
Before you start, here are some things to keep in mind:
- We expect contributions to conform to the high quality code standards we follow, including coding style and tests. Lack of attention to this point can either slow down the acceptance of the contribution, or even cause us to reject it completely.
- There is no guarantee your contribution will be included in the project code. However, pull requests make it easy for you to keep them for your own use or for others who might be interested in them.
- If you need help creating a patch or implementing a feature, please submit a ticket to us on the issue tracker.
In order for the code to match the general style, you can simply run prettier:
npx prettier ./src/%YOUR_PATCHED_FILE_PATH% --write
More about the style code is written in the guide
It is also important that before you create a PR, you run the command without errors:
npm run lint
We follow simple code formatting rules that your IDE or editor will tell you.
Before doing any functionality or fixing a bug, you need to create a test for it. We follow the TDD methodology, i.e. first we write an autotest, and then a functional. It would be absolutely impossible to maintain our editor without autotests. Therefore, this is one of the most important things you need to do in your PR.
GitHub provides an excellent documentation about pull requests. If you are not sure what to do, this is the right place to start.
Assuming that you would like to propose some changes, these are the steps you should take to create a pull request:
- Make sure to open a ticket in https://github.com/xdan/jodit describing the issue, feature or problem that you want to solve in your pull request. This can be skipped in case of obvious and trivial changes (typos, documentation, etc.).
- Go to GitHub and fork the repository. The forked repository will appear in your GitHub account as
https://github.com/YOUR-USERNAME/jodit
. - Open your terminal, then go to the package ("repository") folder in your development environment:
$ cd path/to/jodit
- Start a new branch for your code. We use the
i/GITHUB-ISSUE-NUMBER
convention for branch names:
$ git checkout -b i/GITHUB-ISSUE-NUMBER
- Make the changes. Stick to the code-style guidelines and remember about tests!
- Commit your changes:
$ git commit -m "Fixed issue smt."
- Now it is time to make your changes public. First, you need to let
git
know about the fork you created by adding the remote:
$ git remote add my-fork https://github.com/YOUR-USERNAME/jodit
- Push your changes to your forked repository:
$ git push my-fork i/GITHUB-ISSUE-NUMBER
- Go to your forked repository on GitHub. Use the pull request button and follow the instructions.