Development
Development Guidelines
- The project uses tools such as ESLint, Prettier, Stylelint, Clippy, Rustfmt, etc. for code style checking. Please make sure the code is styled correctly before committing it.
- Please do not use
git -nto skip code style checks. We have now added code style checking to CI.
- Please do not use
- Please do not commit useless code, files, or directories.
- If it involves a big feature refactoring or a new feature, please raise it in an issue first so that it can be discussed.
Environment Requirements
The following dependencies are required regardless of the system used:
- Rust v1.78 or later stable version.
- Be sure to use the MSVC toolchain on Windows.
- Node.js v20 LTS or a newer LTS/Latest version.
- pnpm v9 or later stable version
- git
There are also a few additional dependencies we'll need to ensure the project builds properly:
- cmake - Requirements introduced by the
zipcrate. - llvm - Required by
rquickjsorrocksdb. - patch - Requirements introduced by
rquickjs.
Windows
On Windows, the following recommendations should also be followed:
- Open the project for the first time with administrator permission. The
patchcommand requires administrator permission to execute. - Install
gsudoviascoop,choco, orwinget(of course Windows 11 comes with sudo as well) for easy terminal lifting.
Preparation
Before development, we need to initialize some environments for the project.
First, we need to install the front-end dependencies:
pnpm iIn addition, we need to download the cores, resource files, etc., for the sidecar and resource binary files.
This command supports the use of terminal proxies. If network connectivity is an issue, use a proxy.
pnpm checkIf you find a missing file or want to force an update of the resource file, you can use the following commands:
pnpm check --forceDevelopment
We currently provide two convenience commands to start the development environment. Usually we prefer to use a dedicated development instance.
- Start the dedicated development instance:
pnpm dev:diff- Launch a development instance with behavior similar to that of the distributor:
pnpm dev