mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
feat: rename --unstable-node-conditions to --unstable-conditions (#29885)
The `DENO_NODE_CONDITIONS` env var was renamed to `DENO_CONDITIONS`. Ref https://github.com/denoland/deno/pull/29628 Ref https://github.com/denoland/deno/issues/23757
This commit is contained in:
parent
9bcd4366ee
commit
1192bc0040
4 changed files with 12 additions and 13 deletions
|
@ -4593,9 +4593,9 @@ fn lock_args() -> [Arg; 3] {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_conditions_arg() -> Arg {
|
fn node_conditions_arg() -> Arg {
|
||||||
Arg::new("unstable-node-conditions")
|
Arg::new("unstable-conditions")
|
||||||
.long("unstable-node-conditions")
|
.long("unstable-conditions")
|
||||||
.help("Use this argument to specify custom conditions for npm package exports. You can also use DENO_NODE_CONDITIONS env var.")
|
.help("Use this argument to specify custom conditions for npm package exports. You can also use DENO_CONDITIONS env var.")
|
||||||
.use_value_delimiter(true)
|
.use_value_delimiter(true)
|
||||||
.action(ArgAction::Append)
|
.action(ArgAction::Append)
|
||||||
}
|
}
|
||||||
|
@ -6286,8 +6286,7 @@ fn lock_args_parse(flags: &mut Flags, matches: &mut ArgMatches) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_conditions_args_parse(flags: &mut Flags, matches: &mut ArgMatches) {
|
fn node_conditions_args_parse(flags: &mut Flags, matches: &mut ArgMatches) {
|
||||||
if let Some(conditions) =
|
if let Some(conditions) = matches.remove_many::<String>("unstable-conditions")
|
||||||
matches.remove_many::<String>("unstable-node-conditions")
|
|
||||||
{
|
{
|
||||||
flags.node_conditions = conditions.collect();
|
flags.node_conditions = conditions.collect();
|
||||||
}
|
}
|
||||||
|
@ -12501,7 +12500,7 @@ Usage: deno repl [OPTIONS] [-- [ARGS]...]\n"
|
||||||
let flags = flags_from_vec(svec![
|
let flags = flags_from_vec(svec![
|
||||||
"deno",
|
"deno",
|
||||||
"run",
|
"run",
|
||||||
"--unstable-node-conditions",
|
"--unstable-conditions",
|
||||||
"development",
|
"development",
|
||||||
"main.ts"
|
"main.ts"
|
||||||
])
|
])
|
||||||
|
@ -12522,7 +12521,7 @@ Usage: deno repl [OPTIONS] [-- [ARGS]...]\n"
|
||||||
let flags = flags_from_vec(svec![
|
let flags = flags_from_vec(svec![
|
||||||
"deno",
|
"deno",
|
||||||
"run",
|
"run",
|
||||||
"--unstable-node-conditions",
|
"--unstable-conditions",
|
||||||
"development,production",
|
"development,production",
|
||||||
"main.ts"
|
"main.ts"
|
||||||
])
|
])
|
||||||
|
@ -12543,9 +12542,9 @@ Usage: deno repl [OPTIONS] [-- [ARGS]...]\n"
|
||||||
let flags = flags_from_vec(svec![
|
let flags = flags_from_vec(svec![
|
||||||
"deno",
|
"deno",
|
||||||
"run",
|
"run",
|
||||||
"--unstable-node-conditions",
|
"--unstable-conditions",
|
||||||
"development",
|
"development",
|
||||||
"--unstable-node-conditions",
|
"--unstable-conditions",
|
||||||
"production",
|
"production",
|
||||||
"main.ts"
|
"main.ts"
|
||||||
])
|
])
|
||||||
|
|
|
@ -549,7 +549,7 @@ fn resolve_flags_and_init(
|
||||||
load_env_variables_from_env_file(flags.env_file.as_ref(), flags.log_level);
|
load_env_variables_from_env_file(flags.env_file.as_ref(), flags.log_level);
|
||||||
flags.unstable_config.fill_with_env();
|
flags.unstable_config.fill_with_env();
|
||||||
if flags.node_conditions.is_empty() {
|
if flags.node_conditions.is_empty() {
|
||||||
if let Ok(conditions) = std::env::var("DENO_NODE_CONDITIONS") {
|
if let Ok(conditions) = std::env::var("DENO_CONDITIONS") {
|
||||||
flags.node_conditions = conditions
|
flags.node_conditions = conditions
|
||||||
.split(",")
|
.split(",")
|
||||||
.map(|c| c.trim().to_string())
|
.map(|c| c.trim().to_string())
|
||||||
|
|
|
@ -10,14 +10,14 @@
|
||||||
"output": "no_condition.out"
|
"output": "no_condition.out"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"args": "run --unstable-node-conditions react-server -A main.js",
|
"args": "run --unstable-conditions react-server -A main.js",
|
||||||
"output": "condition.out",
|
"output": "condition.out",
|
||||||
"exitCode": 1
|
"exitCode": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"args": "run -A main.js",
|
"args": "run -A main.js",
|
||||||
"envs": {
|
"envs": {
|
||||||
"DENO_NODE_CONDITIONS": "react-server"
|
"DENO_CONDITIONS": "react-server"
|
||||||
},
|
},
|
||||||
"output": "condition.out",
|
"output": "condition.out",
|
||||||
"exitCode": 1
|
"exitCode": 1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"args": "run --unstable-node-conditions some-condition main.cjs",
|
"args": "run --unstable-conditions some-condition main.cjs",
|
||||||
"output": "good\n"
|
"output": "good\n"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue