-
Notifications
You must be signed in to change notification settings - Fork 228
feat(cli): global -C flag for working-directory switching #2031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
fengmk2
wants to merge
36
commits into
main
Choose a base branch
from
feat/cwd-flag
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,524
−181
Draft
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
fc9a37d
feat(cli): global -C flag and workspace-root target elicitation for a…
fengmk2 02bcc81
refactor(cli): dedupe interactivity gate and vite config probing, nor…
fengmk2 0a94de1
refactor: memoized terminal checks behind a clippy rule, document -C …
fengmk2 406d2a7
rfc: global -C flag for working-directory switching
fengmk2 ba34cce
fix(snap): sort vite_shared exports, show raw error output in root fi…
fengmk2 49b9b43
docs(monorepo): document the workspace-root app-command experience
fengmk2 11a7684
test(snap): add -C to the vp --help snapshot
fengmk2 cf23d5c
test(snap): reset dist between pack forms to avoid platform-dependent…
fengmk2 d7dae58
test(snapshot): PTY coverage for app-root resolution
fengmk2 cbc4b95
feat(cli): interactive package picker for bare app commands at the wo…
fengmk2 d026c9b
test(snapshot): migrate cwd-flag and app-root snap tests to the PTY h…
fengmk2 b145aaf
fix(cli): document -C in the local CLI help
fengmk2 aacf6b0
fix(cli): pack runnable ranking requires a pack block or the tsdown d…
fengmk2 93a15b7
rfc: cite upstream defaults behind the runnable heuristic
fengmk2 28b48fe
test(snapshot): vp pack auto-select via tsdown default entry
fengmk2 0ace334
test(snapshot): single-package repos bypass elicitation
fengmk2 812fb3c
refactor(cli): apply cleanup review to app-target elicitation
fengmk2 1158d73
test(snapshot): re-record for byte-size redaction
fengmk2 27d96a5
fix(cli): address Codex review round 1
fengmk2 99d1f53
fix(cli): address Codex review round 2
fengmk2 e30cc28
fix(cli): address Codex review round 3
fengmk2 f147d3c
fix(cli): address Codex review round 4
fengmk2 6617c54
fix(cli): address Codex review round 5
fengmk2 20c9d63
fix(cli): address Codex review round 6
fengmk2 9542ae9
test(snapshot): pin the member defaultPackage regression on a real wo…
fengmk2 052df7a
fix(cli): address Codex review round 7
fengmk2 da77383
fix(cli): restore parse_leading_chdir test import lost in a restack
fengmk2 e66242b
fix(cli): address Codex review round 9
fengmk2 3383bdb
fix(cli): treat pack --root as an explicit target
fengmk2 64ff309
fix(cli): gate picker milestones behind VP_EMIT_MILESTONES
fengmk2 e4e0206
fix(cli): make chdir the single -C validation point in bin.ts
fengmk2 f2db2ee
refactor(cli): apply cleanup review across the -C and elicitation code
fengmk2 8dec264
fix(cli): keep normalize_args doc off apply_chdir
fengmk2 f80fed5
fix(cli): a runnable workspace root runs in place, TTY or not
fengmk2 24446a2
test(snapshot): pin the non-TTY runnable-root rule on tsdown output only
fengmk2 95cfbc7
test(snapshot): re-record runnable-root headers for the comment change
fengmk2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
6 changes: 6 additions & 0 deletions
6
.../vite_cli_snapshots/tests/cli_snapshots/fixtures/app_root_auto_select/apps/web/index.html
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <body> | ||
| <h1>web</h1> | ||
| </body> | ||
| </html> |
1 change: 1 addition & 0 deletions
1
...ite_cli_snapshots/tests/cli_snapshots/fixtures/app_root_auto_select/apps/web/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "web", "private": true } |
1 change: 1 addition & 0 deletions
1
crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/app_root_auto_select/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "app-root-auto-select", "private": true, "workspaces": ["apps/*", "packages/*"] } |
1 change: 1 addition & 0 deletions
1
..._cli_snapshots/tests/cli_snapshots/fixtures/app_root_auto_select/packages/ui/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "name": "ui", "private": true, "type": "module", "main": "src/index.ts" } |
3 changes: 3 additions & 0 deletions
3
..._cli_snapshots/tests/cli_snapshots/fixtures/app_root_auto_select/packages/ui/src/index.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function hello(name: string): string { | ||
| return `hello ${name}`; | ||
| } |
10 changes: 10 additions & 0 deletions
10
crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/app_root_auto_select/snapshots.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [[case]] | ||
| name = "auto_select" | ||
| vp = ["local", "global"] | ||
| comment = """ | ||
| With exactly one likely-runnable package, a bare app command in an interactive | ||
| terminal auto-selects it, prints the Selected/Tip teaching lines, and runs | ||
| there (rfcs/cwd-flag.md). This TTY-only branch was untestable in the old | ||
| harness. | ||
| """ | ||
| steps = [["vp", "build"]] |
21 changes: 21 additions & 0 deletions
21
...sts/cli_snapshots/fixtures/app_root_auto_select/snapshots/auto_select.global.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # auto_select | ||
|
|
||
| With exactly one likely-runnable package, a bare app command in an interactive | ||
| terminal auto-selects it, prints the Selected/Tip teaching lines, and runs | ||
| there (rfcs/cwd-flag.md). This TTY-only branch was untestable in the old | ||
| harness. | ||
|
|
||
| ## `vp build` | ||
|
|
||
| ``` | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
| Selected package: web (apps/web) | ||
| Tip: run this directly with `vp -C apps/web build` | ||
| vite <version> building client environment for production... | ||
| ✓ 2 modules transformed. | ||
| computing gzip size... | ||
| dist/index.html <size> kB │ gzip: <size> kB | ||
|
|
||
| ✓ built in <duration> | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.