Skip to content

vp migrate from a workspace-member cwd migrates the workspace root — explicit path argument ignored #2124

Description

@beorn

Describe the bug

cd outer/vendor/sub   # outer = {"workspaces": ["vendor/*"]}, no lockfile
bunx -p vite-plus@0.2.4 vp migrate --no-interactive --no-agent --no-editor --no-hooks
# ◇ Migrated ../.. to Vite+ 0.2.4     ← the ROOT, not the cwd

bunx -p vite-plus@0.2.4 vp migrate . --no-interactive --no-agent --no-editor --no-hooks
# ◇ Migrated ../..                    ← explicit "." also ignored

The migrate guide says: "If omitted … migrates the current directory" / "If provided, it migrates that target directory instead."

One run rewrote the outer root — package.json (+catalog: devDeps, +devEngines → pnpm), pnpm-workspace.yaml, pnpm-lock.yaml, root vite.config.ts, node_modules — and the member (scripts → vp test, devDeps → catalog: into the OUTER catalog, vitest imports → vite-plus/test).

Severity: vp's embedded agent guidance says to run vp migrate --no-interactive; from a member/submodule cwd it silently rewrites the enclosing monorepo. (pnpm switch seen on a lockfile-less root; the targeting defect is independent. Nearest existing: closed #2005.)

Reproduction URL

https://github.com/beorn/repro-vite-plus-migrate-root

Steps to reproduce

Clone to a scratch dir (the run mutates it) → cd vendor/sub → run the command above.

System info

vp 0.2.4 (vp env n/a at 0.2.4); system bun 1.3.x; node 24; macOS arm64.

Used Package Manager

bun

Validations

vp migrate-specific. No existing report for root/monorepo targeting.


Disclosure: prepared with help from Claude Fable (Anthropic) as part of our Bun-monorepo → Vite+ effort; verified with live runs and human-reviewed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions