بنقرة واحدة
spawn-process
Guide for writing subprocess execution code using the vite_command crate
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Guide for writing subprocess execution code using the vite_command crate
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Bump vite-task git dependency to the latest main commit. Use when you need to update the vite-task git-dependency crates (vite_task, fspy, pty_terminal_test, and friends; the authoritative set lives in Cargo.toml) in vite-plus.
Run the standard vite-plus release process end-to-end as the release manager. Covers preparing the release PR, syncing the NAPI binding version, writing the categorized changelog, smoke-testing via a preview build, handling release-branch CI failures, merging, and post-release verification and announcements. Use when asked to cut, prepare, or manage a vite-plus release (e.g. "release v0.2.3", "act as release manager").
Compare tsdown CLI options with vp pack and sync any new or removed options. Use when tsdown is upgraded or when you need to check for CLI option drift between tsdown and vp pack.
Drive and capture vp's interactive (clack) prompts in a tmux session to manually verify interactive UX and catch spinner-over-prompt bugs. Use when asked to test/verify/capture an interactive vp command's prompts (vp migrate, vp create, ...), reproduce a prompt-rendering bug, or show the real interactive CLI output for a PR.
Verify a preview (registry bridge) build of vite-plus against a real project before release — run `vp migrate` from the preview commit against a local project, deps resolved through the registry bridge. Use when asked to verify/e2e-test a preview or pkg-pr-new build against a project, "test PR
Add a new ecosystem-ci test case for testing real-world projects against vite-plus
| name | spawn-process |
| description | Guide for writing subprocess execution code using the vite_command crate |
| allowed-tools | Read, Grep, Glob, Edit, Write, Bash |
When writing Rust code that needs to spawn subprocesses (resolve binaries, build commands, execute programs), always use the vite_command crate. Never use which, tokio::process::Command::new, or std::process::Command::new directly.
vite_command::resolve_bin(name, path_env, cwd) — Resolve a binary name to an absolute pathHandles PATHEXT (.cmd/.bat) on Windows. Pass None for path_env to search the current process PATH.
// Resolve using current PATH
let bin = vite_command::resolve_bin("node", None, &cwd)?;
// Resolve using a custom PATH
let custom_path = std::ffi::OsString::from(&path_env_str);
let bin = vite_command::resolve_bin("eslint", Some(&custom_path), &cwd)?;
vite_command::build_command(bin_path, cwd) — Build a command for a pre-resolved binaryReturns tokio::process::Command with cwd, inherited stdio, and fix_stdio_streams on Unix already configured. Add args, envs, or override stdio as needed.
let bin = vite_command::resolve_bin("eslint", None, &cwd)?;
let mut cmd = vite_command::build_command(&bin, &cwd);
cmd.args(&[".", "--fix"]);
cmd.env("NODE_ENV", "production");
let mut child = cmd.spawn()?;
let status = child.wait().await?;
vite_command::build_shell_command(shell_cmd, cwd) — Build a shell commandUses /bin/sh -c on Unix, cmd.exe /C on Windows. Same stdio and fix_stdio_streams setup as build_command.
let mut cmd = vite_command::build_shell_command("echo hello && ls", &cwd);
let mut child = cmd.spawn()?;
let status = child.wait().await?;
vite_command::run_command(bin_name, args, envs, cwd) — Resolve + build + run in one callCombines resolve_bin, build_command, and status().await. The envs HashMap must include "PATH" if you want custom PATH resolution.
let envs = HashMap::from([("PATH".to_string(), path_value)]);
let status = vite_command::run_command("node", &["--version"], &envs, &cwd).await?;
Add vite_command to the crate's Cargo.toml:
[dependencies]
vite_command = { workspace = true }
Do NOT add which as a direct dependency — binary resolution goes through vite_command::resolve_bin.
crates/vite_global_cli/src/shim/exec.rs uses synchronous std::process::Command with Unix exec() for process replacement. This is the only place that bypasses vite_command.