rfc: global -C flag for working-directory switching#2022
Draft
fengmk2 wants to merge 19 commits into
Draft
Conversation
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
410ac4d to
ca5db55
Compare
fengmk2
commented
Jul 2, 2026
fengmk2
commented
Jul 2, 2026
fengmk2
left a comment
Member
Author
There was a problem hiding this comment.
Left a few inline RFC comments.
…packages in picker
…ot defaultPackage note
fengmk2
added a commit
that referenced
this pull request
Jul 3, 2026
…pp commands Implements rfcs/cwd-flag.md (RFC #2022): - vp -C <dir> <cmd> runs any command as if started in <dir> (git/make/pnpm convention), parsed by both the global binary and the local bin; the spawned tool gets <dir> as its working directory, no process.chdir - bare dev/build/preview/pack at a workspace root now resolve a target: defaultPackage from the root config (static extraction, works without a vite-plus install), single-runnable auto-select in interactive terminals, otherwise a package listing with -C hints and exit 1 - positional semantics are untouched: vite [root] and tsdown entries behave exactly as before (covered by a parity regression snap test) - interactive picker is a follow-up pending vite_select prompt support
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.
RFC for a global
-C <dir>flag and the monorepo app-command UX built on it:vp -C <dir> <cmd>behaves exactly likecd <dir> && vp <cmd>, for every vp command (thegit -C/make -Cconvention). This is the first-class "run there" primitive vp lacks today; it also givesvp packits missing directory form.vp dev <path>keeps upstream Vite semantics (rootonly), pack positionals stay tsdown entries, no flags are added to the subcommands themselves.-C, the app commands (dev/build/preview/pack) stop being silently wrong at a workspace root: an interactive fuzzy package picker in a TTY, adefaultPackageroot config (also covers non-workspace framework repos like Laravel with afrontend/directory), and a clear package listing plus exit 1 when non-interactive. All three expand to an implicit-C.Pain points are reproducible: https://github.com/why-reproductions-are-required/vite-plus-monorepo-app-commands-repro
Full UX mockups, behavior spec, decisions, and open questions are in
rfcs/cwd-flag.md.