Skip to content

Commit

Permalink
refactor: move shared dependencies to workspace dependencies (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
hougesen authored Dec 23, 2023
1 parent cbfb6f4 commit 4b4cdc4
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 30 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ documentation = "https://github.com/hougesen/hitt#readme"
keywords = ["http", "cli"]
description = "command line HTTP testing tool focused on speed and simplicity"
homepage = "https://github.com/hougesen/hitt"

[workspace.dependencies]
hitt-formatter = { path = "hitt-formatter", version = "*" }
hitt-parser = { path = "hitt-parser", version = "*" }
hitt-request = { path = "hitt-request", version = "*" }
http = { version = "0.2.9" }
reqwest = { version = "0.11.23" }
tokio = { version = "1.32.0", features = ["fs", "macros", "rt-multi-thread"] }
18 changes: 10 additions & 8 deletions hitt-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ path = "src/main.rs"

[dependencies]
clap = { version = "4.3.24", features = ["derive"] }
console = "0.15.7"
ignore = "0.4.20"
hitt-formatter = { path = "../hitt-formatter" }
hitt-parser = { path = "../hitt-parser" }
hitt-request = { path = "../hitt-request" }
shell-words = "1.1.0"
tempfile = "3.8.1"
tokio = { version = "1.32.0", features = ["fs", "macros", "rt-multi-thread"] }
console = { version = "0.15.7" }
hitt-formatter = { workspace = true }
hitt-parser = { workspace = true }
hitt-request = { workspace = true }
http = { workspace = true }
ignore = { version = "0.4.20" }
reqwest = { workspace = true }
shell-words = { version = "1.1.0" }
tempfile = { version = "3.8.1" }
tokio = { workspace = true }
2 changes: 1 addition & 1 deletion hitt-cli/src/commands/new.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::str::FromStr;

use console::{Key, Term};
use hitt_parser::http::{HeaderName, HeaderValue, Uri};
use http::{HeaderName, HeaderValue, Uri};

use crate::{
config::NewCommandArguments,
Expand Down
2 changes: 1 addition & 1 deletion hitt-cli/src/commands/run.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use hitt_request::{reqwest, send_request};
use hitt_request::send_request;

use crate::{
config::RunCommandArguments,
Expand Down
8 changes: 1 addition & 7 deletions hitt-cli/src/error/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use core::fmt;

use hitt_request::reqwest;

use crate::terminal::{TEXT_RED, TEXT_RESET};

#[derive(Debug)]
Expand All @@ -11,11 +9,7 @@ pub enum HittCliError {
Io(std::io::Error),
IoRead(std::path::PathBuf, std::io::Error),
IoWrite(std::path::PathBuf, std::io::Error),
Reqwest(
hitt_parser::http::Method,
hitt_parser::http::Uri,
reqwest::Error,
),
Reqwest(http::Method, http::Uri, reqwest::Error),
}

impl fmt::Display for HittCliError {
Expand Down
2 changes: 0 additions & 2 deletions hitt-cli/src/terminal/headers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use hitt_request::reqwest;

use crate::terminal::{TEXT_RED, TEXT_RESET, TEXT_YELLOW};

#[inline]
Expand Down
2 changes: 0 additions & 2 deletions hitt-cli/src/terminal/status.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use hitt_parser::http;

use crate::terminal::{STYLE_BOLD, STYLE_RESET, TEXT_GREEN, TEXT_RED, TEXT_RESET};

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion hitt-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ rust-version.workspace = true
homepage.workspace = true

[dependencies]
http = "0.2.9"
http = { workspace = true }
2 changes: 0 additions & 2 deletions hitt-parser/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use std::str::FromStr;

pub use http;

use crate::error::RequestParseError;

pub mod error;
Expand Down
7 changes: 4 additions & 3 deletions hitt-request/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rust-version.workspace = true
homepage.workspace = true

[dependencies]
hitt-parser = { path = "../hitt-parser" }
reqwest = "0.11.23"
tokio = { version = "1.32.0" }
hitt-parser = { workspace = true }
http = { workspace = true }
reqwest = { workspace = true }
tokio = { workspace = true }
4 changes: 1 addition & 3 deletions hitt-request/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use hitt_parser::{http, HittRequest};

pub use reqwest;
use hitt_parser::HittRequest;

pub struct HittResponse {
pub url: String,
Expand Down

0 comments on commit 4b4cdc4

Please sign in to comment.