Skip to content

fix(cli): keep subcommand cache config for -C in scripts - #3528

Open
BillWGong wants to merge 1 commit into
voidzero-dev:mainfrom
BillWGong:fix/chdir-cache-config
Open

BillWGong wants to merge 1 commit into
voidzero-dev:mainfrom
BillWGong:fix/chdir-cache-config

Conversation

@BillWGong

Copy link
Copy Markdown

Fixes #3503

A leading -C returned Verbatim from the script handler, so vp -C <dir> check / vp -C <dir> lint in a cached task skipped the cache config their direct counterparts get. OXLINT_TSGOLINT_PATH was neither fingerprinted nor passed through, so changing it replayed a stale cache, and check also ignored VP_SKIP_STATIC_CONFIG.

The command now stays untouched (the child still applies the chdir and reports bad targets) but is synthesized with the subcommand's cache config. The configs are factored out of SubcommandResolver::resolve so the normal and -C paths cannot drift. This also restores test/pack input exclusions and the disabled cache for dev/preview behind -C.

Tests: cargo test -p vite-plus-cli --lib (79 passed), cargo clippy -p vite-plus-cli --lib --tests -- -D warnings, cargo fmt --check.

A leading -C returned Verbatim from the script handler, so `vp -C <dir> check` and `vp -C <dir> lint` in a cached task never attached their tracked env vars. Keep the original command for the child, but synthesize it with the cache config the subcommand would use.
@BillWGong

Copy link
Copy Markdown
Author

this PR relies on the underlying cwd fix in voidzero-dev/vite-task#1005. Please ensure #1005 is merged first before merging this one.

The cache config logic has been factored out to avoid drift. Local tests (79 passed) and clippy are all green

@jong-kyung

Copy link
Copy Markdown
Collaborator

Thanks for the PR.
I’m already working on this issue, though.

@BillWGong

Copy link
Copy Markdown
Author

Understood
If you're already far along, I'll close this.
But if you want, I can keep it open as a reference for your implementation
Just let me know thx

This branch has not been deployed

No deployments
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 -C <dir> check and vp -C <dir> lint in cached tasks ignore their tracked environment variables

2 participants