Jodit is an open-source project, and we greatly appreciate your contributions. You can contribute by fixing bugs, reporting them, or translating the editor interface.
git clone git@github.com:xdan/jodit.git
cd jodit
nvm use
npm ciTo work you will need to install make.
make startMake code changes and add automated tests in the test/tests/ folder.
Run:
make lint && make testFix any issues and commit your changes:
git checkout -b i/GITHUB-ISSUE-NUMBER
git add . && git commit -m "Fixed issue smt"
git pushCreate a pull request in your repository on the GitHub interface.
To work on Jodit, you need the make utility.
Clone the repository and install the dependencies.
git clone git@github.com:xdan/jodit.git
cd jodit
nvm use
npm ci
make startThe make start command starts the development server in debug mode,
and the default page will open automatically.
The command can be parameterized, for example, to run the build in es2018 mode:
make start es=es2018You can find other options in the Makefile.
Before you start, here are some important points to keep in mind:
- We expect contributions to adhere to high-quality code standards, including coding style and tests. Neglecting these points may slow down the acceptance of your contribution or even lead to rejection.
- There is no guarantee that your contribution will be included in the project code. However, pull requests make it easy for you to keep your changes for personal use or for others who may find them useful.
- If you need help creating a patch or implementing a feature, please submit a ticket to us on the issue tracker.
To ensure that your code matches the project's general style, you can use Prettier:
npx prettier ./src/%YOUR_PATCHED_FILE_PATH% --writeMore information about the code style is provided in the guide. It is also important to run the following command without any errors before creating a pull request:
make lintWe follow simple code formatting rules that your IDE or editor can help you with.
Build min files:
make buildBuild without any plugins:
make build es=es2021 uglify=true excludePlugins="about,source,bold,image,xpath,stat,class-span,color,clean-html,file,focus,enter,backspace,media,preview,pint,redo-undo,resize-cells,search,spellcheck,table"Build without some languages:
make build es=es2021 uglify=true excludeLanguages="ru,ar,cs_cz,de,es,fa,fi,fr,he,hu,id,it,ja,ko,nl,pl,pt_br,ru,tr,zh_cn,zh_tw"To analyze the bundle and generate an interactive report:
make statoscopeThis builds the es2021 fat bundle with Statoscope.
If statoscope/reference.json already exists (committed baseline), the new stats go to reference.next.json for comparison.
If not — it creates the initial reference.json.
# Compare against baseline
make statoscope
make statoscope-validatestatoscope/reference.json— baseline (committed to git, updated onmake newversion)build/statoscope-report.html— interactive report (open in browser)
Validation rules are configured in statoscope.config.js.
In CI, Statoscope runs automatically on every push/PR and posts comparison results.
Before making any functional changes or fixing a bug, you need to create tests for them. We follow the TDD (Test-Driven Development) methodology, where we write automated tests first and then implement the functionality. Maintaining a comprehensive test suite is crucial for our editor. To run all tests, use the following command:
make testor
npm testIn several browsers:
make test browsers=Chrome,FirefoxThis command builds the project and runs the automated tests. If you only want to run the tests on an existing build, you can simply use:
make test-only-runor
make test-only-run browsers=ChromeIf you need to run a specific test, you can use the only method:
describe.only('Test', () => {
it.only('Test', () => {});
});To see the test results, you can run the tests in watch mode:
make test-only-run browsers=Chrome singleRun=falseFor checking tests in browser, open URL:
http://localhost:2000/test/test.html
GitHub provides excellent documentation about pull requests. If you are unsure about the process, that is the right place to start
Assuming that you would like to propose some changes, follow these steps 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 address in your pull request. This step can be skipped for obvious and trivial changes (e.g., typos, documentation fixes).
- 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 and navigate to the package's folder in your development environment:
$ cd path/to/jodit- Create a new branch for your code. We use the
i/GITHUB-ISSUE-NUMBERconvention for branch names:
$ git checkout -b i/GITHUB-ISSUE-NUMBER- Make the necessary changes, ensuring that you adhere to the code-style guidelines and remember to include tests for your changes.
- Commit your changes using the following command:
$ git commit -m "Fixed issue smt."- Now it's time to make your changes public. First, you need to let git know about the fork you created by adding the remote repository:
$ 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 provided.