vp run ignores `cd` before a nested `vpr` in a script and runs the parent package's task
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 6.3k
- Forks
- 283
- Merge médio
- 1d 16h
- PRs com merge (30d)
- 214
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de voidzero-dev/vite-plus
-
pending triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
voidzero-dev/vite-plus#2882 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
voidzero-dev/vite-plus#2097 · 10 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
defineConfig drops own properties of Promise plugins (breaks Vike discovery)Talvez já em andamento @liangmiQwQ assumiu hoje. Abertabug
voidzero-dev/vite-plus#3152 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
vpx: watch reports for `vpx --watch`, and `vpx watch` on oxc-node's watcherTalvez já em andamento @fengmk2 assumiu hoje. Aberta
voidzero-dev/vite-plus#3141 · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Document cross-platform `FOO=bar cmd` in task commands and scriptsTalvez já em andamento @hyunbinseo assumiu hoje. Abertadocumentation
voidzero-dev/vite-plus#3140 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de voidzero-dev/vite-plus
Issues semelhantes
-
meta.json, text.txt and try JSON are written non-atomicallyTalvez já em andamento @qwertymuzaffar assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
qwertymuzaffar/parrot#47 ·
Mantenedores costumam responder em até 1 dia
-
Alt select PhotocraftAbertapriority: medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
storytold/photocraft#8041 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
fmt -p: an unprefixed last line without a newline gets one addedTalvez já em andamento @fixfon assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
jhspetersson/fselect#187 ·
-
documentation good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
writerslogic/holographic-memory#96 ·
Mantenedores costumam responder em até 1 dia