fix: unexpected behavior while pulling resources
在 commit 25cfd162f6 中引入新的 pnpm prepare 执行脚本指令,而 prepare 关键字与包管理器的生命周期脚本冲突。导致在运行 Workflow 的时候被执行两次资源拉取,并且被当做生命周期脚本的时候没有携带预期的 \`${{ matrix.target }}\`。这一行为进一步影响 macOS Intel X86 平台上的构建。
所影响的 issues: #3753, #3771
3.6 KiB
CONTRIBUTING
Thank you for your interest in contributing to Clash Verge Rev! This document provides guidelines and instructions to help you set up your development environment and start contributing.
Development Setup
Before you start contributing to the project, you need to set up your development environment. Here are the steps you need to follow:
Prerequisites
- Install Rust and Node.js: Our project requires both Rust and Node.js. Please follow the instructions provided here to install them on your system.
Setup for Windows Users
If you're a Windows user, you may need to perform some additional steps:
- Make sure to add Rust and Node.js to your system's PATH. This is usually done during the installation process, but you can verify and manually add them if necessary.
- The gnu
patchtool should be installed
When you setup Rust environment, Only use toolchain with Windows MSVC , to change settings follow command:
rustup target add x86_64-pc-windows-msvc
rustup set default-host x86_64-pc-windows-msvc
Install Node.js Package
After installing Rust and Node.js, install the necessary Node.js and Node Package Manager:
npm install pnpm -g
Install Dependencies
Install node packages
pnpm install
Install apt packages ONLY for Ubuntu
apt-get install -y libxslt1.1 libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf
Download the Mihomo Core Binary
You have two options for downloading the clash binary:
- Automatically download it via the provided script:
pnpm run prebuild # Use '--force' to force update to the latest version # pnpm run prebuild --force - Manually download it from the Mihomo release. After downloading, rename the binary according to the Tauri configuration.
Run the Development Server
To run the development server, use the following command:
pnpm dev
# If an app instance already exists, use a different command
pnpm dev:diff
Build the Project
To build this project:
pnpm build
For a faster build, use the following command
pnpm build:fast
This uses Rust's fast-release profile which significantly reduces compilation time by disabling optimization and LTO. The resulting binary will be larger and less performant than the standard build, but it's useful for testing changes quickly.
The Artifacts will display in the log in the Terminal.
Build clean
To clean rust build:
pnpm clean
Portable Version (Windows Only)
To package portable version after the build:
pnpm portable
Contributing Your Changes
Before commit your changes
If you changed the rust code, it's recommanded to execute code style formatting and quailty checks.
- Code quailty checks
# For rust backend
$ clash-verge-rev: pnpm clippy
# For frontend (not yet).
- Code style formatting
# For rust backend
$ clash-verge-rev: cd src-tauri
$ clash-verge-rev/src-tauri: cargo fmt
# For frontend
$ clash-verge-rev: pnpm format:check
$ clash-verge-rev: pnpm format
Once you have made your changes:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes with clear and concise commit messages.
- Push your branch to your fork and submit a pull request to our repository.
We appreciate your contributions and look forward to your active participation in our project!