Skip to content

Commit

Permalink
fix: update dependencies and fix incompatible issues caused by deps
Browse files Browse the repository at this point in the history
  • Loading branch information
innobead committed Mar 26, 2023
1 parent c339ba3 commit 10fa35d
Show file tree
Hide file tree
Showing 185 changed files with 2,778 additions and 2,973 deletions.
970 changes: 402 additions & 568 deletions Cargo.lock

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,55 @@ strip = true
opt-level = "z"
lto = true
codegen-units = 1

[workspace.package]
version = "0.3.11"
description = "Huber package, simplify `GitHub release` package management with a live awesome list of GitHub project"
authors = ["David Ko <innobead@gmail.com>"]
edition = "2021"
rust-version = "1.68"
keywords = ["github", "package-management", "cli", "package"]
categories = ["command-line-interface", "command-line-utilities", "development-tools"]
homepage = "https://github.com/innobead/huber"
repository = "https://github.com/innobead/huber"
readme = "README.md"
license-file = "LICENSE"

[workspace.dependencies]
huber-common = { path = "crates/common" }
huber-procmacro = { path = "crates/procmacro" }
libcli-rs = "0.1.4"
clap = { version = "~3.1.6", features = ["env"] }
log = "0.4"
pretty_env_logger = "0.4"
lazy_static = "1.4.0"
anyhow = "1.0"
dirs = "5.0.0"
semver = "1.0.14"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9.19"
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1.23", features = ["full"] } # reqwest 0.10, hubcaps 0.6 does not support tokio 0.3/1.0 yet, ref: https://github.com/seanmonstar/reqwest/issues/1060
#hubcaps = { git = "https://github.com/softprops/hubcaps", rev = "324d02fbb371782c82e9a13b839b86894475c91f" } # wait for hubcaps formal release > 0.6
hubcaps-ex = "0.6.2"
compress-tools = "0.14.0"
derive_more = "=0.99.17" # remove = until https://github.com/OSSystems/compress-tools-rs/pull/58 merged
regex = "1.4.1"
futures = "0.3"
async-trait = "0.1.64"
git2 = "0.16.1"
chrono = "0.4"
symlink = "0.1.0"
is_executable = "1.0.1"
urlencoding = "2.1.2"
url = "2"
Inflector = "0.11.4"
fs_extra = "1.1"
maplit = "1.0"
rayon = "1.6"
fs2 = "0.4.3"
simpledi-rs = "0.1.0"
array_tool = "1.0.3"
indicatif = "0.17.3"
prettytable-rs = "0.10.0"
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.65 as build
FROM rust:1.68 as build
WORKDIR /workspace
ARG TARGETPLATFORM
ARG BUILDPLATFORM
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ clean: ## Clean build caches

.PHONY: fix
fix: ## Fix code
cargo fix --allow-dirty || cargo fix --allow-staged
cargo fix --allow-dirty --allow-staged

# Examples:
# FORCE_GENERATE=true|false make generate
.PHONY: generate
generate: ## Generate managed package list
@echo "! Must have GITHUB_TOKEN to automatically generate package description"
GITHUB_TOKEN=$(GITHUB_TOKEN) cargo build -vv --package=huber-generator
GITHUB_KEY=$(GITHUB_KEY) $(MAKE) build && \
(MANAGED_PKG_ROOT_DIR=$(CURDIR)/generated FORCE_GENERATE=$(FORCE_GENERATE) $(HUBER_BIN) search | xargs -0 $(CURDIR)/hack/generate-packages.md.sh)
# GITHUB_KEY=$(GITHUB_KEY) $(MAKE) build && \
# (MANAGED_PKG_ROOT_DIR=$(CURDIR)/generated FORCE_GENERATE=$(FORCE_GENERATE) $(HUBER_BIN) search | xargs -0 $(CURDIR)/hack/generate-packages.md.sh)

