Skip to content

Commit 1948f82

Browse files
Merge pull request #22 from joshrotenberg/fix/redisctl-docs
refactor: fold redis-common into redisctl and fix docs.rs
2 parents 7f56316 + 92beffd commit 1948f82

File tree

17 files changed

+424
-24
lines changed

17 files changed

+424
-24
lines changed

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
resolver = "2"
33
members = [
44
"crates/redis-cloud",
5-
"crates/redis-enterprise",
6-
"crates/redis-common",
5+
"crates/redis-enterprise",
76
"crates/redisctl",
87
]
98

@@ -59,7 +58,6 @@ pretty_assertions = "1.4"
5958
# Internal crates
6059
redis-cloud = { path = "crates/redis-cloud" }
6160
redis-enterprise = { path = "crates/redis-enterprise" }
62-
redis-common = { path = "crates/redis-common" }
6361

6462
[profile.release]
6563
opt-level = 3

crates/redis-common/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ description = "Shared utilities for Redis CLI tools"
1010
keywords = ["redis", "cli", "common", "utilities"]
1111
categories = ["command-line-utilities", "api-bindings"]
1212
readme = "../../README.md"
13+
publish = false
1314

1415
[dependencies]
1516
anyhow = { workspace = true }

crates/redisctl/Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ path = "src/enterprise_bin.rs"
2727
required-features = ["enterprise-only"]
2828

2929
[dependencies]
30-
redis-common = { version = "0.1.0", path = "../redis-common" }
3130
redis-cloud = { version = "0.1.0", path = "../redis-cloud" }
3231
redis-enterprise = { version = "0.1.0", path = "../redis-enterprise" }
3332

@@ -43,6 +42,15 @@ chrono = "0.4"
4342
rpassword = { workspace = true }
4443
urlencoding = "2.1"
4544

45+
# Dependencies from redis-common
46+
thiserror = { workspace = true }
47+
serde_yaml = { workspace = true }
48+
comfy-table = { workspace = true }
49+
jmespath = { workspace = true }
50+
config = { workspace = true }
51+
toml = { workspace = true }
52+
directories = { workspace = true }
53+
4654
# Conditional dependencies for feature-gated binaries
4755
[features]
4856
default = ["full"]

crates/redisctl/src/cli.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::commands::api::ApiCommands;
2+
use crate::config::DeploymentType;
3+
use crate::output::OutputFormat;
24
use clap::{Parser, Subcommand};
3-
use redis_common::{DeploymentType, OutputFormat};
45

56
#[derive(Parser)]
67
#[command(name = "redisctl")]

crates/redisctl/src/cloud_bin.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
// Redis Cloud only binary
22
// This binary only includes Cloud functionality to reduce size for Cloud-only deployments
33

4+
use crate::config::{Config, DeploymentType};
45
use anyhow::Result;
56
use clap::Parser;
6-
use redis_common::{Config, DeploymentType};
77
use tracing::info;
88

99
mod cli;
1010
mod commands;
11+
mod config;
12+
mod error;
13+
mod output;
1114

1215
use cli::{Cli, Commands};
1316
use commands::{cloud, profile};
@@ -53,7 +56,7 @@ async fn main() -> Result<()> {
5356
fn get_cloud_profile<'a>(
5457
config: &'a Config,
5558
profile_name: &Option<String>,
56-
) -> Result<&'a redis_common::Profile> {
59+
) -> Result<&'a crate::config::Profile> {
5760
let env_profile = std::env::var("REDISCTL_PROFILE").ok();
5861
let profile_name = profile_name
5962
.as_deref()

crates/redisctl/src/commands/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
33
#![allow(dead_code)]
44

5+
use crate::output::{OutputFormat, print_output};
56
use anyhow::{Context, Result};
67
use clap::Subcommand;
78
use redis_cloud::CloudClient;
8-
use redis_common::{OutputFormat, print_output};
99
use redis_enterprise::EnterpriseClient;
1010
use serde_json::Value;
1111
use std::fs;

crates/redisctl/src/commands/cloud.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use crate::config::{Profile, ProfileCredentials};
2+
use crate::output::{OutputFormat, print_output};
13
use anyhow::Result;
24
use redis_cloud::CloudClient;
3-
use redis_common::{OutputFormat, Profile, ProfileCredentials, print_output};
45

56
use crate::cli::{
67
AccountCommands, AclCommands, ApiKeyCommands, BackupCommands, CloudAccountCommands,

crates/redisctl/src/commands/cloud_billing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use crate::output::{OutputFormat, print_output};
12
use anyhow::Result;
23
use redis_cloud::{CloudBillingHandler, CloudClient};
3-
use redis_common::{OutputFormat, print_output};
44

55
use crate::cli::BillingCommands;
66

crates/redisctl/src/commands/enterprise.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
use crate::config::{Profile, ProfileCredentials};
2+
use crate::output::{OutputFormat, print_output};
13
use anyhow::Result;
2-
use redis_common::{OutputFormat, Profile, ProfileCredentials, print_output};
34
use redis_enterprise::EnterpriseClient;
45
use std::io::Write;
56

crates/redisctl/src/commands/profile.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
use crate::config::{Config, DeploymentType, Profile, ProfileCredentials};
2+
use crate::output::{OutputFormat, print_output};
13
use anyhow::Result;
2-
use redis_common::{
3-
Config, DeploymentType, OutputFormat, Profile, ProfileCredentials, print_output,
4-
};
54

65
use crate::cli::ProfileCommands;
76

0 commit comments

Comments
 (0)