fix(vite_task): pass raw args to dev command#198
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes argument handling for the vite dev command and enhances debugging capabilities. The main issue was that hyphenated arguments (like --port) weren't being properly passed to the Vite dev server due to incorrect clap configuration.
- Fixed argument parsing for
vite devcommand to properly handle hyphenated arguments - Enhanced debugging output with command execution details including duration and exit status
- Added test coverage for the port argument handling scenario
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/vite_task/src/lib.rs | Updated clap attribute to properly handle hyphenated arguments in dev command |
| crates/vite_task/src/schedule.rs | Added detailed debug logging for executed commands |
| crates/vite_task/src/execute.rs | Removed unnecessary debug log output |
| packages/cli/snap-tests/command-dev-with-port/ | Added new snapshot test to verify port argument handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
579a25a to
a1cbc54
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Brooooooklyn
approved these changes
Sep 24, 2025
Member
Author
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.

TL;DR
Fix argument handling for the
vite devcommand and improve debugging information.What changed?
vite devcommand by replacing#[clap(last = true)]with#[arg(allow_hyphen_values = true, trailing_var_arg = true)]to properly support hyphenated argumentsTaskEnvsvite devcommand correctly handles port argumentsHow to test?
Run the new snapshot test to verify that the
vite devcommand correctly handles the--portargument:cd packages/cli/snap-tests/command-dev-with-port vite dev --port 12312312312The command should properly pass the port argument to the dev server and show the expected RangeError.
Why make this change?
The previous implementation didn't properly handle hyphenated arguments for the
vite devcommand, which could cause issues when users tried to pass options like--port. This change ensures that all arguments, including those with hyphens, are correctly passed to the underlying Vite process. The additional logging also helps with debugging task execution.