Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36
refactor(session): improve CLI error rendering and extract TaskErrorHints#301
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9cd25bad826c6d53818aea3f3e87a8df092688a9a5c3a651d451675e012df28File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -9,8 +9,8 @@ use clap::Parser; | ||
| use vite_path::AbsolutePath; | ||
| use vite_str::Str; | ||
| use vite_task::{ | ||
| Command, EnabledCacheConfig, HandledCommand, ScriptCommand, SessionConfig, UserCacheConfig, | ||
| get_path_env, plan_request::SyntheticPlanRequest, | ||
| Command, EnabledCacheConfig, HandledCommand, ScriptCommand, SessionConfig, TaskErrorHints, | ||
| UserCacheConfig, get_path_env, plan_request::SyntheticPlanRequest, | ||
| }; | ||
| #[derive(Debug, Default)] | ||
| @@ -105,6 +105,15 @@ impl vite_task::CommandHandler for CommandHandler { | ||
| Args::Task(parsed) => Ok(HandledCommand::ViteTaskCommand(parsed)), | ||
| } | ||
| } | ||
| fn task_error_hints(&self) -> TaskErrorHints { | ||
| TaskErrorHints { | ||
| task_list_hint: Str::from("Run `vt run` to browse available tasks."), | ||
| task_source_hint: Str::from( | ||
| "Check `vite-task.json` and `package.json` scripts where tasks are defined.", | ||
Comment on lines
+111
to
+113
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't hard-code Use | ||
| ), | ||
| } | ||
| } | ||
| } | ||
| /// A `UserConfigLoader` implementation that only loads `vite-task.json`. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "nested-task-not-found-test", | ||
| "private": true, | ||
| "workspaces": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [[e2e]] | ||
| name = "nested task not found" | ||
| steps = [["vt", "run", "repro"]] | ||
| [[e2e]] | ||
| name = "nested task not found verbose" | ||
| steps = [["vt", "run", "repro", "--verbose"]] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| source: crates/vite_task_bin/tests/e2e_snapshots/main.rs | ||
| expression: e2e_outputs | ||
| --- | ||
| [1]> vt run repro --verbose | ||
| Task "missing-task" not found. | ||
| nested-task-not-found-test#repro depends on "missing-task" via `vt run missing-task`. | ||
| Next steps: | ||
| Run `vt run` to browse available tasks. | ||
| Check `vite-task.json` and `package.json` scripts where tasks are defined. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| source: crates/vite_task_bin/tests/e2e_snapshots/main.rs | ||
| expression: e2e_outputs | ||
| --- | ||
| [1]> vt run repro | ||
| Task "missing-task" not found. | ||
| nested-task-not-found-test#repro depends on "missing-task" via `vt run missing-task`. | ||
| Next steps: | ||
| Run `vt run` to browse available tasks. | ||
| Check `vite-task.json` and `package.json` scripts where tasks are defined. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "tasks": { | ||
| "repro": { | ||
| "command": "vt run missing-task" | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vite_task_binis an executable for for internal development (seehttps://github.com/voidzero-dev/vite-task/blob/076cef486127e6cd1fefc58945f00dac316888ca/CONTRIBUTING.md#development-workflow).
Changes in this crate won't appear in
vp rundistributed in vite+.