感谢你对 PLVS 的兴趣。以下为本地开发与 CI 约定;产品范围与承诺见 docs/prd.md,技术架构见 docs/architecture.md。
- Node.js:>= 20.19.0(与
package.json的engines一致) - Rust:stable(与
src-tauri/Cargo.toml的rust-version一致) - FFmpeg sidecar:
npm run ffmpeg:fetch。src-tauri/binaries/不入库(sidecar 走 Release 资产),新 clone 和新 worktree 都是空的,缺了它 Rust 侧构建会失败——而且报错指向serde_derive编译失败这种无关的第三方 crate,真正原因埋在 build script 的输出里。构建流程见docs/ffmpeg-sidecar-build.md。
npm ci
npm run ffmpeg:fetch # once per clone/worktree: downloads the gitignored FFmpeg sidecars
npm run theme:generate # optional: regenerates src/generated/theme-fallbacks.css (also runs via prebuild)
npm run lint
npm test
npm run build桌面端(Tauri):
npm run desktopWindows 发布构建(与 CI release.yml 一致:NSIS 安装包 + target/release/app.exe 便携主程序):
npm run build
npm run desktop:release-nsis产物:src-tauri/target/release/bundle/nsis/ 下的安装程序,以及 src-tauri/target/release/plvs.exe(便携版依赖本机已安装 WebView2,与安装包相同)。
Rust(在 src-tauri 目录下):
cd src-tauri
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test根目录一键检查 前端 + 版本号 + Rust 格式/静态检查/测试:
npm run check发布或 bump 版本时,请同时修改(并保持三者一致):
- 根目录
package.json的version src-tauri/Cargo.toml中[package]的versionsrc-tauri/tauri.conf.json的version
npm run version:check 会校验上述三处一致;CI 中也会运行。若改了 Cargo.toml 依赖,请在 src-tauri 下执行 cargo check 并视情况提交 Cargo.lock。
All comments and docstrings in source code (*.rs, *.js, *.jsx, *.css, etc.) must be English (line/block/JSDoc, Rust /// / //!). String literals that must match localized OS or UI text (e.g. Windows device name heuristics) are exempt.
Use English only for commit messages, PR titles/descriptions, and any text that accompanies git push (no Chinese in those strings).
Changelist (CL) descriptions—the full narrative in a pull request body (or any equivalent review “description” field)—must also be English (what changed, why, risks or follow-ups in clear technical prose).
- Pull request / push 到
main:见.github/workflows/ci.yml(前端 + Ubuntu 上 Rust;Windows 上 Rustfmt/clippy/test)。 - Windows 安装包:打
v*标签触发.github/workflows/release.yml。
仓库已启用 Dependabot(npm 与 cargo,每周)。合并前请在本地跑一遍 npm run check。
仓库使用 LF(见 .editorconfig 与 .gitattributes)。在 Windows 上若 Git 仍提示 CRLF,可执行 git add --renormalize . 一次性规范化。