mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
remove --unstable flag from CLI features (#10190)
This commit is contained in:
parent
83770e898e
commit
baf7092ea2
7 changed files with 38 additions and 112 deletions
93
cli/flags.rs
93
cli/flags.rs
|
@ -482,12 +482,12 @@ fn compile_subcommand<'a, 'b>() -> App<'a, 'b> {
|
|||
.takes_value(true)
|
||||
.possible_values(&["x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc", "x86_64-apple-darwin", "aarch64-apple-darwin"])
|
||||
)
|
||||
.about("Compile the script into a self contained executable")
|
||||
.about("UNSTABLE: Compile the script into a self contained executable")
|
||||
.long_about(
|
||||
"Compiles the given script into a self contained executable.
|
||||
"UNSTABLE: Compiles the given script into a self contained executable.
|
||||
|
||||
deno compile --unstable -A https://deno.land/std/http/file_server.ts
|
||||
deno compile --unstable --output /usr/local/bin/color_util https://deno.land/std/examples/colors.ts
|
||||
deno compile -A https://deno.land/std/http/file_server.ts
|
||||
deno compile --output /usr/local/bin/color_util https://deno.land/std/examples/colors.ts
|
||||
|
||||
Any flags passed which affect runtime behavior, such as '--unstable',
|
||||
'--allow-*', '--v8-flags', etc. are encoded into the output executable and used
|
||||
|
@ -751,7 +751,7 @@ Ignore formatting a file by adding an ignore comment at the top of the file:
|
|||
.takes_value(true)
|
||||
.use_delimiter(true)
|
||||
.require_equals(true)
|
||||
.help("Ignore formatting particular source files. Use with --unstable"),
|
||||
.help("Ignore formatting particular source files"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("files")
|
||||
|
@ -795,7 +795,7 @@ TypeScript compiler cache: Subdirectory containing TS compiler output.",
|
|||
.arg(
|
||||
Arg::with_name("json")
|
||||
.long("json")
|
||||
.help("Outputs the information in JSON format")
|
||||
.help("UNSTABLE: Outputs the information in JSON format")
|
||||
.takes_value(false),
|
||||
)
|
||||
}
|
||||
|
@ -873,25 +873,25 @@ https://deno.land/manual/getting_started/setup_your_environment#editors-and-ides
|
|||
|
||||
fn lint_subcommand<'a, 'b>() -> App<'a, 'b> {
|
||||
SubCommand::with_name("lint")
|
||||
.about("Lint source files")
|
||||
.about("UNSTABLE: Lint source files")
|
||||
.long_about(
|
||||
"Lint JavaScript/TypeScript source code.
|
||||
"UNSTABLE: Lint JavaScript/TypeScript source code.
|
||||
|
||||
deno lint --unstable
|
||||
deno lint --unstable myfile1.ts myfile2.js
|
||||
deno lint
|
||||
deno lint myfile1.ts myfile2.js
|
||||
|
||||
Print result as JSON:
|
||||
|
||||
deno lint --unstable --json
|
||||
deno lint --json
|
||||
|
||||
Read from stdin:
|
||||
|
||||
cat file.ts | deno lint --unstable -
|
||||
cat file.ts | deno lint --unstable --json -
|
||||
cat file.ts | deno lint -
|
||||
cat file.ts | deno lint --json -
|
||||
|
||||
List available rules:
|
||||
|
||||
deno lint --unstable --rules
|
||||
deno lint --rules
|
||||
|
||||
Ignore diagnostics on the next line by preceding it with an ignore comment and
|
||||
rule name:
|
||||
|
@ -914,7 +914,6 @@ Ignore linting a file by adding an ignore comment at the top of the file:
|
|||
.arg(
|
||||
Arg::with_name("ignore")
|
||||
.long("ignore")
|
||||
.requires("unstable")
|
||||
.takes_value(true)
|
||||
.use_delimiter(true)
|
||||
.require_equals(true)
|
||||
|
@ -982,8 +981,7 @@ fn test_subcommand<'a, 'b>() -> App<'a, 'b> {
|
|||
Arg::with_name("no-run")
|
||||
.long("no-run")
|
||||
.help("Cache test modules, but don't run tests")
|
||||
.takes_value(false)
|
||||
.requires("unstable"),
|
||||
.takes_value(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("fail-fast")
|
||||
|
@ -1010,10 +1008,9 @@ fn test_subcommand<'a, 'b>() -> App<'a, 'b> {
|
|||
.long("coverage")
|
||||
.require_equals(true)
|
||||
.takes_value(true)
|
||||
.requires("unstable")
|
||||
.conflicts_with("inspect")
|
||||
.conflicts_with("inspect-brk")
|
||||
.help("Collect coverage profile data"),
|
||||
.help("UNSTABLE: Collect coverage profile data"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("files")
|
||||
|
@ -1333,11 +1330,10 @@ fn seed_arg<'a, 'b>() -> Arg<'a, 'b> {
|
|||
|
||||
fn watch_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||
Arg::with_name("watch")
|
||||
.requires("unstable")
|
||||
.long("watch")
|
||||
.help("Watch for file changes and restart process automatically")
|
||||
.help("UNSTABLE: Watch for file changes and restart process automatically")
|
||||
.long_help(
|
||||
"Watch for file changes and restart process automatically.
|
||||
"UNSTABLE: Watch for file changes and restart process automatically.
|
||||
Only local files from entry point module graph are watched.",
|
||||
)
|
||||
}
|
||||
|
@ -2010,13 +2006,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn run_watch() {
|
||||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"run",
|
||||
"--unstable",
|
||||
"--watch",
|
||||
"script.ts"
|
||||
]);
|
||||
let r = flags_from_vec(svec!["deno", "run", "--watch", "script.ts"]);
|
||||
let flags = r.unwrap();
|
||||
assert_eq!(
|
||||
flags,
|
||||
|
@ -2025,7 +2015,6 @@ mod tests {
|
|||
script: "script.ts".to_string(),
|
||||
},
|
||||
watch: true,
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
@ -2228,7 +2217,7 @@ mod tests {
|
|||
}
|
||||
);
|
||||
|
||||
let r = flags_from_vec(svec!["deno", "fmt", "--watch", "--unstable"]);
|
||||
let r = flags_from_vec(svec!["deno", "fmt", "--watch"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2239,7 +2228,6 @@ mod tests {
|
|||
ext: "ts".to_string(),
|
||||
},
|
||||
watch: true,
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
@ -2249,7 +2237,6 @@ mod tests {
|
|||
"fmt",
|
||||
"--check",
|
||||
"--watch",
|
||||
"--unstable",
|
||||
"foo.ts",
|
||||
"--ignore=bar.js"
|
||||
]);
|
||||
|
@ -2263,7 +2250,6 @@ mod tests {
|
|||
ext: "ts".to_string(),
|
||||
},
|
||||
watch: true,
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
@ -2283,13 +2269,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn lint() {
|
||||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"lint",
|
||||
"--unstable",
|
||||
"script_1.ts",
|
||||
"script_2.ts"
|
||||
]);
|
||||
let r = flags_from_vec(svec!["deno", "lint", "script_1.ts", "script_2.ts"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2302,17 +2282,12 @@ mod tests {
|
|||
json: false,
|
||||
ignore: vec![],
|
||||
},
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
||||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"lint",
|
||||
"--unstable",
|
||||
"--ignore=script_1.ts,script_2.ts"
|
||||
]);
|
||||
let r =
|
||||
flags_from_vec(svec!["deno", "lint", "--ignore=script_1.ts,script_2.ts"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2325,12 +2300,11 @@ mod tests {
|
|||
PathBuf::from("script_2.ts")
|
||||
],
|
||||
},
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
||||
let r = flags_from_vec(svec!["deno", "lint", "--unstable", "--rules"]);
|
||||
let r = flags_from_vec(svec!["deno", "lint", "--rules"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2340,18 +2314,11 @@ mod tests {
|
|||
json: false,
|
||||
ignore: vec![],
|
||||
},
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
||||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"lint",
|
||||
"--unstable",
|
||||
"--json",
|
||||
"script_1.ts"
|
||||
]);
|
||||
let r = flags_from_vec(svec!["deno", "lint", "--json", "script_1.ts"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2361,7 +2328,6 @@ mod tests {
|
|||
json: true,
|
||||
ignore: vec![],
|
||||
},
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
@ -2894,13 +2860,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn bundle_watch() {
|
||||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"bundle",
|
||||
"--watch",
|
||||
"--unstable",
|
||||
"source.ts"
|
||||
]);
|
||||
let r = flags_from_vec(svec!["deno", "bundle", "--watch", "source.ts"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2909,7 +2869,6 @@ mod tests {
|
|||
out_file: None,
|
||||
},
|
||||
watch: true,
|
||||
unstable: true,
|
||||
..Flags::default()
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue