Skip to content

Commit

Permalink
chore(deps): update rust crates (major) (#8739)
Browse files Browse the repository at this point in the history
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [oxc_resolver](https://redirect.github.com/oxc-project/oxc-resolver) |
workspace.dependencies | major | `3` -> `4` |
| [ureq](https://redirect.github.com/algesten/ureq) |
workspace.dependencies | major | `2.12.1` -> `3.0.0` |

---

### Release Notes

<details>
<summary>oxc-project/oxc-resolver (oxc_resolver)</summary>

###
[`v4.0.0`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#400---2025-01-20)

[Compare
Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v3.0.3...oxc_resolver-v4.0.0)

##### <!-- 0 -->Features

- \[**breaking**] generic fs cache `type Resolver =
ResolverGeneric<FsCache<FileSystemOs>>`
([#&#8203;358](https://redirect.github.com/oxc-project/oxc-resolver/issues/358))
- \[**breaking**] `PackageJson` and `TsConfig` traits
([#&#8203;360](https://redirect.github.com/oxc-project/oxc-resolver/issues/360))

##### <!-- 2 -->Performance

- use papaya instead of dashmap
([#&#8203;356](https://redirect.github.com/oxc-project/oxc-resolver/issues/356))

</details>

<details>
<summary>algesten/ureq (ureq)</summary>

###
[`v3.0.0`](https://redirect.github.com/algesten/ureq/blob/HEAD/CHANGELOG.md#300)

[Compare
Source](https://redirect.github.com/algesten/ureq/compare/2.12.1...3.0.0)

- Replace RequestBuilder Deref with explicit wrappers
([#&#8203;944](https://redirect.github.com/algesten/ureq/issues/944))
- Remove dependency on `url` crate
([#&#8203;943](https://redirect.github.com/algesten/ureq/issues/943))
- Feature `Config::save_redirect_history`
([#&#8203;939](https://redirect.github.com/algesten/ureq/issues/939))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on monday" in timezone Asia/Shanghai,
Automerge - "on monday" in timezone Asia/Shanghai.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Boshen <boshenc@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 27, 2025
1 parent 40362df commit e00e3ab
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 58 deletions.
148 changes: 130 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ unicode-id-start = "1"

#
dashmap = "6"
oxc-browserslist = "1.1.0"
oxc-browserslist = "1.1.2"
oxc_index = "2"
oxc_resolver = "3"
oxc_resolver = "4"
oxc_sourcemap = "1"

#
Expand Down Expand Up @@ -198,7 +198,7 @@ tokio = "1.42.0"
tower-lsp = "0.20.0"
tracing-subscriber = "0.3.19"
tsify = "0.4.5"
ureq = { version = "2.12.1", default-features = false }
ureq = { version = "3.0.0", default-features = false }
url = "2.5.4"
walkdir = "2.5.0"
wasm-bindgen = "0.2.99"
Expand Down
2 changes: 1 addition & 1 deletion tasks/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ console = { workspace = true }
project-root = { workspace = true }
similar = { workspace = true }

ureq = { workspace = true, features = ["json", "tls"] }
ureq = { workspace = true, features = ["json", "rustls"] }
url = { workspace = true }
40 changes: 19 additions & 21 deletions tasks/common/src/request.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
use std::time::Duration;

use ureq::{Agent, Proxy};

/// detect proxy from environment variable in following order:
/// ALL_PROXY | all_proxy | HTTPS_PROXY | https_proxy | HTTP_PROXY | http_proxy
fn detect_proxy() -> Option<ureq::Proxy> {
macro_rules! try_env {
($($env:literal),+) => {
$(
if let Ok(env) = std::env::var($env) {
if let Ok(proxy) = ureq::Proxy::new(env) {
return Some(proxy);
}
}
)+
};
}

try_env!("HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy");
fn detect_proxy() -> Option<Proxy> {
for env in ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"]
{
if let Ok(env) = std::env::var(env) {
if let Ok(proxy) = Proxy::new(&env) {
return Some(proxy);
}
}
}
None
}

/// build a agent with proxy automatically detected
pub fn agent() -> ureq::Agent {
let builder = ureq::AgentBuilder::new();
if let Some(proxy) = detect_proxy() {
builder.proxy(proxy).build()
} else {
builder.build()
}
pub fn agent() -> Agent {
let config = Agent::config_builder()
.proxy(detect_proxy())
.timeout_global(Some(Duration::from_secs(5)))
.build();
Agent::new_with_config(config)
}
4 changes: 2 additions & 2 deletions tasks/common/src/test_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ impl TestFile {
} else {
println!("[{filename}] - Downloading [{lib}] to [{}]", file.display());
match agent().get(lib).call() {
Ok(response) => {
let mut reader = response.into_reader();
Ok(mut response) => {
let mut reader = response.body_mut().as_reader();

let _drop = std::fs::remove_file(&file);
let mut writer = std::fs::File::create(&file).map_err(err_to_string)?;
Expand Down
8 changes: 2 additions & 6 deletions tasks/coverage/src/runtime/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::{
path::{Path, PathBuf},
time::Duration,
};
use std::path::{Path, PathBuf};

use serde_json::json;

Expand Down Expand Up @@ -274,10 +271,9 @@ async fn request_run_code(json: impl serde::Serialize + Send + 'static) -> Resul
tokio::spawn(async move {
agent()
.post("http://localhost:32055/run")
.timeout(Duration::from_secs(4))
.send_json(json)
.map_err(|err| err.to_string())
.and_then(|res| res.into_string().map_err(|err| err.to_string()))
.and_then(|mut res| res.body_mut().read_to_string().map_err(|err| err.to_string()))
})
.await
.map_err(|err| err.to_string())?
Expand Down
Loading

0 comments on commit e00e3ab

Please sign in to comment.