Skip to content

Commit 35cbee0

Browse files
committed
fix(snap): sort vite_shared exports, show raw error output in root fixtures
- cargo fmt: alphabetize the interactivity module/exports in vite_shared (the Lint CI failure) and reflow touched files - drop `|| echo` from the app-root-listing, default-package-missing, and cwd-flag fixtures so the snapshots capture the real exit code (via the runner's [N] prefix) and full error output directly
1 parent 8bd2852 commit 35cbee0

17 files changed

Lines changed: 29 additions & 53 deletions

File tree

crates/vite_global_cli/src/commands/env/list_remote.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ fn strip_v(version: &str) -> &str {
117117

118118
/// Whether colored output should be emitted on stdout.
119119
fn use_color() -> bool {
120-
121120
vite_shared::is_stdout_terminal() && std::env::var_os("NO_COLOR").is_none()
122121
}
123122

crates/vite_global_cli/src/commands/env/pin.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
//! directory has no package.json. An explicit `--target` flag overrides the selection.
88
//! An existing `engines.node` is never deleted or modified.
99
10-
use std::{
11-
io::Write,
12-
process::ExitStatus,
13-
};
10+
use std::{io::Write, process::ExitStatus};
1411

1512
use vite_js_runtime::NodeProvider;
1613
use vite_path::AbsolutePathBuf;

crates/vite_global_cli/src/commands/global/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
//! Managed global package utilities.
22
3-
use std::{
4-
collections::HashMap,
5-
fs::File,
6-
io::Read,
7-
process::Stdio,
8-
time::Duration,
9-
};
3+
use std::{collections::HashMap, fs::File, io::Read, process::Stdio, time::Duration};
104

115
use flate2::read::GzDecoder;
126
use futures::{StreamExt, stream::FuturesUnordered};

crates/vite_global_cli/src/commands/implode.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
//! `vp implode` — completely remove vp and all its data from this system.
22
3-
use std::{
4-
io::Write,
5-
process::ExitStatus,
6-
};
3+
use std::{io::Write, process::ExitStatus};
74

85
use directories::BaseDirs;
96
use owo_colors::OwoColorize;

crates/vite_global_cli/src/shim/dispatch.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ fn check_npm_global_install_result(
231231
node_dir: &AbsolutePath,
232232
node_version: &str,
233233
) {
234-
235-
236234
let Ok(bin_dir) = config::get_bin_dir() else { return };
237235

238236
// Derive bin dir from prefix (Unix: prefix/bin, Windows: prefix itself)

crates/vite_shared/src/header.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
//! - Stream-based response parsing (modelled after `terminal-colorsaurus`)
99
//! - Gradient/fade generation and RGB ANSI coloring
1010
11-
use std::{
12-
sync::{LazyLock, OnceLock},
13-
};
11+
use std::sync::{LazyLock, OnceLock};
1412
#[cfg(unix)]
1513
use std::{
1614
io::Write,

crates/vite_shared/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ mod env_config;
1111
pub mod env_vars;
1212
mod error;
1313
pub mod header;
14-
mod interactivity;
1514
mod home;
1615
mod http;
16+
mod interactivity;
1717
mod json_edit;
1818
pub mod output;
1919
mod package_json;
@@ -25,11 +25,11 @@ mod tracing;
2525
pub use env_config::{EnvConfig, TestEnvGuard};
2626
pub use error::format_error_chain;
2727
pub use home::get_vp_home;
28+
pub use http::shared_http_client;
2829
pub use interactivity::{
2930
is_ci_environment, is_interactive_terminal, is_stderr_terminal, is_stdin_terminal,
3031
is_stdout_terminal,
3132
};
32-
pub use http::shared_http_client;
3333
pub use json_edit::{JsonStyle, edit_json_object, insert_after};
3434
pub use package_json::{
3535
DevEngineDependency, DevEngineField, DevEngines, Engines, OnFail, PackageJson, dev_engine_entry,

docs/guide/monorepo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ vp -C apps/web build
155155
vp -C packages/ui pack
156156
```
157157

158-
Passing a folder as a positional (`vp dev apps/web`) still works and keeps upstream Vite semantics: it sets Vite's `root` option without changing the working directory, so cwd-relative reads in configs and plugins resolve from where you ran vp. Prefer `-C` when the package should behave as if you had `cd`'d into it.
158+
Passing a folder as a positional (`vp dev apps/web`) still works and keeps upstream Vite semantics: it sets Vite's `root` option without changing the working directory, so cwd-relative reads in configs and plugins resolve from where you ran vp. Prefer `-C` when the package should behave as if you had `cd`'d into it.
159159

160160
- Run a bare app command at the workspace root and vp resolves the target for you: with [`defaultPackage`](/config/#defaultpackage) configured it runs there, and otherwise it prints the workspace packages with `-C` hints instead of silently serving or building the root.
161161

packages/cli/binding/src/check/analysis.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
use owo_colors::OwoColorize;
32
use vite_shared::output;
43

packages/cli/binding/src/cli/app_target.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ pub(super) fn resolve_app_target(
120120
return Ok(AppTarget::CurrentDir);
121121
}
122122

123-
let graph = vite_workspace::load_package_graph(&workspace_root)
124-
.map_err(|e| Error::Anyhow(e.into()))?;
123+
let graph =
124+
vite_workspace::load_package_graph(&workspace_root).map_err(|e| Error::Anyhow(e.into()))?;
125125
let mut rows: Vec<PackageRow> = graph
126126
.node_weights()
127127
.filter(|info| !info.path.as_str().is_empty())

0 commit comments

Comments
 (0)