Skip to content

Commit ece718e

Browse files
authored
perf: upgrade to deno_semver 0.7 (#27426)
1 parent c30f345 commit ece718e

30 files changed

+282
-147
lines changed

Cargo.lock

+71-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ deno_ast = { version = "=0.44.0", features = ["transpiling"] }
5151
deno_core = { version = "0.327.0" }
5252

5353
deno_bench_util = { version = "0.178.0", path = "./bench_util" }
54-
deno_config = { version = "=0.40.0", features = ["workspace", "sync"] }
55-
deno_lockfile = "=0.23.2"
54+
deno_config = { version = "=0.41.0", features = ["workspace", "sync"] }
55+
deno_lockfile = "=0.24.0"
5656
deno_media_type = { version = "0.2.0", features = ["module_specifier"] }
57-
deno_npm = "=0.26.0"
57+
deno_npm = "=0.27.0"
5858
deno_path_util = "=0.2.2"
5959
deno_permissions = { version = "0.43.0", path = "./runtime/permissions" }
6060
deno_runtime = { version = "0.192.0", path = "./runtime" }
61-
deno_semver = "=0.6.1"
61+
deno_semver = "=0.7.1"
6262
deno_terminal = "0.2.0"
6363
napi_sym = { version = "0.114.0", path = "./ext/napi/sym" }
6464
test_util = { package = "test_server", path = "./tests/util/server" }
@@ -108,7 +108,7 @@ boxed_error = "0.2.3"
108108
brotli = "6.0.0"
109109
bytes = "1.4.0"
110110
cache_control = "=0.2.0"
111-
capacity_builder = "0.1.3"
111+
capacity_builder = "0.5.0"
112112
cbc = { version = "=0.1.2", features = ["alloc"] }
113113
# Note: Do not use the "clock" feature of chrono, as it links us to CoreFoundation on macOS.
114114
# Instead use util::time::utc_now()
@@ -120,7 +120,7 @@ data-encoding = "2.3.3"
120120
data-url = "=0.3.1"
121121
deno_cache_dir = "=0.15.0"
122122
deno_error = "=0.5.2"
123-
deno_package_json = { version = "0.2.1", default-features = false }
123+
deno_package_json = { version = "0.3.0", default-features = false }
124124
deno_unsync = "0.4.2"
125125
dlopen2 = "0.6.1"
126126
ecb = "=0.1.2"

cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ deno_config.workspace = true
7474
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
7575
deno_doc = { version = "=0.161.3", features = ["rust", "comrak"] }
7676
deno_error.workspace = true
77-
deno_graph = { version = "=0.86.4" }
77+
deno_graph = { version = "=0.86.5" }
7878
deno_lint = { version = "=0.68.2", features = ["docs"] }
7979
deno_lockfile.workspace = true
8080
deno_npm.workspace = true

cli/args/mod.rs

+17-14
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot;
3131
use deno_npm::NpmSystemInfo;
3232
use deno_path_util::normalize_path;
3333
use deno_semver::npm::NpmPackageReqReference;
34+
use deno_semver::StackString;
3435
use deno_telemetry::OtelConfig;
3536
use deno_telemetry::OtelRuntimeConfig;
3637
use import_map::resolve_import_map_value_from_specifier;
@@ -992,24 +993,24 @@ impl CliOptions {
992993
// https://nodejs.org/api/process.html
993994
match target.as_str() {
994995
"aarch64-apple-darwin" => NpmSystemInfo {
995-
os: "darwin".to_string(),
996-
cpu: "arm64".to_string(),
996+
os: "darwin".into(),
997+
cpu: "arm64".into(),
997998
},
998999
"aarch64-unknown-linux-gnu" => NpmSystemInfo {
999-
os: "linux".to_string(),
1000-
cpu: "arm64".to_string(),
1000+
os: "linux".into(),
1001+
cpu: "arm64".into(),
10011002
},
10021003
"x86_64-apple-darwin" => NpmSystemInfo {
1003-
os: "darwin".to_string(),
1004-
cpu: "x64".to_string(),
1004+
os: "darwin".into(),
1005+
cpu: "x64".into(),
10051006
},
10061007
"x86_64-unknown-linux-gnu" => NpmSystemInfo {
1007-
os: "linux".to_string(),
1008-
cpu: "x64".to_string(),
1008+
os: "linux".into(),
1009+
cpu: "x64".into(),
10091010
},
10101011
"x86_64-pc-windows-msvc" => NpmSystemInfo {
1011-
os: "win32".to_string(),
1012-
cpu: "x64".to_string(),
1012+
os: "win32".into(),
1013+
cpu: "x64".into(),
10131014
},
10141015
value => {
10151016
log::warn!(
@@ -1946,15 +1947,17 @@ pub fn has_flag_env_var(name: &str) -> bool {
19461947
pub fn npm_pkg_req_ref_to_binary_command(
19471948
req_ref: &NpmPackageReqReference,
19481949
) -> String {
1949-
let binary_name = req_ref.sub_path().unwrap_or(req_ref.req().name.as_str());
1950-
binary_name.to_string()
1950+
req_ref
1951+
.sub_path()
1952+
.map(|s| s.to_string())
1953+
.unwrap_or_else(|| req_ref.req().name.to_string())
19511954
}
19521955

19531956
pub fn config_to_deno_graph_workspace_member(
19541957
config: &ConfigFile,
19551958
) -> Result<deno_graph::WorkspaceMember, AnyError> {
1956-
let name = match &config.json.name {
1957-
Some(name) => name.clone(),
1959+
let name: StackString = match &config.json.name {
1960+
Some(name) => name.as_str().into(),
19581961
None => bail!("Missing 'name' field in config file."),
19591962
};
19601963
let version = match &config.json.version {

0 commit comments

Comments
 (0)