Build from sources
The build scripts are designed to run on a Unix platform (Linux, macOS, BSD, etc.). If you are on Windows, try installing Cygwin.
Prerequisites
- AMD64 platform. ARM platform is currently not tested, so the build may fail there
- UNIX-like OS
- make installed
- Docker installed
If you have an ARM CPU and want to build the code, you can emulate AMD64 and run the build there. You may also try to enable emulation at the Docker level. If you use Docker, set the variable export DOCKER_DEFAULT_PLATFORM=linux/amd64 or add the option platform: linux/amd64 to a docker-compose.yml file.
Build
- Create
.envfile. You may copy the.env.examplefile and configure it with your options - Run
make buildto build the whole project, package it, and check it with a linter - Artifacts will be placed in the
builddirectory
Partial build
To build the extension for specific browsers only, you can run make build and set space-separated targets in the PLATFORMS parameter.
Example: make build PLATFORMS=firefox or make build PLATFORMS="chrome chromium".
Supported platforms:
- firefox
- firefox-standalone
- chrome
- chromium: special build with auto updates out of the Google Store
Example command to build only the Firefox version is make build PLATFORMS=firefox.
Development
You may run development mode with make dev.
If you change theme tokens, you also have to compile the theme files: npm run build:tokens
To debug on Android, see instructions.
To make a custom translator, see the translator API.
If you need offline translation features, build third-party code with make prepare buildThirdparty before running development mode
Tests
When you change code that touches any user data and interacts with browser storages (localStorage, indexedDB, browser.storage, etc.) or some external API, you must add or update tests for it.
The general rule is that any code which simply transforms data should be tested.
You may not need to add tests for UI, but you should add tests for data.
Migrations
Migrations must have app version.