Skip to content

fix(migrate): reject workspace member targets#2229

Draft
leslieeilsel wants to merge 1 commit into
voidzero-dev:mainfrom
leslieeilsel:agent/fix-migrate-target-path
Draft

fix(migrate): reject workspace member targets#2229
leslieeilsel wants to merge 1 commit into
voidzero-dev:mainfrom
leslieeilsel:agent/fix-migrate-target-path

Conversation

@leslieeilsel

Copy link
Copy Markdown

Summary

  • reject vp migrate when its target is inside a detected workspace but is not the workspace root
  • direct users to rerun migration from the workspace root before any files are changed
  • document the workspace-root requirement and add CLI snapshot coverage for implicit and explicit member targets

Why

parseArgs() preserves a nested target such as a workspace member, but detectWorkspace() promotes the migration root to the enclosing workspace. The rest of migration then operates on that root, so running vp migrate . from a member can unexpectedly rewrite the outer workspace.

Migration updates shared package-manager configuration, catalogs, and lockfiles, so treating a workspace member as a standalone migration target is not safe. This change fails early instead.

Fixes #2124.

Validation

  • node packages/cli/bin/vp check packages/cli/src/migration/bin.ts
  • pnpm -F vite-plus exec vitest run src/migration (365 tests)
  • VP_SNAP_SKIP_FLAVORS=local cargo test -p vite_cli_snapshots -- migration_workspace_member_target
  • existing migration_subpath snapshot
  • existing migration_monorepo_pnpm snapshot
  • cargo fmt --all -- --check

@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit b7c8aa8
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a61dd0fcbc67c000812b256
😎 Deploy Preview https://deploy-preview-2229--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant