Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

vp run ignores `cd` before a nested `vpr` in a script and runs the parent package's task

未关闭
#3,129 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@tlq5l 已经在做这个了。

开始于 2026年10月20日。

  • #867 来自 @tlq5l —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
node.js, rust
领域
backend, cli

调研方向

Start by tracing how vp run handles nested vpr commands and resolves their tasks; the issue provides a minimal reproduction with root and ui package scripts. Run the reproduction and compare vpr plain with vpr sub to confirm the working-directory behavior. Done when cd ui && vpr hello inside a script runs the ui package's task.

由索引模型根据 Issue 内容生成。

描述

bug
Describe the bug

If a package.json script does cd <dir> && vpr <task>, vp run ignores the cd. It looks up <task> in the package it started from instead of the one in <dir>. Putting the same command in a subshell, (cd <dir> && vpr <task>), gives the right result.

The log shows vp run running the nested vpr itself rather than handing the whole line to the shell. For plain it prints $ echo ROOT, which is the root's hello.

This happens without any pnpm workspace. The repro has no pnpm-workspace.yaml and no lockfile, so it's a different bug from #3013, though the symptom is the same: vpr in a subfolder runs the root's task.

Reproduction
mkdir repro && cd repro && mkdir ui
echo '{"name":"root","private":true,"scripts":{"hello":"echo ROOT","plain":"cd ui && vpr hello","sub":"(cd ui && vpr hello)"}}' > package.json
echo '{"name":"ui","private":true,"scripts":{"hello":"echo UI"}}' > ui/package.json

vpr plain   # prints ROOT, expected UI
vpr sub     # prints UI
(cd ui && vpr hello)   # from the shell: prints UI

Output:

$ vpr plain
$ echo ROOT ⊘ cache disabled
ROOT

$ vpr sub
$ (cd ui && vpr hello) ⊘ cache disabled
$ echo UI ⊘ cache disabled
UI
Expected

cd ui && vpr hello should run ui's hello, the same as it does in a shell or under npm run. If vp run handles a nested vpr itself, it should apply any earlier cd in the same command before it resolves the task.

Environment
  • vp v1.1.0 (global, no local vite-plus)
  • Node v24.19.0
  • Linux

Written by claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox.

主要语言
Rust
星标
6.3k
派生
283
平均合并
1 天 16 小时
30 天内合并 PR
214

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

voidzero-dev/vite-plus 的其他 Issue

查看 voidzero-dev/vite-plus 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。