diff --git a/Cargo.lock b/Cargo.lock index 0085033cda1..d200739c103 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2578,17 +2578,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -2906,7 +2895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -3132,12 +3121,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "md5" version = "0.7.0" @@ -4220,9 +4203,9 @@ checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" [[package]] name = "reqwest" -version = "0.12.8" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "async-compression", "base64", @@ -5307,20 +5290,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tldextract" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec03259a0567ad58eed30812bc3e5eda8030f154abc70317ab57b14f00699ca4" -dependencies = [ - "idna 0.2.3", - "log", - "regex", - "serde_json", - "thiserror", - "url", -] - [[package]] name = "tokio" version = "1.41.0" @@ -5791,12 +5760,6 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" version = "1.0.13" @@ -5972,9 +5935,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ "base64", "flate2", @@ -5993,7 +5956,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", + "idna", "percent-encoding", "serde", ] @@ -6716,7 +6679,6 @@ dependencies = [ "thiserror", "time 0.1.45", "time 0.3.36", - "tldextract", "tokio", "tokio-tungstenite 0.21.0", "toml 0.5.11", @@ -7504,7 +7466,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index 8efad9a50c1..1e51d64c686 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -174,7 +174,6 @@ url = "2.3.1" libc.workspace = true parking_lot = "0.12" dialoguer = "0.11.0" -tldextract = "0.6.0" hex = "0.4.3" flate2 = "1.0.25" cargo_metadata = "0.15.2" diff --git a/lib/cli/src/commands/auth/login/mod.rs b/lib/cli/src/commands/auth/login/mod.rs index 6d1b93137ba..50742a9742b 100644 --- a/lib/cli/src/commands/auth/login/mod.rs +++ b/lib/cli/src/commands/auth/login/mod.rs @@ -55,25 +55,15 @@ impl Login { return Ok(AuthorizationState::TokenSuccess(token.clone())); } - let registry_host = env.registry_endpoint()?; - let registry_tld = tldextract::TldExtractor::new(tldextract::TldOption::default()) - .extract(registry_host.as_str()) - .map_err(|e| { - std::io::Error::new( - std::io::ErrorKind::Other, - format!("Invalid registry for login {}: {e}", registry_host), - ) - })?; - - let login_prompt = match ( - registry_tld.domain.as_deref(), - registry_tld.suffix.as_deref(), - ) { - (Some(d), Some(s)) => { - format!("Please paste the login token from https://{d}.{s}/settings/access-tokens") + let public_url = env.registry_public_url()?; + + let login_prompt = match public_url.domain() { + Some(d) => { + format!("Please paste the login token from https://{d}/settings/access-tokens") } _ => "Please paste the login token".to_string(), }; + #[cfg(test)] { Ok(AuthorizationState::TokenSuccess(login_prompt)) diff --git a/lib/cli/src/commands/package/tag.rs b/lib/cli/src/commands/package/tag.rs index d0a5babf52e..07e36ca467e 100644 --- a/lib/cli/src/commands/package/tag.rs +++ b/lib/cli/src/commands/package/tag.rs @@ -200,6 +200,18 @@ impl PackageTag { None }; + let maybe_readme_content = match maybe_readme { + Some(readme) => { + let readme_path = self.package_path.join(&readme); + if readme_path.exists() { + Some(tokio::fs::read_to_string(readme_path).await?) + } else { + None + } + } + None => None, + }; + let r = wasmer_backend_api::query::tag_package_release( client, maybe_description.as_deref(), @@ -211,7 +223,7 @@ impl PackageTag { None, package_release_id, private, - maybe_readme.as_deref(), + maybe_readme_content.as_deref(), maybe_repository.as_deref(), &version, );