fix(create): improve UX when running vp create from monorepo subdirectories#662
Merged
fix(create): improve UX when running vp create from monorepo subdirectories#662
vp create from monorepo subdirectories#662Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c34d31b to
c5270c2
Compare
c5270c2 to
a54d12e
Compare
fbf4a29 to
e3478c1
Compare
a54d12e to
0c609cf
Compare
vp create from monorepo subdirectoriesvp create from monorepo subdirectories
e3478c1 to
d8fe16b
Compare
b6c0189 to
332eaf9
Compare
332eaf9 to
1da744e
Compare
cpojer
approved these changes
Mar 2, 2026
…rectories When a user runs `vp create` from a subdirectory of a monorepo, the command auto-detects the workspace root and creates packages relative to that root. This can be confusing since the user expects location-awareness. Changes: - Show "Detected monorepo root at <path>" info message when in a subdir - In interactive mode, add a "current directory" option to the parent dir selector when the user's cwd is not under a standard workspace pattern dir, and default to it - In non-interactive mode, show a hint about using --directory - Add snap test covering all edge cases: workspace subdir, workspace parent dir, non-workspace dir, and --directory from a subdir
When running `vp create` from a subdirectory that has a plain package.json (without workspaces) somewhere up the tree, detectWorkspace would walk up and set rootDir to that parent directory. This caused projects to be created at the parent root instead of the user's current directory. Reset rootDir to cwd when isMonorepo is false, since the parent root is only meaningful for monorepo workspace resolution.
…typing When the user presses Enter on the "Package name:" prompt without typing, `@clack/core` passes `undefined` as the value to validate. The old condition `value != null && value.length === 0` skipped `undefined`, causing validation to fail with "Invalid package name". Changed to `value == null || value.length === 0` so both `undefined` and empty string are treated as "use the default".
1da744e to
a976847
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
vp createfrom a monorepo subdirectory--directoryrootDirreset to cwd for non-monorepovp create(previously walked up to a parent withpackage.json)undefinedas "use the default")Test plan
--directoryfrom a subdir