.PHONY: checksum
checksum: ## Generate checksum files for built executables
Expand Down
89 changes: 44 additions & 45 deletions crates/app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
[package]
name = "huber"
version = "0.3.10"
description = "Huber package, simplify `GitHub release` package management with a live awesome list of GitHub project"
authors = ["David Ko <innobead@gmail.com>"]
edition = "2021"
rust-version = "1.65"
keywords = ["github", "package-management", "cli", "package"]
categories = ["command-line-interface", "command-line-utilities", "development-tools"]
homepage = "https://github.com/innobead/huber"
repository = "https://github.com/innobead/huber"
version.workspace = true
description.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
keywords.workspace = true
categories.workspace = true
homepage.workspace = true
repository.workspace = true
readme = "../../README.md"
license-file = "../../LICENSE"

[build-dependencies]
chrono = "0.4"
chrono.workspace = true

[dependencies]
huber-common = { path = "../common", version = "0.3.10" }
huber-procmacro = { path = "../procmacro", version = "0.3.10" }
libcli-rs = "0.1"
clap = { version = "3.1.6", features = ["env"] }
log = "0.4"
pretty_env_logger = "0.4"
lazy_static = "1.4.0"
anyhow = "1.0"
dirs = "4.0.0"
semver = "1.0.14"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "~0.9.19"
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1.23", features = ["full"] } # reqwest 0.10, hubcaps 0.6 does not support tokio 0.3/1.0 yet, ref: https://github.com/seanmonstar/reqwest/issues/1060
#hubcaps = { git = "https://github.com/softprops/hubcaps", rev = "324d02fbb371782c82e9a13b839b86894475c91f" } # wait for hubcaps formal release > 0.6
hubcaps-ex = "0.6.2"
compress-tools = "0.14.0"
derive_more = "=0.99.17" # remove = until https://github.com/OSSystems/compress-tools-rs/pull/58 merged
regex = "1.4.1"
futures = "0.3"
async-trait = "0.1.64"
git2 = "0.16.1"
chrono = "0.4"
symlink = "0.1.0"
is_executable = "1.0.1"
urlencoding = "2.1.2"
url = "2"
Inflector = "0.11.4"
fs_extra = "1.1"
maplit = "1.0"
rayon = "1.6"
fs2 = "0.4.3"
simpledi-rs = "0.1.0"
array_tool = "1.0.3"
huber-common.workspace = true
huber-procmacro.workspace = true
libcli-rs.workspace = true
clap.workspace = true
log.workspace = true
pretty_env_logger.workspace = true
lazy_static.workspace = true
anyhow.workspace = true
dirs.workspace = true
semver.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
reqwest.workspace = true
tokio.workspace = true
hubcaps-ex.workspace = true
compress-tools.workspace = true
derive_more.workspace = true
regex.workspace = true
futures.workspace = true
async-trait.workspace = true
git2.workspace = true
chrono.workspace = true
symlink.workspace = true
is_executable.workspace = true
urlencoding.workspace = true
url.workspace = true
Inflector.workspace = true
fs_extra.workspace = true
maplit.workspace = true
rayon.workspace = true
fs2.workspace = true
simpledi-rs.workspace = true
array_tool.workspace = true
50 changes: 26 additions & 24 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
[package]
name = "huber-common"
version = "0.3.10"
authors = ["David Ko <innobead@gmail.com>"]
edition = "2021"
rust-version = "1.65"
version.workspace = true
description = "Internal package used by Huber"
homepage = "https://github.com/innobead/huber"
repository = "https://github.com/innobead/huber"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
keywords.workspace = true
categories.workspace = true
homepage.workspace = true
repository.workspace = true
readme = "../../README.md"
license-file = "../../LICENSE"

