diff options
author | Vika <vika@fireburn.ru> | 2025-01-01 05:32:37 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2025-01-01 06:53:53 +0300 |
commit | df509eadc9aecef605194b7c97c5fb02bf928b79 (patch) | |
tree | 46c027e024db98e43585033bce505e60161be27d | |
parent | 01c4c798aeb6fe9e12af14c2a96f5e5279f49cdd (diff) | |
download | kittybox-df509eadc9aecef605194b7c97c5fb02bf928b79.tar.zst |
Use workspace dependencies to simplify dependency management
This will reduce risks of dependency duplication in the tree when updating or adding new dependencies, as one could simply inherit from the workspace. `cargo-autoinherit` was considered, but it migrates EVERY single dependency, whereas I'd prefer that only reused dependencies are migrated. Additionally, it doesn't merge features automatically, requiring manual intervention anyway. Change-Id: If0dd19012c723ab71f599119d108e805b2d5e463
-rw-r--r-- | Cargo.toml | 186 | ||||
-rw-r--r-- | indieauth/Cargo.toml | 31 | ||||
-rw-r--r-- | templates-neo/Cargo.toml | 39 | ||||
-rw-r--r-- | templates/Cargo.toml | 32 | ||||
-rw-r--r-- | tower-watchdog/Cargo.toml | 18 | ||||
-rw-r--r-- | util/Cargo.toml | 35 |
6 files changed, 151 insertions, 190 deletions
diff --git a/Cargo.toml b/Cargo.toml index 682e81f..18081ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,49 @@ required-features = ["sqlparser"] [workspace] members = [".", "./util", "./templates", "./indieauth", "./templates-neo", "./tower-watchdog"] default-members = [".", "./util", "./templates", "./indieauth"] + +[workspace.dependencies] +axum = "0.7.9" +axum-core = "0.4.5" +chrono = { version = "0.4.39", features = ["serde"] } +clap = "4.5.23" +data-encoding = "2.6.0" +ellipse = "0.2.0" +faker_rand = "0.1.1" +futures = "0.3.31" +futures-util = "0.3.31" +html = "0.6.3" +http = "1.2" +include_dir = "0.7.4" +libflate = "2.1.0" +markup = "0.15.0" +microformats = "0.14.0" +rand = "0.8.5" +serde = { version = "1.0.217", features = ["derive"] } +serde_json = "1.0.134" +serde_urlencoded = "0.7.1" +serde_variant = "0.1.3" +sha2 = "0.10.8" +sqlx = { version = "0.8.1", features = ["json"] } +thiserror = "2.0.9" +time = "0.3.37" +tokio = "1.42.0" +tokio-stream = "0.1.17" +tokio-util = "0.7.13" +tower = "0.5.2" +tower-http = "0.6.2" +tower-layer = "0.3.3" +tower-service = "0.3.3" +tower-test = "0.4.0" +tracing = "0.1.41" +tracing-log = "0.2.0" +tracing-subscriber = "0.3.19" +tracing-test = "0.2.5" +tracing-tree = "0.4.0" +url = { version = "2.5.4", features = ["serde"] } +uuid = "1.11.0" +walkdir = "2.5.0" + [dependencies.kittybox-util] version = "0.3.0" path = "./util" @@ -69,102 +112,59 @@ features = ["axum"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dev-dependencies] -tempfile = "^3.14.0" # Temporary file managment -wiremock = "^0.6.2" -faker_rand = "^0.1.1" # Seedable, rand-compatible generators of fake data -rand = "^0.8.5" # Utilities for random number generation -tracing-test = "^0.2.5" +faker_rand = { workspace = true } +rand = { workspace = true } +tempfile = "3.14.0" +tracing-test = { workspace = true } +wiremock = "0.6.2" [dependencies] -argon2 = { version = "^0.5.3", features = ["std"] } -async-trait = "^0.1.83" # Type erasure for async trait methods -bytes = "^1.9.0" -data-encoding = "^2.6.0" # Efficient and customizable data-encoding functions like base64, base32, and hex -either = "^1.13.0" # A general purpose sum type with two cases -futures = "^0.3.31" # An implementation of futures and streams -futures-util = "^0.3.31" # Common utilities and extension traits for the futures-rs library -hex = "^0.4.3" -lazy_static = "^1.5.0" # A macro for declaring lazily evaluated statics in Rust -listenfd = "^1.0.1" # A simple library to work with listenfds passed from the outside (systemd/catflap socket activation) -markdown = "^1.0.0-alpha.21" # Native Rust library for parsing Markdown and (outputting HTML) -newbase60 = "^0.1.4" # A library that implements Tantek Çelik's New Base 60 -rand = "^0.8.5" # Random number generators. -serde_json = "^1.0.134" # A JSON serialization file format -serde_urlencoded = "^0.7.1" # `x-www-form-urlencoded` meets Serde -serde_variant = "^0.1.3" # Retrieve serde provided variant names for enum objects -relative-path = "^1.9.3" # Portable relative paths for Rust -sha2 = "^0.10.8" # SHA-2 series of algorithms for Rust -uuid = { version = "^1.11.0", features = [ "v4" ] } -tracing = { version = "0.1.41", features = [] } -tracing-tree = "0.4.0" -tracing-log = "0.2.0" -tracing-subscriber = { version = "0.3.19", features = ["env-filter", "json"] } -tower-http = { version = "0.6.2", features = ["trace", "cors", "catch-panic", "sensitive-headers"] } -tower = { version = "0.5.2", features = ["tracing"] } -webauthn = { version = "0.5.0", package = "webauthn-rs", features = ["danger-allow-state-serialisation"], optional = true } +anyhow = { version = "1.0.95", optional = true } +argon2 = { version = "0.5.3", features = ["std"] } +async-trait = "0.1.83" +axum = { workspace = true, features = ["multipart", "json", "form", "macros"] } +axum-extra = { version = "0.9.6", features = ["cookie", "cookie-signed", "typed-header"] } base64 = "0.22.1" +bytes = "1.9.0" +chrono = { workspace = true } +clap = { workspace = true, features = ["derive"], optional = true } +data-encoding = { workspace = true } +either = "1.13.0" +futures = { workspace = true } +futures-util = { workspace = true } +hex = "0.4.3" html5ever = "=0.27.0" -mime = "0.3.17" http-cache-reqwest = { version = "0.15.0", default-features = false, features = ["manager-moka"] } +hyper = "1.5.2" +lazy_static = "1.5.0" +listenfd = "1.0.1" +markdown = "1.0.0-alpha.21" +microformats = { workspace = true } +mime = "0.3.17" +newbase60 = "0.1.4" +prometheus = { version = "0.13.4", features = ["process"] } +rand = { workspace = true } +redis = { version = "0.27.6", features = ["aio", "tokio-comp"], optional = true } +relative-path = "1.9.3" +reqwest = { version = "0.12.11", default-features = false, features = ["gzip", "brotli", "json", "stream"] } reqwest-middleware = "0.4.0" -[dependencies.tokio] -version = "^1.42.0" -features = ["full", "tracing"] # TODO determine if my app doesn't need some features -#[dependencies.console-subscriber] -#version = "0.1.10" -[dependencies.tokio-stream] -version = "^0.1.17" -features = ["time", "net"] -[dependencies.tokio-util] -version = "^0.7.13" -features = ["io-util"] -[dependencies.anyhow] -version = "^1.0.95" -optional = true -[dependencies.axum] -version = "^0.7.9" -features = ["multipart", "json", "form", "macros"] -[dependencies.axum-extra] -version = "^0.9.6" -features = ["cookie", "cookie-signed", "typed-header"] -[dependencies.chrono] # Date and time library for Rust -version = "^0.4.39" -features = ["serde"] -[dependencies.redis] -version = "^0.27.6" -optional = true -features = ["aio", "tokio-comp"] -[dependencies.prometheus] # Prometheus instrumentation library for Rust applications -version = "^0.13.4" -features = ["process"] -[dependencies.serde] # A generic serialization/deserialization framework -version = "^1.0.217" -features = ["derive"] -[dependencies.url] # URL library for Rust, based on the WHATWG URL Standard -version = "^2.5.4" -features = ["serde"] -[dependencies.hyper] -version = "^1.5.2" -features = [] -[dependencies.reqwest] -version = "^0.12.11" -default-features = false -features = ["gzip", "brotli", "json", "stream"] -[dependencies.microformats] -version = "0.14.0" -#git = "https://gitlab.com/maxburon/microformats-parser" - -[dependencies.clap] -version = "4.5.23" -features = ["derive"] -optional = true -[dependencies.thiserror] -version = "2.0.9" -[dependencies.sqlx] -version = "^0.8.1" -features = ["uuid", "chrono", "json", "postgres", "runtime-tokio"] -optional = true -[dependencies.sqlparser] -version = "0.53.0" -features = ["serde", "serde_json"] -optional = true +serde = { workspace = true } +serde_json = { workspace = true } +serde_urlencoded = { workspace = true } +serde_variant = { workspace = true } +sha2 = { workspace = true } +sqlparser = { version = "0.53.0", features = ["serde", "serde_json"], optional = true } +sqlx = { workspace = true, features = ["uuid", "chrono", "postgres", "runtime-tokio"], optional = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full", "tracing"] } +tokio-stream = { workspace = true, features = ["time", "net"] } +tokio-util = { workspace = true, features = ["io-util"] } +tower = { workspace = true, features = ["tracing"] } +tower-http = { workspace = true, features = ["trace", "cors", "catch-panic", "sensitive-headers"] } +tracing = { workspace = true, features = [] } +tracing-log = { workspace = true } +tracing-subscriber = { workspace = true, features = ["env-filter", "json"] } +tracing-tree = { workspace = true } +url = { workspace = true } +uuid = { workspace = true, features = ["v4"] } +webauthn = { version = "0.5.0", package = "webauthn-rs", features = ["danger-allow-state-serialisation"], optional = true } diff --git a/indieauth/Cargo.toml b/indieauth/Cargo.toml index 7f18dfa..3bc3864 100644 --- a/indieauth/Cargo.toml +++ b/indieauth/Cargo.toml @@ -8,24 +8,15 @@ default = [] axum = ["dep:axum-core", "dep:serde_json", "dep:http"] [dev-dependencies] -serde_json = "^1.0.134" # A JSON serialization file format -serde_urlencoded = "^0.7.1" # `x-www-form-urlencoded` meets Serde +serde_json = { workspace = true } # A JSON serialization file format +serde_urlencoded = { workspace = true } # `x-www-form-urlencoded` meets Serde + [dependencies] -rand = "^0.8.5" # Utilities for random number generation -data-encoding = "^2.6.0" # Efficient and customizable data-encoding functions like base64, base32, and hex -sha2 = "^0.10.8" # SHA-2 series of algorithms for Rust -[dependencies.url] # URL library for Rust, based on the WHATWG URL Standard -version = "^2.5.4" -features = ["serde"] -[dependencies.serde] # A generic serialization/deserialization framework -version = "^1.0.217" -features = ["derive"] -[dependencies.axum-core] -version = "^0.4.5" -optional = true -[dependencies.serde_json] -version = "^1.0.134" -optional = true -[dependencies.http] -version = "^1.2" -optional = true +axum-core = { workspace = true, optional = true } +data-encoding = { workspace = true } +http = { workspace = true, optional = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true, optional = true } +sha2 = { workspace = true } +url = { workspace = true } diff --git a/templates-neo/Cargo.toml b/templates-neo/Cargo.toml index a6c3b8a..0be4dd2 100644 --- a/templates-neo/Cargo.toml +++ b/templates-neo/Cargo.toml @@ -6,36 +6,29 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [build-dependencies] -libflate = "^2.1.0" -walkdir = "^2.5.0" +libflate = { workspace = true } +walkdir = { workspace = true } [dev-dependencies] -faker_rand = "^0.1.1" -rand = "^0.8.5" +faker_rand = { workspace = true } +rand = { workspace = true } [dependencies] -ellipse = "^0.2.0" -http = "^1.2" -html = "^0.6.3" -serde_json = "^1.0.134" -include_dir = "^0.7.4" -axum = "^0.7.9" -thiserror = "2.0.9" -[dependencies.url] -# URL library for Rust, based on the WHATWG URL Standard -version = "^2.5.4" -features = ["serde"] -[dependencies.time] -version = "^0.3.37" -features = ["formatting"] -[dependencies.chrono] -version = "^0.4.39" -features = ["serde"] +axum = { workspace = true } +chrono = { workspace = true } +ellipse = { workspace = true } +html = { workspace = true } +http = { workspace = true } +include_dir = { workspace = true } +microformats = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } +time = { workspace = true, features = ["formatting"] } +url = { workspace = true } + [dependencies.kittybox-util] version = "0.3.0" path = "../util" [dependencies.kittybox-indieauth] version = "0.2.0" path = "../indieauth" -[dependencies.microformats] -version="0.14.0" diff --git a/templates/Cargo.toml b/templates/Cargo.toml index b85a254..19855e6 100644 --- a/templates/Cargo.toml +++ b/templates/Cargo.toml @@ -6,28 +6,24 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [build-dependencies] -libflate = "^2.1.0" -walkdir = "^2.5.0" +libflate = { workspace = true } +walkdir = { workspace = true } [dev-dependencies] -faker_rand = "^0.1.1" -rand = "^0.8.5" -[dev-dependencies.time] -version = "^0.3.37" -features = ["parsing", "formatting"] -[dev-dependencies.microformats] -version="0.14.0" +faker_rand = { workspace = true } +rand = { workspace = true } +time = { workspace = true, features = ["parsing", "formatting"] } +microformats = { workspace = true } [dependencies] -ellipse = "^0.2.0" -http = "^1.2" -markup = "^0.15.0" -serde_json = "^1.0.134" -include_dir = "^0.7.4" -axum = "^0.7.9" -[dependencies.chrono] -version = "^0.4.39" -features = ["serde"] +axum = { workspace = true } +chrono = { workspace = true } +ellipse = { workspace = true } +http = { workspace = true } +include_dir = { workspace = true } +markup = { workspace = true } +serde_json = { workspace = true } + [dependencies.kittybox-util] version = "0.3.0" path = "../util" diff --git a/tower-watchdog/Cargo.toml b/tower-watchdog/Cargo.toml index 45bebc1..a599714 100644 --- a/tower-watchdog/Cargo.toml +++ b/tower-watchdog/Cargo.toml @@ -4,15 +4,11 @@ version = "1.0.0" edition = "2021" [dev-dependencies] -tower-test = "0.4.0" -tokio = { version = "1.42.0", features = [ "macros", "rt" ] } +tokio = { workspace = true, features = ["macros", "rt"] } +tower-test = { workspace = true } + [dependencies] -[dependencies.tokio] -version = "^1.42.0" -features = ["time", "sync"] -[dependencies.tower-layer] -version = "0.3.3" -[dependencies.tower-service] -version = "0.3.3" -[dependencies.futures] -version = "0.3.31" +futures = { workspace = true } +tokio = { workspace = true, features = ["time", "sync"] } +tower-layer = { workspace = true } +tower-service = { workspace = true } diff --git a/util/Cargo.toml b/util/Cargo.toml index 53e94eb..fad0748 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -13,28 +13,13 @@ axum = ["dep:axum-core", "http"] http = ["dep:http"] [dependencies] -serde = { version = "^1.0.217", features = ["derive"] } -serde_json = "^1.0.134" -futures-util = "^0.3.31" -uuid = "^1.11.0" - -[dependencies.url] -version = "2.5.4" -features = ["serde"] -[dependencies.rand] -version = "^0.8.5" -optional = true -[dependencies.tokio] -version = "^1.42.0" -features = ["tracing"] -optional = true -[dependencies.sqlx] -version = "0.8.1" -features = ["json"] -optional = true -[dependencies.axum-core] -version = "^0.4.5" -optional = true -[dependencies.http] -version = "^1.2" -optional = true +axum-core = { workspace = true, optional = true } +futures-util = { workspace = true } +http = { workspace = true, optional = true } +rand = { workspace = true, optional = true } +serde = { workspace = true } +serde_json = { workspace = true } +sqlx = { workspace = true, optional = true } +tokio = { workspace = true, features = ["tracing"], optional = true } +url = { workspace = true } +uuid = { workspace = true } |