-
Notifications
You must be signed in to change notification settings - Fork 232
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
Open
fengmk2
wants to merge
53
commits into
fix-env-which-installed-date
Choose a base branch
from
feat/cwd-flag
base: fix-env-which-installed-date
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.
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
c240ee1
feat(cli): global -C flag and workspace-root target elicitation for a…
fengmk2 acc492f
refactor(cli): dedupe interactivity gate and vite config probing, nor…
fengmk2 21e4577
refactor: memoized terminal checks behind a clippy rule, document -C …
fengmk2 509ae9c
rfc: global -C flag for working-directory switching
fengmk2 d361078
fix(snap): sort vite_shared exports, show raw error output in root fi…
fengmk2 b099a8f
docs(monorepo): document the workspace-root app-command experience
fengmk2 1aa74b9
test(snap): add -C to the vp --help snapshot
fengmk2 1945e8b
test(snap): reset dist between pack forms to avoid platform-dependent…
fengmk2 bab43e1
test(snapshot): PTY coverage for app-root resolution
fengmk2 29a3a53
feat(cli): interactive package picker for bare app commands at the wo…
fengmk2 8f17190
test(snapshot): migrate cwd-flag and app-root snap tests to the PTY h…
fengmk2 8c8a69b
fix(cli): document -C in the local CLI help
fengmk2 feeab0f
fix(cli): pack runnable ranking requires a pack block or the tsdown d…
fengmk2 413f0b8
rfc: cite upstream defaults behind the runnable heuristic
fengmk2 260f1b0
test(snapshot): vp pack auto-select via tsdown default entry
fengmk2 40776f0
test(snapshot): single-package repos bypass elicitation
fengmk2 b525d26
refactor(cli): apply cleanup review to app-target elicitation
fengmk2 2057bf3
test(snapshot): re-record for byte-size redaction
fengmk2 0a02a62
fix(cli): address Codex review round 1
fengmk2 0174d57
fix(cli): address Codex review round 2
fengmk2 495d3de
fix(cli): address Codex review round 3
fengmk2 e8f345f
fix(cli): address Codex review round 4
fengmk2 9c907d2
fix(cli): address Codex review round 5
fengmk2 d274176
fix(cli): address Codex review round 6
fengmk2 092f445
test(snapshot): pin the member defaultPackage regression on a real wo…
fengmk2 50504bc
fix(cli): address Codex review round 7
fengmk2 82ba730
fix(cli): restore parse_leading_chdir test import lost in a restack
fengmk2 da50c1e
fix(cli): address Codex review round 9
fengmk2 1bd520f
fix(cli): treat pack --root as an explicit target
fengmk2 2192209
fix(cli): gate picker milestones behind VP_EMIT_MILESTONES
fengmk2 c128244
fix(cli): make chdir the single -C validation point in bin.ts
fengmk2 f232b80
refactor(cli): apply cleanup review across the -C and elicitation code
fengmk2 30bc3f6
fix(cli): keep normalize_args doc off apply_chdir
fengmk2 2517bb8
fix(cli): a runnable workspace root runs in place, TTY or not
fengmk2 9a798e9
test(snapshot): pin the non-TTY runnable-root rule on tsdown output only
fengmk2 210a24c
test(snapshot): re-record runnable-root headers for the comment change
fengmk2 bda10f9
build: bump vite-task pin to the #510 head (ca55bb232aa8) after v0.2.…
fengmk2 d4007d5
perf(cli): reuse the workspace root across target resolution
fengmk2 ce07ac8
ci: bound the PTY snapshot step with a 10-min timeout
fengmk2 ed0e9be
test(snapshot): cover vpr -C and the dev/build positional (Vite root)
fengmk2 1b8fb6f
fix(cli): honor TS-wrapped defaultPackage and config-only root builds
fengmk2 40c59ca
fix(cli): refine defaultPackage/root-build/config-flag handling per r…
fengmk2 d879829
test(snapshots): PTY-render the two build cases for Windows stability
fengmk2 7ec2626
fix(cli): address Codex review round 6
fengmk2 87780db
style: rustfmt the round-6 defaultPackage extractor tests
fengmk2 b8a74cf
test(snapshots): remove the temporary PTY step trace
fengmk2 560eed5
fix(cli): hand-emit picker milestones after the vite-task cb580c2 rebase
fengmk2 c8dabbd
fix(cli): deliver PWD to -C children on the non-JS spawn paths
fengmk2 b1e4300
chore(snapshots): drop a stray .md.new runner artifact
fengmk2 0eba149
test(snapshots): skip the PWD env-exec case on Windows
fengmk2 1394e3e
refactor(cli): apply simplify-review cleanups across the -C code
fengmk2 6bacff0
refactor(cli): use cfg! branches for the unix-only PWD sync
fengmk2 b6da3c6
docs: tighten the -C RFC and monorepo guide prose
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 legacy | ||
| snap runner. | ||
| """ | ||
| 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 legacy | ||
| snap runner. | ||
|
|
||
| ## `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> | ||
| ``` |
19 changes: 19 additions & 0 deletions
19
...ests/cli_snapshots/fixtures/app_root_auto_select/snapshots/auto_select.local.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,19 @@ | ||
| # 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 legacy | ||
| snap runner. | ||
|
|
||
| ## `vp build` | ||
|
|
||
| ``` | ||
| 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> | ||
| ``` |
6 changes: 6 additions & 0 deletions
6
...hots/tests/cli_snapshots/fixtures/app_root_default_package/dc_wrapper/frontend/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>frontend</h1> | ||
| </body> | ||
| </html> |
1 change: 1 addition & 0 deletions
1
...ts/tests/cli_snapshots/fixtures/app_root_default_package/dc_wrapper/frontend/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": "frontend", "private": true } |
1 change: 1 addition & 0 deletions
1
...i_snapshots/tests/cli_snapshots/fixtures/app_root_default_package/dc_wrapper/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": "dc-wrapper-config", "private": true } |
5 changes: 5 additions & 0 deletions
5
...snapshots/tests/cli_snapshots/fixtures/app_root_default_package/dc_wrapper/vite.config.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,5 @@ | ||
| import { defineConfig, type UserConfig } from 'vite-plus'; | ||
|
|
||
| export default defineConfig({ | ||
| defaultPackage: './frontend', | ||
| } satisfies UserConfig); |
1 change: 1 addition & 0 deletions
1
..._cli_snapshots/tests/cli_snapshots/fixtures/app_root_default_package/missing/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": "missing-default", "private": true } |
3 changes: 3 additions & 0 deletions
3
...li_snapshots/tests/cli_snapshots/fixtures/app_root_default_package/missing/vite.config.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 default { | ||
| defaultPackage: './packages/nope', | ||
| }; |
1 change: 1 addition & 0 deletions
1
crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/app_root_default_package/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-default-package", "private": true } |
1 change: 1 addition & 0 deletions
1
..._snapshots/tests/cli_snapshots/fixtures/app_root_default_package/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
..._snapshots/tests/cli_snapshots/fixtures/app_root_default_package/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}`; | ||
| } |
61 changes: 61 additions & 0 deletions
61
...s/vite_cli_snapshots/tests/cli_snapshots/fixtures/app_root_default_package/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,61 @@ | ||
| [[case]] | ||
| name = "default_package" | ||
| vp = ["local", "global"] | ||
| comment = """ | ||
| defaultPackage in the root config acts as an implicit -C for bare app | ||
| commands, including at a root that is not a JS workspace; vp prints a note | ||
| line and runs in the configured directory (rfcs/cwd-flag.md). | ||
| """ | ||
| steps = [ | ||
| ["vp", "pack"], | ||
| { argv = ["vpt", "list-dir", "packages/ui/dist"], comment = "output lands in the configured package" }, | ||
| ] | ||
|
|
||
| [[case]] | ||
| name = "default_package_missing" | ||
| vp = ["local", "global"] | ||
| comment = "defaultPackage pointing at a missing directory errors before any workspace lookup." | ||
| steps = [{ argv = ["vp", "build"], cwd = "missing" }] | ||
|
|
||
| [[case]] | ||
| name = "unanalyzable_config_ignored" | ||
| vp = ["local", "global"] | ||
| comment = """ | ||
| Regression guard for spread/unanalyzable configs: a config that only parses | ||
| as an open map might hide defaultPackage behind the spread, but that must | ||
| not fail the command. Bare vp build falls through and runs in place. | ||
| """ | ||
| # PTY-rendered (not tty = false): non-TTY steps record raw bytes, and the | ||
| # raw Windows byte stream of a vite build differs invisibly from macOS; the | ||
| # grid rendering normalizes that and is what the assertion needs anyway. | ||
| steps = [{ argv = ["vp", "build"], cwd = "spread" }] | ||
|
|
||
| [[case]] | ||
| name = "default_package_ts_wrapper" | ||
| vp = ["local", "global"] | ||
| comment = """ | ||
| Regression: defaultPackage declared through a TypeScript wrapper | ||
| (`satisfies UserConfig`, `as const`) is still a static string literal and | ||
| must be honored. vp builds ./frontend, not the wrapper root. | ||
| """ | ||
| steps = [{ argv = ["vp", "build"], cwd = "ts_wrapper" }] | ||
|
|
||
| [[case]] | ||
| name = "default_package_value_wrapper" | ||
| vp = ["local", "global"] | ||
| comment = """ | ||
| Regression: the TypeScript wrapper is on the defaultPackage VALUE | ||
| (`'./frontend' as const`), not the config object. Static extraction must | ||
| unwrap it too, so vp builds ./frontend rather than erroring that | ||
| defaultPackage is not a static string literal. | ||
| """ | ||
| steps = [{ argv = ["vp", "build"], cwd = "value_wrapper" }] | ||
|
|
||
| [[case]] | ||
| name = "default_package_define_config_wrapper" | ||
| vp = ["local", "global"] | ||
| comment = """ | ||
| defaultPackage inside `defineConfig({ ... } satisfies UserConfig)` is also | ||
| honored: the wrapper on the defineConfig argument is unwrapped too. | ||
| """ | ||
| steps = [{ argv = ["vp", "build"], cwd = "dc_wrapper" }] |
26 changes: 26 additions & 0 deletions
26
...snapshots/fixtures/app_root_default_package/snapshots/default_package.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,26 @@ | ||
| # default_package | ||
|
|
||
| defaultPackage in the root config acts as an implicit -C for bare app | ||
| commands, including at a root that is not a JS workspace; vp prints a note | ||
| line and runs in the configured directory (rfcs/cwd-flag.md). | ||
|
|
||
| ## `vp pack` | ||
|
|
||
| ``` | ||
| VITE+ - The Unified Toolchain for the Web | ||
| note: vp pack: using ./packages/ui (defaultPackage) | ||
| ℹ entry: src/index.ts | ||
| ℹ Build start | ||
| ℹ dist/index.mjs <size> kB │ gzip: <size> kB | ||
| ℹ 1 files, total: <size> kB | ||
| ✔ Build complete in <duration> | ||
| ``` | ||
|
|
||
| ## `vpt list-dir packages/ui/dist` | ||
|
|
||
| output lands in the configured package | ||
|
|
||
| ``` | ||
| index.mjs | ||
| ``` |
24 changes: 24 additions & 0 deletions
24
..._snapshots/fixtures/app_root_default_package/snapshots/default_package.local.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,24 @@ | ||
| # default_package | ||
|
|
||
| defaultPackage in the root config acts as an implicit -C for bare app | ||
| commands, including at a root that is not a JS workspace; vp prints a note | ||
| line and runs in the configured directory (rfcs/cwd-flag.md). | ||
|
|
||
| ## `vp pack` | ||
|
|
||
| ``` | ||
| note: vp pack: using ./packages/ui (defaultPackage) | ||
| ℹ entry: src/index.ts | ||
| ℹ Build start | ||
| ℹ dist/index.mjs <size> kB │ gzip: <size> kB | ||
| ℹ 1 files, total: <size> kB | ||
| ✔ Build complete in <duration> | ||
| ``` | ||
|
|
||
| ## `vpt list-dir packages/ui/dist` | ||
|
|
||
| output lands in the configured package | ||
|
|
||
| ``` | ||
| index.mjs | ||
| ``` |
18 changes: 18 additions & 0 deletions
18
..._root_default_package/snapshots/default_package_define_config_wrapper.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,18 @@ | ||
| # default_package_define_config_wrapper | ||
|
|
||
| defaultPackage inside `defineConfig({ ... } satisfies UserConfig)` is also | ||
| honored: the wrapper on the defineConfig argument is unwrapped too. | ||
|
|
||
| ## `cd dc_wrapper && vp build` | ||
|
|
||
| ``` | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
| note: vp build: using ./frontend (defaultPackage) | ||
| vite <version> building client environment for production... | ||
| ✓ 2 modules transformed. | ||
| computing gzip size... | ||
| dist/index.html <size> kB │ gzip: <size> kB | ||
|
|
||
| ✓ built in <duration> | ||
| ``` |
16 changes: 16 additions & 0 deletions
16
...p_root_default_package/snapshots/default_package_define_config_wrapper.local.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,16 @@ | ||
| # default_package_define_config_wrapper | ||
|
|
||
| defaultPackage inside `defineConfig({ ... } satisfies UserConfig)` is also | ||
| honored: the wrapper on the defineConfig argument is unwrapped too. | ||
|
|
||
| ## `cd dc_wrapper && vp build` | ||
|
|
||
| ``` | ||
| note: vp build: using ./frontend (defaultPackage) | ||
| vite <version> building client environment for production... | ||
| ✓ 2 modules transformed. | ||
| computing gzip size... | ||
| dist/index.html <size> kB │ gzip: <size> kB | ||
|
|
||
| ✓ built in <duration> | ||
| ``` |
13 changes: 13 additions & 0 deletions
13
...s/fixtures/app_root_default_package/snapshots/default_package_missing.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,13 @@ | ||
| # default_package_missing | ||
|
|
||
| defaultPackage pointing at a missing directory errors before any workspace lookup. | ||
|
|
||
| ## `cd missing && vp build` | ||
|
|
||
| **Exit code:** 1 | ||
|
|
||
| ``` | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
| error: defaultPackage points to a missing directory: ./packages/nope | ||
| ``` |
11 changes: 11 additions & 0 deletions
11
...ts/fixtures/app_root_default_package/snapshots/default_package_missing.local.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,11 @@ | ||
| # default_package_missing | ||
|
|
||
| defaultPackage pointing at a missing directory errors before any workspace lookup. | ||
|
|
||
| ## `cd missing && vp build` | ||
|
|
||
| **Exit code:** 1 | ||
|
|
||
| ``` | ||
| error: defaultPackage points to a missing directory: ./packages/nope | ||
| ``` |
19 changes: 19 additions & 0 deletions
19
...ixtures/app_root_default_package/snapshots/default_package_ts_wrapper.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,19 @@ | ||
| # default_package_ts_wrapper | ||
|
|
||
| Regression: defaultPackage declared through a TypeScript wrapper | ||
| (`satisfies UserConfig`, `as const`) is still a static string literal and | ||
| must be honored. vp builds ./frontend, not the wrapper root. | ||
|
|
||
| ## `cd ts_wrapper && vp build` | ||
|
|
||
| ``` | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
| note: vp build: using ./frontend (defaultPackage) | ||
| vite <version> building client environment for production... | ||
| ✓ 2 modules transformed. | ||
| computing gzip size... | ||
| dist/index.html <size> kB │ gzip: <size> kB | ||
|
|
||
| ✓ built in <duration> | ||
| ``` |
17 changes: 17 additions & 0 deletions
17
...fixtures/app_root_default_package/snapshots/default_package_ts_wrapper.local.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,17 @@ | ||
| # default_package_ts_wrapper | ||
|
|
||
| Regression: defaultPackage declared through a TypeScript wrapper | ||
| (`satisfies UserConfig`, `as const`) is still a static string literal and | ||
| must be honored. vp builds ./frontend, not the wrapper root. | ||
|
|
||
| ## `cd ts_wrapper && vp build` | ||
|
|
||
| ``` | ||
| note: vp build: using ./frontend (defaultPackage) | ||
| vite <version> building client environment for production... | ||
| ✓ 2 modules transformed. | ||
| computing gzip size... | ||
| dist/index.html <size> kB │ gzip: <size> kB | ||
|
|
||
| ✓ built in <duration> | ||
| ``` |
20 changes: 20 additions & 0 deletions
20
...ures/app_root_default_package/snapshots/default_package_value_wrapper.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,20 @@ | ||
| # default_package_value_wrapper | ||
|
|
||
| Regression: the TypeScript wrapper is on the defaultPackage VALUE | ||
| (`'./frontend' as const`), not the config object. Static extraction must | ||
| unwrap it too, so vp builds ./frontend rather than erroring that | ||
| defaultPackage is not a static string literal. | ||
|
|
||
| ## `cd value_wrapper && vp build` | ||
|
|
||
| ``` | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
| note: vp build: using ./frontend (defaultPackage) | ||
| 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.