[dependencies]
log = "0.4"
pretty_env_logger = "0.4"
lazy_static = "1.4.0"
anyhow = "1.0"
dirs = "3.0.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
serde_yaml = "~0.9.19"
#hubcaps = { git = "https://github.com/softprops/hubcaps", rev = "324d02fbb371782c82e9a13b839b86894475c91f" } # wait for hubcaps formal release > 0.6
hubcaps-ex = "0.6.2"
prettytable-rs = "0.9"
Inflector = "0.11.4"
chrono = "0.4"
regex = "1.4"
maplit = "1.0"
semver = "0.11"
indicatif = "0.17"
libcli-rs = "0.1"
log.workspace = true
pretty_env_logger.workspace = true
lazy_static.workspace = true
anyhow.workspace = true
dirs.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
hubcaps-ex.workspace = true
prettytable-rs.workspace = true
Inflector.workspace = true
chrono.workspace = true
regex.workspace = true
maplit.workspace = true
semver.workspace = true
indicatif.workspace = true
libcli-rs.workspace = true
10 changes: 8 additions & 2 deletions crates/common/src/model/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ use crate::str::VersionCompareTrait;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Package {
pub name: String,

#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,

pub version: Option<String>,
pub description: Option<String>,

#[serde(with = "serde_yaml::with::singleton_map")]
pub source: PackageSource,

#[serde(with = "serde_yaml::with::singleton_map_recursive")]
pub targets: Vec<PackageTargetType>,

#[serde(with = "serde_yaml::with::singleton_map")]
pub detail: Option<PackageDetailType>,

// display purpose, injected from release
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(skip_deserializing)]
#[serde(with = "serde_yaml::with::singleton_map")]
pub release_kind: Option<ReleaseKind>,
}

Expand Down
5 changes: 4 additions & 1 deletion crates/common/src/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ pub trait VersionCompareTrait {

impl VersionCompareTrait for String {
fn cmp_version(&self, version: &str) -> Option<Ordering> {
Version::from_str(&self).partial_cmp(&Version::from_str(version))
let msg = format!("{} should be semantic version", version);
Version::from_str(&self)
.expect(&msg)
.partial_cmp(&Version::from_str(version).expect(&msg))
}
}
31 changes: 19 additions & 12 deletions crates/generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
[package]
name = "huber-generator"
version = "0.3.10"
authors = ["David Ko <innobead@gmail.com>"]
edition = "2021"
rust-version = "1.65"
version.workspace = true
description = "Internal package used by Huber"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
keywords.workspace = true
categories.workspace = true
homepage.workspace = true
repository.workspace = true
readme = "../../README.md"
license-file = "../../LICENSE"
build = "src/build.rs"

[build-dependencies]
huber-common = { path = "../common" }
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "~0.9.19"
tokio = { version = "1.23", features = ["full"] } # reqwest 0.10, hubcaps 0.6 does not support tokio 0.3/1.0 yet, ref: https://github.com/seanmonstar/reqwest/issues/1060
hubcaps-ex = "0.6.2"
maplit = "1.0"
huber-common.workspace = true
serde.workspace = true
serde_yaml.workspace = true
tokio.workspace = true
hubcaps-ex.workspace = true
maplit.workspace = true

[dependencies]
huber-common = { path = "../common"}
maplit = "1.0"
huber-common.workspace = true
maplit.workspace = true
17 changes: 14 additions & 3 deletions crates/generator/src/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

#[macro_use]
extern crate maplit;

Expand All @@ -7,10 +9,10 @@ use std::process::Command;

use hubcaps_ex::{Credentials, Github};
use tokio::fs::{create_dir_all, remove_file, File};
use tokio::io::AsyncWriteExt;

use huber_common::model::package::{Package, PackageIndex, PackageSource};
use huber_common::result::Result;
use tokio::io::AsyncWriteExt;

use crate::pkg::*;

Expand All @@ -19,15 +21,24 @@ mod pkg;
#[tokio::main]
async fn main() -> Result<()> {
let pkg_dir = env::var("CARGO_MANIFEST_DIR").unwrap();

let generated_dir = &Path::new(&pkg_dir)
.parent()
.unwrap()
.parent()
.unwrap()
.join("generated")
.join("packages");

let force_generated: bool = env::var("FORCE_GENERATE")
.unwrap_or("false".to_string())
.unwrap_or_else(|_| {
if generated_dir.exists() {
"false"
} else {
"true"
}
.to_string()
})
.parse()
.unwrap();

Expand All @@ -41,7 +52,7 @@ async fn main() -> Result<()> {
.unwrap()
.join("index.yaml");

remove_file(&index_file).await?;
let _ = remove_file(&index_file).await;
let mut index_file = File::create(index_file).await?;
index_file
.write("# This is generated. Don't modify.\n".as_bytes())
Expand Down
Loading

0 comments on commit 10fa35d

Please sign in to comment.