From f6121c8612cec8b058cf961213bb425d9923b2dd Mon Sep 17 00:00:00 2001 From: Liang Date: Sat, 26 Sep 2026 15:28:47 +0800 Subject: [PATCH 1/2] fix(cli): align global remove success output with install --- .../snapshots/command_env_install_conflict.md | 4 ++-- .../command_env_install_node_version.md | 4 ++-- .../command_env_install_parallel/snapshots.toml | 4 ++-- .../snapshots/command_env_install_parallel.md | 16 ++++++++-------- .../command_env_install_version_alias.md | 4 ++-- .../snapshots/command_env_which.md | 2 +- .../snapshots/env_install_binary_conflict.md | 4 ++-- .../npm_global_install_already_linked.md | 2 +- .../snapshots/npm_global_uninstall_vp_managed.md | 2 +- .../snapshots/shim_recursive_package_binary.md | 2 +- .../vp_global_cli/src/commands/global/install.rs | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md index ef3858f9af..1562dc129e 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md @@ -18,7 +18,7 @@ warn: Package 'conflict-pkg' provides 'node' binary, but it conflicts with a bui Cleanup ``` -Uninstalled conflict-pkg +✓ Uninstalled conflict-pkg ``` ## `vp install -g --node 20 ./conflict-pkg` @@ -39,5 +39,5 @@ warn: Package 'conflict-pkg' provides 'node' binary, but it conflicts with a bui Cleanup ``` -Uninstalled conflict-pkg +✓ Uninstalled conflict-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md index 6a10bde4d1..0ea087beba 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md @@ -25,7 +25,7 @@ Node major: 22 Cleanup ``` -Uninstalled command-env-install-node-version-pkg +✓ Uninstalled command-env-install-node-version-pkg ``` ## `vp install -g --node 20 ./command-env-install-node-version-pkg` @@ -53,5 +53,5 @@ Node major: 20 Cleanup ``` -Uninstalled command-env-install-node-version-pkg +✓ Uninstalled command-env-install-node-version-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml index 7a8a0a8f12..34e7516283 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml @@ -2,8 +2,8 @@ name = "command_env_install_parallel" vp = "global" steps = [ - { argv = ["vp", "install", "-g", "--concurrency", "1", "./parallel-pkg-a", "./parallel-pkg-b"], comment = "Install multiple global packages", continue-on-failure = true }, + { argv = ["vp", "install", "-g", "--concurrency", "1", "./parallel-pkg-a", "./parallel-pkg-b"], comment = "Install multiple global packages", formatted-snapshot = true, continue-on-failure = true }, { argv = ["parallel-a"], comment = "Both binaries should be callable" }, { argv = ["parallel-b"], continue-on-failure = true }, - { argv = ["vp", "remove", "-g", "parallel-pkg-a", "parallel-pkg-b"], comment = "Cleanup", continue-on-failure = true }, + { argv = ["vp", "remove", "-g", "parallel-pkg-a", "parallel-pkg-b"], comment = "Removal uses the same success marker and package styling as installation", formatted-snapshot = true, continue-on-failure = true }, ] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md index 1c5b490033..63724c726a 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md @@ -7,12 +7,12 @@ Install multiple global packages ``` VITE+ - The Unified Toolchain for the Web -info: Installing 2 global packages with Node.js -✓ Installed parallel-pkg-a 1.0.0 - Bins: parallel-a +\x1b[94;1minfo: Installing 2 global packages with Node.js +\x1b[32m\xe2\x9c\x93 Installed \x1b[1mparallel-pkg-a \x1b[1m1.0.0 + Bins: \x1b[1mparallel-a -✓ Installed parallel-pkg-b 2.0.0 - Bins: parallel-b +\x1b[32m\xe2\x9c\x93 Installed \x1b[1mparallel-pkg-b \x1b[1m2.0.0 + Bins: \x1b[1mparallel-b ``` ## `parallel-a` @@ -31,9 +31,9 @@ parallel-b ok ## `vp remove -g parallel-pkg-a parallel-pkg-b` -Cleanup +Removal uses the same success marker and package styling as installation ``` -Uninstalled parallel-pkg-a -Uninstalled parallel-pkg-b +\x1b[32m\xe2\x9c\x93 Uninstalled \x1b[1mparallel-pkg-a +\x1b[32m\xe2\x9c\x93 Uninstalled \x1b[1mparallel-pkg-b ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md index 0ec790c788..9b90dae6b8 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md @@ -25,7 +25,7 @@ LTS major >= 20: true Cleanup ``` -Uninstalled command-env-install-version-alias-pkg +✓ Uninstalled command-env-install-version-alias-pkg ``` ## `vp install -g --node latest ./command-env-install-version-alias-pkg` @@ -53,5 +53,5 @@ Latest major >= 20: true Cleanup ``` -Uninstalled command-env-install-version-alias-pkg +✓ Uninstalled command-env-install-version-alias-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md index ff6f63c95b..9b7db2c091 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md @@ -75,7 +75,7 @@ VITE+ - The Unified Toolchain for the Web Cleanup ``` -Uninstalled cowsay +✓ Uninstalled cowsay ``` ## `vp env which unknown-tool` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md index 556d45709a..7e9161fdcb 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md @@ -64,7 +64,7 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js Uninstalling env-binary-conflict-pkg-a (conflicts with env-binary-conflict-pkg-b)... -Uninstalled env-binary-conflict-pkg-a +✓ Uninstalled env-binary-conflict-pkg-a ✓ Installed env-binary-conflict-pkg-b 2.0.0 Bins: env-binary-conflict-cli ``` @@ -88,7 +88,7 @@ Bin config should now point to pkg-b Cleanup ``` -Uninstalled env-binary-conflict-pkg-b +✓ Uninstalled env-binary-conflict-pkg-b ``` ## `vpt stat-file $VP_HOME/bins/env-binary-conflict-cli.json --assert missing` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md index cf4bc108e9..d7b3c07f71 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md @@ -41,7 +41,7 @@ Skipped 'npm-global-linked-cli': managed by `vp install -g npm-global-linked-pkg Cleanup ``` -Uninstalled npm-global-linked-pkg +✓ Uninstalled npm-global-linked-pkg ``` ## `vpt stat-file $VP_HOME/bin/npm-global-linked-cli` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md index a8d19976f7..003819b6a1 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md @@ -52,5 +52,5 @@ npm-global-vp-managed-cli works Cleanup ``` -Uninstalled npm-global-vp-managed-pkg +✓ Uninstalled npm-global-vp-managed-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md index e2ba0ca041..6d58edd226 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md @@ -26,5 +26,5 @@ inner call succeeded Cleanup ``` -Uninstalled recursive-cli-pkg +✓ Uninstalled recursive-cli-pkg ``` diff --git a/crates/vp_global_cli/src/commands/global/install.rs b/crates/vp_global_cli/src/commands/global/install.rs index 5a70953c69..ae55fa7fc5 100644 --- a/crates/vp_global_cli/src/commands/global/install.rs +++ b/crates/vp_global_cli/src/commands/global/install.rs @@ -1044,7 +1044,7 @@ pub async fn uninstall(package_name: &str, dry_run: bool) -> Result<(), Error> { // Remove metadata file PackageMetadata::delete(&package_name).await?; - output::raw(&format!("Uninstalled {}", package_name)); + output::success(&format!("Uninstalled {}", style(&package_name).bold())); Ok(()) } From 71a69a554d215946454ed99b22c3843374f5d430 Mon Sep 17 00:00:00 2001 From: Liang Date: Sat, 26 Sep 2026 15:31:25 +0800 Subject: [PATCH 2/2] fix(cli): use plus and minus for global package operations --- .../command_env_global_install_multiple_fail.md | 2 +- .../snapshots/command_env_install_conflict.md | 8 ++++---- .../snapshots/command_env_install_global_local.md | 4 ++-- .../command_env_install_global_local_no_version.md | 2 +- .../snapshots/command_env_install_node_version.md | 8 ++++---- .../command_env_install_parallel/snapshots.toml | 2 +- .../snapshots/command_env_install_parallel.md | 10 +++++----- .../snapshots/command_env_install_version_alias.md | 8 ++++---- .../command_env_which/snapshots/command_env_which.md | 4 ++-- .../snapshots/command_outdated_global.md | 2 +- .../snapshots/command_update_global_dev_engines.md | 2 +- .../snapshots/command_update_node_mismatch.md | 4 ++-- .../snapshots/env_install_binary_conflict.md | 8 ++++---- .../snapshots/env_install_interrupt.md | 4 ++-- .../snapshots/env_install_mixed_case_bin.md | 2 +- .../snapshots/env_install_stale_bin.md | 4 ++-- .../snapshots/global_install_dynamic_import.md | 2 +- .../snapshots/npm_global_install_already_linked.md | 4 ++-- .../snapshots/npm_global_uninstall_vp_managed.md | 4 ++-- .../snapshots/npm_global_update_notifier.md | 2 +- .../snapshots/shim_recursive_package_binary.md | 4 ++-- crates/vp_global_cli/src/commands/global/install.rs | 7 ++++--- 22 files changed, 49 insertions(+), 48 deletions(-) diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_global_install_multiple_fail/snapshots/command_env_global_install_multiple_fail.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_global_install_multiple_fail/snapshots/command_env_global_install_multiple_fail.md index 57e389027e..4f97427e0f 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_global_install_multiple_fail/snapshots/command_env_global_install_multiple_fail.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_global_install_multiple_fail/snapshots/command_env_global_install_multiple_fail.md @@ -16,7 +16,7 @@ npm error 404 npm error 404 Note that you can also install from a npm error 404 tarball, folder, http url, or git url. npm error A complete log of this run can be found in: /.npm/_logs/-debug-0.log -✓ Installed install-fail-local-package 0.0.0 + Installed install-fail-local-package 0.0.0 Bins: install-fail-local-package error: Failed to install voidzero-nonexistent-pkg-xyz-23456: npm install failed with exit status: 1 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md index 1562dc129e..452a6324c4 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_conflict/snapshots/command_env_install_conflict.md @@ -9,7 +9,7 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js warn: Package 'conflict-pkg' provides 'node' binary, but it conflicts with a built-in shim. Skipping. -✓ Installed conflict-pkg 1.0.0 + Installed conflict-pkg 1.0.0 Bins: conflict-cli ``` @@ -18,7 +18,7 @@ warn: Package 'conflict-pkg' provides 'node' binary, but it conflicts with a bui Cleanup ``` -✓ Uninstalled conflict-pkg +- Uninstalled conflict-pkg ``` ## `vp install -g --node 20 ./conflict-pkg` @@ -30,7 +30,7 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js warn: Package 'conflict-pkg' provides 'node' binary, but it conflicts with a built-in shim. Skipping. -✓ Installed conflict-pkg 1.0.0 + Installed conflict-pkg 1.0.0 Bins: conflict-cli ``` @@ -39,5 +39,5 @@ warn: Package 'conflict-pkg' provides 'node' binary, but it conflicts with a bui Cleanup ``` -✓ Uninstalled conflict-pkg +- Uninstalled conflict-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local/snapshots/command_env_install_global_local.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local/snapshots/command_env_install_global_local.md index 637538eeea..9713843aaa 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local/snapshots/command_env_install_global_local.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local/snapshots/command_env_install_global_local.md @@ -6,7 +6,7 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed just-a-normal-package 0.0.0 + Installed just-a-normal-package 0.0.0 Bins: just-a-normal-package ``` @@ -16,7 +16,7 @@ info: Installing 1 global package with Node.js VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed another-normal-package 0.0.1 + Installed another-normal-package 0.0.1 Bins: another-normal-package ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local_no_version/snapshots/command_env_install_global_local_no_version.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local_no_version/snapshots/command_env_install_global_local_no_version.md index f30da2dd60..9f5f7bf360 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local_no_version/snapshots/command_env_install_global_local_no_version.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_global_local_no_version/snapshots/command_env_install_global_local_no_version.md @@ -6,7 +6,7 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed global-local-no-version (no version) + Installed global-local-no-version (no version) Bins: global-local-no-version ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md index 0ea087beba..2ce3456ecf 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_node_version/snapshots/command_env_install_node_version.md @@ -8,7 +8,7 @@ Install with Node.js 22 VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed command-env-install-node-version-pkg 1.0.0 + Installed command-env-install-node-version-pkg 1.0.0 Bins: command-env-install-node-version-pkg-cli ``` @@ -25,7 +25,7 @@ Node major: 22 Cleanup ``` -✓ Uninstalled command-env-install-node-version-pkg +- Uninstalled command-env-install-node-version-pkg ``` ## `vp install -g --node 20 ./command-env-install-node-version-pkg` @@ -36,7 +36,7 @@ Install with Node.js 20 VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed command-env-install-node-version-pkg 1.0.0 + Installed command-env-install-node-version-pkg 1.0.0 Bins: command-env-install-node-version-pkg-cli ``` @@ -53,5 +53,5 @@ Node major: 20 Cleanup ``` -✓ Uninstalled command-env-install-node-version-pkg +- Uninstalled command-env-install-node-version-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml index 34e7516283..be85a49213 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots.toml @@ -5,5 +5,5 @@ steps = [ { argv = ["vp", "install", "-g", "--concurrency", "1", "./parallel-pkg-a", "./parallel-pkg-b"], comment = "Install multiple global packages", formatted-snapshot = true, continue-on-failure = true }, { argv = ["parallel-a"], comment = "Both binaries should be callable" }, { argv = ["parallel-b"], continue-on-failure = true }, - { argv = ["vp", "remove", "-g", "parallel-pkg-a", "parallel-pkg-b"], comment = "Removal uses the same success marker and package styling as installation", formatted-snapshot = true, continue-on-failure = true }, + { argv = ["vp", "remove", "-g", "parallel-pkg-a", "parallel-pkg-b"], comment = "Installation and removal use plus/minus markers and the same package styling", formatted-snapshot = true, continue-on-failure = true }, ] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md index 63724c726a..160d8771df 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_parallel/snapshots/command_env_install_parallel.md @@ -8,10 +8,10 @@ Install multiple global packages VITE+ - The Unified Toolchain for the Web \x1b[94;1minfo: Installing 2 global packages with Node.js -\x1b[32m\xe2\x9c\x93 Installed \x1b[1mparallel-pkg-a \x1b[1m1.0.0 +\x1b[32m+ Installed \x1b[1mparallel-pkg-a \x1b[1m1.0.0 Bins: \x1b[1mparallel-a -\x1b[32m\xe2\x9c\x93 Installed \x1b[1mparallel-pkg-b \x1b[1m2.0.0 +\x1b[32m+ Installed \x1b[1mparallel-pkg-b \x1b[1m2.0.0 Bins: \x1b[1mparallel-b ``` @@ -31,9 +31,9 @@ parallel-b ok ## `vp remove -g parallel-pkg-a parallel-pkg-b` -Removal uses the same success marker and package styling as installation +Installation and removal use plus/minus markers and the same package styling ``` -\x1b[32m\xe2\x9c\x93 Uninstalled \x1b[1mparallel-pkg-a -\x1b[32m\xe2\x9c\x93 Uninstalled \x1b[1mparallel-pkg-b +\x1b[31m- Uninstalled \x1b[1mparallel-pkg-a +\x1b[31m- Uninstalled \x1b[1mparallel-pkg-b ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md index 9b90dae6b8..1b2957747b 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_install_version_alias/snapshots/command_env_install_version_alias.md @@ -8,7 +8,7 @@ Install with LTS alias VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed command-env-install-version-alias-pkg 1.0.0 + Installed command-env-install-version-alias-pkg 1.0.0 Bins: command-env-install-version-alias-pkg-cli ``` @@ -25,7 +25,7 @@ LTS major >= 20: true Cleanup ``` -✓ Uninstalled command-env-install-version-alias-pkg +- Uninstalled command-env-install-version-alias-pkg ``` ## `vp install -g --node latest ./command-env-install-version-alias-pkg` @@ -36,7 +36,7 @@ Install with latest alias VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed command-env-install-version-alias-pkg 1.0.0 + Installed command-env-install-version-alias-pkg 1.0.0 Bins: command-env-install-version-alias-pkg-cli ``` @@ -53,5 +53,5 @@ Latest major >= 20: true Cleanup ``` -✓ Uninstalled command-env-install-version-alias-pkg +- Uninstalled command-env-install-version-alias-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md index 9b7db2c091..c52fb7b2b1 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_env_which/snapshots/command_env_which.md @@ -52,7 +52,7 @@ Install a global package via vp VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed cowsay 1.6.0 + Installed cowsay 1.6.0 Bins: cowsay, cowthink ``` @@ -75,7 +75,7 @@ VITE+ - The Unified Toolchain for the Web Cleanup ``` -✓ Uninstalled cowsay +- Uninstalled cowsay ``` ## `vp env which unknown-tool` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_global/snapshots/command_outdated_global.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_global/snapshots/command_outdated_global.md index 270af9d6ef..a08a93c9dd 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_global/snapshots/command_outdated_global.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_global/snapshots/command_outdated_global.md @@ -107,7 +107,7 @@ should override a recorded version spec with --latest ``` info: Updating 1 global package with Node.js -✓ Updated testnpm2 to 1.0.1 + Updated testnpm2 to 1.0.1 ``` ## `vpt grep-file $VP_HOME/packages/testnpm2.json versionSpec` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_global_dev_engines/snapshots/command_update_global_dev_engines.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_global_dev_engines/snapshots/command_update_global_dev_engines.md index b27df1c632..ed12756097 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_global_dev_engines/snapshots/command_update_global_dev_engines.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_global_dev_engines/snapshots/command_update_global_dev_engines.md @@ -9,5 +9,5 @@ Global updates ignore the current project's package-manager requirement. ``` info: Updating 1 global package with Node.js -✓ Updated testnpm2 to 1.0.1 + Updated testnpm2 to 1.0.1 ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_node_mismatch/snapshots/command_update_node_mismatch.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_node_mismatch/snapshots/command_update_node_mismatch.md index ad46cefef5..5a16eb8d05 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_node_mismatch/snapshots/command_update_node_mismatch.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_node_mismatch/snapshots/command_update_node_mismatch.md @@ -4,7 +4,7 @@ ``` info: Installing 1 global package with Node.js -✓ Installed testnpm2 1.0.1 + Installed testnpm2 1.0.1 ``` ## `vp update -g testnpm2` @@ -28,5 +28,5 @@ All global packages are up to date. ``` info: Updating 1 global package with Node.js -✓ Updated testnpm2 to 1.0.1 + Updated testnpm2 to 1.0.1 ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md index 7e9161fdcb..bf5f243766 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md @@ -8,7 +8,7 @@ Install pkg-a which provides env-binary-conflict-cli binary VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed env-binary-conflict-pkg-a 1.0.0 + Installed env-binary-conflict-pkg-a 1.0.0 Bins: env-binary-conflict-cli ``` @@ -64,8 +64,8 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js Uninstalling env-binary-conflict-pkg-a (conflicts with env-binary-conflict-pkg-b)... -✓ Uninstalled env-binary-conflict-pkg-a -✓ Installed env-binary-conflict-pkg-b 2.0.0 +- Uninstalled env-binary-conflict-pkg-a + Installed env-binary-conflict-pkg-b 2.0.0 Bins: env-binary-conflict-cli ``` @@ -88,7 +88,7 @@ Bin config should now point to pkg-b Cleanup ``` -✓ Uninstalled env-binary-conflict-pkg-b +- Uninstalled env-binary-conflict-pkg-b ``` ## `vpt stat-file $VP_HOME/bins/env-binary-conflict-cli.json --assert missing` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_interrupt/snapshots/env_install_interrupt.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_interrupt/snapshots/env_install_interrupt.md index 550c62a6f0..560705fd73 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_interrupt/snapshots/env_install_interrupt.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_interrupt/snapshots/env_install_interrupt.md @@ -6,7 +6,7 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed @scope/long-time-install-package 0.0.0 + Installed @scope/long-time-install-package 0.0.0 Bins: long-time-install-package ``` @@ -45,7 +45,7 @@ Successful reinstall should clean stale packages VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed @scope/long-time-install-package 0.0.0 + Installed @scope/long-time-install-package 0.0.0 Bins: long-time-install-package ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_mixed_case_bin/snapshots/env_install_mixed_case_bin.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_mixed_case_bin/snapshots/env_install_mixed_case_bin.md index 4da14ffa69..dfe26200ab 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_mixed_case_bin/snapshots/env_install_mixed_case_bin.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_mixed_case_bin/snapshots/env_install_mixed_case_bin.md @@ -6,7 +6,7 @@ VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed env-install-mixed-case-bin 1.0.0 + Installed env-install-mixed-case-bin 1.0.0 Bins: MixedCaseBin ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_stale_bin/snapshots/env_install_stale_bin.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_stale_bin/snapshots/env_install_stale_bin.md index f6e2d96d08..26c1f132af 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_stale_bin/snapshots/env_install_stale_bin.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/env_install_stale_bin/snapshots/env_install_stale_bin.md @@ -8,7 +8,7 @@ Install package with two binaries VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed env-install-stale-bin-pkg 1.0.0 + Installed env-install-stale-bin-pkg 1.0.0 Bins: env-install-stale-drop, env-install-stale-keep ``` @@ -34,7 +34,7 @@ Reinstall package version that removed one binary VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed env-install-stale-bin-pkg 2.0.0 + Installed env-install-stale-bin-pkg 2.0.0 Bins: env-install-stale-keep ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/global_install_dynamic_import/snapshots/global_install_dynamic_import.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/global_install_dynamic_import/snapshots/global_install_dynamic_import.md index 2ba806fd5d..25c8cdf370 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/global_install_dynamic_import/snapshots/global_install_dynamic_import.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/global_install_dynamic_import/snapshots/global_install_dynamic_import.md @@ -8,7 +8,7 @@ Regression test for #2220: globally installed packages can dynamically import an VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed global-install-dynamic-import 0.0.0 + Installed global-install-dynamic-import 0.0.0 Bins: global-install-dynamic-import ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md index d7b3c07f71..cb691ac85f 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_install_already_linked/snapshots/npm_global_install_already_linked.md @@ -14,7 +14,7 @@ First install via vp (creates managed shim) VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed npm-global-linked-pkg 1.0.0 + Installed npm-global-linked-pkg 1.0.0 Bins: npm-global-linked-cli ``` @@ -41,7 +41,7 @@ Skipped 'npm-global-linked-cli': managed by `vp install -g npm-global-linked-pkg Cleanup ``` -✓ Uninstalled npm-global-linked-pkg +- Uninstalled npm-global-linked-pkg ``` ## `vpt stat-file $VP_HOME/bin/npm-global-linked-cli` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md index 003819b6a1..4e08bc8c30 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_global_uninstall_vp_managed/snapshots/npm_global_uninstall_vp_managed.md @@ -8,7 +8,7 @@ Install via vp (creates managed shim) VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed npm-global-vp-managed-pkg 1.0.0 + Installed npm-global-vp-managed-pkg 1.0.0 Bins: npm-global-vp-managed-cli ``` @@ -52,5 +52,5 @@ npm-global-vp-managed-cli works Cleanup ``` -✓ Uninstalled npm-global-vp-managed-pkg +- Uninstalled npm-global-vp-managed-pkg ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_update_notifier/snapshots/npm_global_update_notifier.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_update_notifier/snapshots/npm_global_update_notifier.md index 8ab0abf4bc..b933a3ce15 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_update_notifier/snapshots/npm_global_update_notifier.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_update_notifier/snapshots/npm_global_update_notifier.md @@ -8,5 +8,5 @@ Global installs disable npm update notifications in the child process. VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed global-update-notifier-test 1.0.0 + Installed global-update-notifier-test 1.0.0 ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md index 6d58edd226..07652f27f3 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/shim_recursive_package_binary/snapshots/shim_recursive_package_binary.md @@ -8,7 +8,7 @@ Install test package VITE+ - The Unified Toolchain for the Web info: Installing 1 global package with Node.js -✓ Installed recursive-cli-pkg 1.0.0 + Installed recursive-cli-pkg 1.0.0 Bins: recursive-cli ``` @@ -26,5 +26,5 @@ inner call succeeded Cleanup ``` -✓ Uninstalled recursive-cli-pkg +- Uninstalled recursive-cli-pkg ``` diff --git a/crates/vp_global_cli/src/commands/global/install.rs b/crates/vp_global_cli/src/commands/global/install.rs index ae55fa7fc5..de1cc3c60c 100644 --- a/crates/vp_global_cli/src/commands/global/install.rs +++ b/crates/vp_global_cli/src/commands/global/install.rs @@ -522,8 +522,9 @@ pub async fn install( drop(lock_file); // 5.7 Print success message - output::success(&format!( - "{} {} {}{}", + output::raw(&format!( + "{} {} {} {}{}", + style("+").green(), operation_past, style(&package_name).bold(), if update { "to " } else { "" }, @@ -1044,7 +1045,7 @@ pub async fn uninstall(package_name: &str, dry_run: bool) -> Result<(), Error> { // Remove metadata file PackageMetadata::delete(&package_name).await?; - output::success(&format!("Uninstalled {}", style(&package_name).bold())); + output::raw(&format!("{} Uninstalled {}", style("-").red(), style(&package_name).bold())); Ok(()) }