Skip to content

Commit 3bad0e2

Browse files
Merge pull request #708 from denoland/main
Create a new pull request by comparing changes across two branches
2 parents 4757ddd + cff6e28 commit 3bad0e2

File tree

320 files changed

+8200
-2782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

320 files changed

+8200
-2782
lines changed

Cargo.lock

Lines changed: 376 additions & 173 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ repository = "https://github.com/denoland/deno"
4646

4747
[workspace.dependencies]
4848
deno_ast = { version = "=0.43.3", features = ["transpiling"] }
49-
deno_core = { version = "0.318.0" }
49+
deno_core = { version = "0.319.0" }
5050

5151
deno_bench_util = { version = "0.171.0", path = "./bench_util" }
52+
deno_config = { version = "=0.39.1", features = ["workspace", "sync"] }
5253
deno_lockfile = "=0.23.1"
5354
deno_media_type = { version = "0.2.0", features = ["module_specifier"] }
5455
deno_npm = "=0.25.4"
@@ -60,10 +61,10 @@ deno_terminal = "0.2.0"
6061
napi_sym = { version = "0.107.0", path = "./ext/napi/sym" }
6162
test_util = { package = "test_server", path = "./tests/util/server" }
6263

63-
denokv_proto = "0.8.1"
64-
denokv_remote = "0.8.1"
64+
denokv_proto = "0.8.4"
65+
denokv_remote = "0.8.4"
6566
# denokv_sqlite brings in bundled sqlite if we don't disable the default features
66-
denokv_sqlite = { default-features = false, version = "0.8.2" }
67+
denokv_sqlite = { default-features = false, version = "0.8.4" }
6768

6869
# exts
6970
deno_broadcast_channel = { version = "0.171.0", path = "./ext/broadcast_channel" }
@@ -99,6 +100,7 @@ async-trait = "0.1.73"
99100
base32 = "=0.5.1"
100101
base64 = "0.21.7"
101102
bencher = "0.1"
103+
boxed_error = "0.2.2"
102104
brotli = "6.0.0"
103105
bytes = "1.4.0"
104106
cache_control = "=0.2.0"
@@ -126,6 +128,7 @@ fs3 = "0.5.0"
126128
futures = "0.3.21"
127129
glob = "0.3.1"
128130
h2 = "0.4.4"
131+
hickory-resolver = { version = "0.24", features = ["tokio-runtime", "serde-config"] }
129132
http = "1.0"
130133
http-body = "1.0"
131134
http-body-util = "0.1.2"
@@ -141,7 +144,7 @@ jsonc-parser = { version = "=0.26.2", features = ["serde"] }
141144
lazy-regex = "3"
142145
libc = "0.2.126"
143146
libz-sys = { version = "1.1.20", default-features = false }
144-
log = "0.4.20"
147+
log = { version = "0.4.20", features = ["kv"] }
145148
lsp-types = "=0.97.0" # used by tower-lsp and "proposed" feature is unstable in patch releases
146149
memmem = "0.1.1"
147150
monch = "=0.5.0"
@@ -157,8 +160,8 @@ percent-encoding = "2.3.0"
157160
phf = { version = "0.11", features = ["macros"] }
158161
pin-project = "1.0.11" # don't pin because they yank crates from cargo
159162
pretty_assertions = "=1.4.0"
160-
prost = "0.11"
161-
prost-build = "0.11"
163+
prost = "0.13"
164+
prost-build = "0.13"
162165
rand = "=0.8.5"
163166
regex = "^1.7.0"
164167
reqwest = { version = "=0.12.5", default-features = false, features = ["rustls-tls", "stream", "gzip", "brotli", "socks", "json", "http2"] } # pinned because of https://github.com/seanmonstar/reqwest/pull/1955
@@ -204,9 +207,15 @@ webpki-root-certs = "0.26.5"
204207
webpki-roots = "0.26"
205208
which = "4.2.5"
206209
yoke = { version = "0.7.4", features = ["derive"] }
207-
zeromq = { version = "=0.4.0", default-features = false, features = ["tcp-transport", "tokio-runtime"] }
210+
zeromq = { version = "=0.4.1", default-features = false, features = ["tcp-transport", "tokio-runtime"] }
208211
zstd = "=0.12.4"
209212

213+
opentelemetry = "0.27.0"
214+
opentelemetry-http = "0.27.0"
215+
opentelemetry-otlp = { version = "0.27.0", features = ["logs", "http-proto", "http-json"] }
216+
opentelemetry-semantic-conventions = { version = "0.27.0", features = ["semconv_experimental"] }
217+
opentelemetry_sdk = "0.27.0"
218+
210219
# crypto
211220
hkdf = "0.12.3"
212221
rsa = { version = "0.9.3", default-features = false, features = ["std", "pem", "hazmat"] } # hazmat needed for PrehashSigner in ext/node

