From 5d6506af62e70c7a004620066789ada72e3f3040 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 14 Dec 2023 18:46:42 -0800 Subject: [PATCH] breaking: Remove deprecated commands. (#339) --- CHANGELOG.md | 4 +++ crates/cli/src/app.rs | 32 ------------------------ crates/cli/src/commands/add_plugin.rs | 14 ----------- crates/cli/src/commands/mod.rs | 8 ------ crates/cli/src/commands/plugins.rs | 14 ----------- crates/cli/src/commands/remove_plugin.rs | 14 ----------- crates/cli/src/commands/tools.rs | 14 ----------- crates/cli/src/main.rs | 4 --- 8 files changed, 4 insertions(+), 100 deletions(-) delete mode 100644 crates/cli/src/commands/add_plugin.rs delete mode 100644 crates/cli/src/commands/plugins.rs delete mode 100644 crates/cli/src/commands/remove_plugin.rs delete mode 100644 crates/cli/src/commands/tools.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 8741ebd52..81d1c8c5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ ## Unreleased +#### 💥 Breaking + +- Removed old and deprecated CLI commands. + #### 🚀 Updates - Implemented a new shim strategy for both Unix and Windows. diff --git a/crates/cli/src/app.rs b/crates/cli/src/app.rs index 0a54da55b..628feeabb 100644 --- a/crates/cli/src/app.rs +++ b/crates/cli/src/app.rs @@ -82,15 +82,6 @@ pub struct App { #[derive(Clone, Debug, Subcommand)] pub enum Commands { - #[command( - alias = "ap", - name = "add-plugin", - about = "Add a plugin.", - long_about = "Add a plugin to the local .prototools config, or global ~/.proto/.prototools config.", - hide = true - )] - AddPlugin(AddToolArgs), - #[command( alias = "a", name = "alias", @@ -184,22 +175,6 @@ pub enum Commands { )] Pin(PinArgs), - #[command( - name = "plugins", - about = "List all active and configured plugins.", - hide = true - )] - Plugins(ListToolPluginsArgs), - - #[command( - alias = "rp", - name = "remove-plugin", - about = "Remove a plugin.", - long_about = "Remove a plugin from the local .prototools config, or global ~/.proto/.prototools config.", - hide = true - )] - RemovePlugin(RemoveToolArgs), - #[command( alias = "r", name = "run", @@ -217,13 +192,6 @@ pub enum Commands { command: ToolCommands, }, - #[command( - name = "tools", - about = "List all installed tools and their versions.", - hide = true - )] - Tools(ListToolsArgs), - #[command(alias = "ua", name = "unalias", about = "Remove an alias from a tool.")] Unalias(UnaliasArgs), diff --git a/crates/cli/src/commands/add_plugin.rs b/crates/cli/src/commands/add_plugin.rs deleted file mode 100644 index 56b9eb673..000000000 --- a/crates/cli/src/commands/add_plugin.rs +++ /dev/null @@ -1,14 +0,0 @@ -use crate::commands::tool; -use starbase::system; -use starbase_styles::color; -use tracing::warn; - -#[system] -pub async fn add_plugin_old() { - warn!( - "This command is deprecated, use {} instead", - color::shell("proto tool add") - ); - - tool::add(states, resources, emitters).await?; -} diff --git a/crates/cli/src/commands/mod.rs b/crates/cli/src/commands/mod.rs index 7d95c7b4f..a18824376 100644 --- a/crates/cli/src/commands/mod.rs +++ b/crates/cli/src/commands/mod.rs @@ -1,4 +1,3 @@ -mod add_plugin; mod alias; mod bin; mod clean; @@ -13,18 +12,14 @@ mod list_remote; mod migrate; mod outdated; mod pin; -mod plugins; -mod remove_plugin; mod run; mod setup; pub mod tool; -mod tools; mod unalias; mod uninstall; mod uninstall_global; mod upgrade; -pub use add_plugin::*; pub use alias::*; pub use bin::*; pub use clean::*; @@ -38,11 +33,8 @@ pub use list_remote::*; pub use migrate::*; pub use outdated::*; pub use pin::*; -pub use plugins::*; -pub use remove_plugin::*; pub use run::*; pub use setup::*; -pub use tools::*; pub use unalias::*; pub use uninstall::*; pub use uninstall_global::*; diff --git a/crates/cli/src/commands/plugins.rs b/crates/cli/src/commands/plugins.rs deleted file mode 100644 index 53192d866..000000000 --- a/crates/cli/src/commands/plugins.rs +++ /dev/null @@ -1,14 +0,0 @@ -use crate::commands::tool; -use starbase::system; -use starbase_styles::color; -use tracing::warn; - -#[system] -pub async fn plugins() { - warn!( - "This command is deprecated, use {} instead", - color::shell("proto tool list-plugins") - ); - - tool::list_plugins(states, resources, emitters).await?; -} diff --git a/crates/cli/src/commands/remove_plugin.rs b/crates/cli/src/commands/remove_plugin.rs deleted file mode 100644 index 4423e18d4..000000000 --- a/crates/cli/src/commands/remove_plugin.rs +++ /dev/null @@ -1,14 +0,0 @@ -use crate::commands::tool; -use starbase::system; -use starbase_styles::color; -use tracing::warn; - -#[system] -pub async fn remove_plugin_old() { - warn!( - "This command is deprecated, use {} instead", - color::shell("proto tool remove") - ); - - tool::remove(states, resources, emitters).await?; -} diff --git a/crates/cli/src/commands/tools.rs b/crates/cli/src/commands/tools.rs deleted file mode 100644 index a4943aaf3..000000000 --- a/crates/cli/src/commands/tools.rs +++ /dev/null @@ -1,14 +0,0 @@ -use crate::commands::tool; -use starbase::system; -use starbase_styles::color; -use tracing::warn; - -#[system] -pub async fn tools() { - warn!( - "This command is deprecated, use {} instead", - color::shell("proto tool list") - ); - - tool::list(states, resources, emitters).await?; -} diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index a8c99f803..8a68e772d 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -53,7 +53,6 @@ async fn main() -> MainResult { app.analyze(systems::load_proto_configs); match cli.command { - Commands::AddPlugin(args) => app.execute_with_args(commands::add_plugin_old, args), Commands::Alias(args) => app.execute_with_args(commands::alias, args), Commands::Bin(args) => app.execute_with_args(commands::bin, args), Commands::Clean(args) => app.execute_with_args(commands::clean, args), @@ -69,8 +68,6 @@ async fn main() -> MainResult { Commands::Migrate(args) => app.execute_with_args(commands::migrate, args), Commands::Outdated(args) => app.execute_with_args(commands::outdated, args), Commands::Pin(args) => app.execute_with_args(commands::pin, args), - Commands::Plugins(args) => app.execute_with_args(commands::plugins, args), - Commands::RemovePlugin(args) => app.execute_with_args(commands::remove_plugin_old, args), Commands::Run(args) => app.execute_with_args(commands::run, args), Commands::Setup(args) => app.execute_with_args(commands::setup, args), Commands::Tool { command } => match command { @@ -82,7 +79,6 @@ async fn main() -> MainResult { } ToolCommands::Remove(args) => app.execute_with_args(commands::tool::remove, args), }, - Commands::Tools(args) => app.execute_with_args(commands::tools, args), Commands::Unalias(args) => app.execute_with_args(commands::unalias, args), Commands::Uninstall(args) => app.execute_with_args(commands::uninstall, args), Commands::UninstallGlobal(args) => app.execute_with_args(commands::uninstall_global, args),