cli/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ winres.workspace = true
6969

7070
[dependencies]
7171
deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
72-
deno_cache_dir = { workspace = true }
73-
deno_config = { version = "=0.38.2", features = ["workspace", "sync"] }
72+
deno_cache_dir.workspace = true
73+
deno_config.workspace = true
7474
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
7575
deno_doc = { version = "0.156.0", default-features = false, features = ["rust", "html", "syntect"] }
7676
deno_graph = { version = "=0.84.1" }
@@ -122,7 +122,7 @@ hyper-util.workspace = true
122122
import_map = { version = "=0.20.1", features = ["ext"] }
123123
indexmap.workspace = true
124124
jsonc-parser = { workspace = true, features = ["cst", "serde"] }
125-
jupyter_runtime = { package = "runtimelib", version = "=0.14.0" }
125+
jupyter_runtime = { package = "runtimelib", version = "=0.19.0", features = ["tokio-runtime"] }
126126
lazy-regex.workspace = true
127127
libc.workspace = true
128128
libz-sys.workspace = true

cli/args/flags.rs

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use deno_path_util::normalize_path;
3636
use deno_path_util::url_to_file_path;
3737
use deno_runtime::deno_permissions::PermissionsOptions;
3838
use deno_runtime::deno_permissions::SysDescriptor;
39+
use deno_runtime::ops::otel::OtelConfig;
3940
use log::debug;
4041
use log::Level;
4142
use serde::Deserialize;
@@ -576,7 +577,6 @@ pub struct UnstableConfig {
576577
// TODO(bartlomieju): remove in Deno 2.5
577578
pub legacy_flag_enabled: bool, // --unstable
578579
pub bare_node_builtins: bool,
579-
pub detect_cjs: bool,
580580
pub sloppy_imports: bool,
581581
pub features: Vec<String>, // --unstabe-kv --unstable-cron
582582
}
@@ -613,7 +613,7 @@ pub struct Flags {
613613
pub internal: InternalFlags,
614614
pub ignore: Vec<String>,
615615
pub import_map_path: Option<String>,
616-
pub env_file: Option<String>,
616+
pub env_file: Option<Vec<String>>,
617617
pub inspect_brk: Option<SocketAddr>,
618618
pub inspect_wait: Option<SocketAddr>,
619619
pub inspect: Option<SocketAddr>,
@@ -968,6 +968,24 @@ impl Flags {
968968
args
969969
}
970970

971+
pub fn otel_config(&self) -> Option<OtelConfig> {
972+
if self
973+
.unstable_config
974+
.features
975+
.contains(&String::from("otel"))
976+
{
977+
Some(OtelConfig {
978+
runtime_name: Cow::Borrowed("deno"),
979+
runtime_version: Cow::Borrowed(crate::version::DENO_VERSION_INFO.deno),
980+
deterministic: std::env::var("DENO_UNSTABLE_OTEL_DETERMINISTIC")
981+
.is_ok(),
982+
..Default::default()
983+
})
984+
} else {
985+
None
986+
}
987+
}
988+
971989
/// Extract the paths the config file should be discovered from.
972990
///
973991
/// Returns `None` if the config file should not be auto-discovered.
@@ -3757,12 +3775,14 @@ fn env_file_arg() -> Arg {
37573775
.help(cstr!(
37583776
"Load environment variables from local file
37593777
<p(245)>Only the first environment variable with a given key is used.
3760-
Existing process environment variables are not overwritten.</>"
3778+
Existing process environment variables are not overwritten, so if variables with the same names already exist in the environment, their values will be preserved.
3779+
Where multiple declarations for the same environment variable exist in your .env file, the first one encountered is applied. This is determined by the order of the files you pass as arguments.</>"
37613780
))
37623781
.value_hint(ValueHint::FilePath)
37633782
.default_missing_value(".env")
37643783
.require_equals(true)
37653784
.num_args(0..=1)
3785+
.action(ArgAction::Append)
37663786
}
37673787

37683788
fn reload_arg() -> Arg {
@@ -5469,7 +5489,9 @@ fn import_map_arg_parse(flags: &mut Flags, matches: &mut ArgMatches) {
54695489
}
54705490

54715491
fn env_file_arg_parse(flags: &mut Flags, matches: &mut ArgMatches) {
5472-
flags.env_file = matches.remove_one::<String>("env-file");
5492+
flags.env_file = matches
5493+
.get_many::<String>("env-file")
5494+
.map(|values| values.cloned().collect());
54735495
}
54745496

54755497
fn reload_arg_parse(
@@ -5720,7 +5742,6 @@ fn unstable_args_parse(
57205742

57215743
flags.unstable_config.bare_node_builtins =
57225744
matches.get_flag("unstable-bare-node-builtins");
5723-
flags.unstable_config.detect_cjs = matches.get_flag("unstable-detect-cjs");
57245745
flags.unstable_config.sloppy_imports =
57255746
matches.get_flag("unstable-sloppy-imports");
57265747

@@ -7406,7 +7427,7 @@ mod tests {
74067427
allow_all: true,
74077428
..Default::default()
74087429
},
7409-
env_file: Some(".example.env".to_owned()),
7430+
env_file: Some(vec![".example.env".to_owned()]),
74107431
..Flags::default()
74117432
}
74127433
);
@@ -7500,7 +7521,7 @@ mod tests {
75007521
allow_all: true,
75017522
..Default::default()
75027523
},
7503-
env_file: Some(".example.env".to_owned()),
7524+
env_file: Some(vec![".example.env".to_owned()]),
75047525
unsafely_ignore_certificate_errors: Some(vec![]),
75057526
..Flags::default()
75067527
}
@@ -8148,7 +8169,7 @@ mod tests {
81488169
subcommand: DenoSubcommand::Run(RunFlags::new_default(
81498170
"script.ts".to_string(),
81508171
)),
8151-
env_file: Some(".env".to_owned()),
8172+
env_file: Some(vec![".env".to_owned()]),
81528173
code_cache_enabled: true,
81538174
..Flags::default()
81548175
}
@@ -8164,7 +8185,7 @@ mod tests {
81648185
subcommand: DenoSubcommand::Run(RunFlags::new_default(
81658186
"script.ts".to_string(),
81668187
)),
8167-
env_file: Some(".env".to_owned()),
8188+
env_file: Some(vec![".env".to_owned()]),
81688189
code_cache_enabled: true,
81698190
..Flags::default()
81708191
}
@@ -8197,7 +8218,7 @@ mod tests {
81978218
subcommand: DenoSubcommand::Run(RunFlags::new_default(
81988219
"script.ts".to_string(),
81998220
)),
8200-
env_file: Some(".another_env".to_owned()),
8221+
env_file: Some(vec![".another_env".to_owned()]),
82018222
code_cache_enabled: true,
82028223
..Flags::default()
82038224
}
@@ -8218,7 +8239,29 @@ mod tests {
82188239
subcommand: DenoSubcommand::Run(RunFlags::new_default(
82198240
"script.ts".to_string(),
82208241
)),
8221-
env_file: Some(".another_env".to_owned()),
8242+
env_file: Some(vec![".another_env".to_owned()]),
8243+
code_cache_enabled: true,
8244+
..Flags::default()
8245+
}
8246+
);
8247+
}
8248+
8249+
#[test]
8250+
fn run_multiple_env_file_defined() {
8251+
let r = flags_from_vec(svec![
8252+
"deno",
8253+
"run",
8254+
"--env-file",
8255+
"--env-file=.two_env",
8256+
"script.ts"
8257+
]);
8258+
assert_eq!(
8259+
r.unwrap(),
8260+
Flags {
8261+
subcommand: DenoSubcommand::Run(RunFlags::new_default(
8262+
"script.ts".to_string(),
8263+
)),
8264+
env_file: Some(vec![".env".to_owned(), ".two_env".to_owned()]),
82228265
code_cache_enabled: true,
82238266
..Flags::default()
82248267
}
@@ -8361,7 +8404,7 @@ mod tests {
83618404
allow_read: Some(vec![]),
83628405
..Default::default()
83638406
},
8364-
env_file: Some(".example.env".to_owned()),
8407+
env_file: Some(vec![".example.env".to_owned()]),
83658408
..Flags::default()
83668409
}
83678410
);
@@ -10036,7 +10079,7 @@ mod tests {
1003610079
unsafely_ignore_certificate_errors: Some(vec![]),
1003710080
v8_flags: svec!["--help", "--random-seed=1"],
1003810081
seed: Some(1),
10039-
env_file: Some(".example.env".to_owned()),
10082+
env_file: Some(vec![".example.env".to_owned()]),
1004010083
..Flags::default()
1004110084
}
1004210085
);

0 commit comments

Comments
 (0)