mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
feat: stabilise import maps (#9526)
This commit stabilises import maps by removing requirement on "--unstable" flag when "--import-map" flag is used.
This commit is contained in:
parent
7cd14f97c9
commit
0dc89c0a79
5 changed files with 11 additions and 41 deletions
26
cli/flags.rs
26
cli/flags.rs
|
@ -1691,11 +1691,9 @@ fn import_map_arg<'a, 'b>() -> Arg<'a, 'b> {
|
|||
.long("import-map")
|
||||
.alias("importmap")
|
||||
.value_name("FILE")
|
||||
.requires("unstable")
|
||||
.help("UNSTABLE: Load import map file")
|
||||
.help("Load import map file")
|
||||
.long_help(
|
||||
"UNSTABLE:
|
||||
Load import map file
|
||||
"Load import map file from local file or remote URL.
|
||||
Docs: https://deno.land/manual/linking_to_external_code/import_maps
|
||||
Specification: https://wicg.github.io/import-maps/
|
||||
Examples: https://github.com/WICG/import-maps#the-import-map",
|
||||
|
@ -2465,7 +2463,7 @@ mod tests {
|
|||
#[test]
|
||||
fn eval_with_flags() {
|
||||
#[rustfmt::skip]
|
||||
let r = flags_from_vec(svec!["deno", "eval", "--unstable", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "42"]);
|
||||
let r = flags_from_vec(svec!["deno", "eval", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "42"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2474,7 +2472,6 @@ mod tests {
|
|||
code: "42".to_string(),
|
||||
ext: "js".to_string(),
|
||||
},
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_string()),
|
||||
no_remote: true,
|
||||
config_path: Some("tsconfig.json".to_string()),
|
||||
|
@ -2553,13 +2550,12 @@ mod tests {
|
|||
#[test]
|
||||
fn repl_with_flags() {
|
||||
#[rustfmt::skip]
|
||||
let r = flags_from_vec(svec!["deno", "repl", "--unstable", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229"]);
|
||||
let r = flags_from_vec(svec!["deno", "repl", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
repl: true,
|
||||
subcommand: DenoSubcommand::Repl,
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_string()),
|
||||
no_remote: true,
|
||||
config_path: Some("tsconfig.json".to_string()),
|
||||
|
@ -2792,7 +2788,6 @@ mod tests {
|
|||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"run",
|
||||
"--unstable",
|
||||
"--import-map=import_map.json",
|
||||
"script.ts"
|
||||
]);
|
||||
|
@ -2802,7 +2797,6 @@ mod tests {
|
|||
subcommand: DenoSubcommand::Run {
|
||||
script: "script.ts".to_string(),
|
||||
},
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_owned()),
|
||||
..Flags::default()
|
||||
}
|
||||
|
@ -2814,7 +2808,6 @@ mod tests {
|
|||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"info",
|
||||
"--unstable",
|
||||
"--import-map=import_map.json",
|
||||
"script.ts"
|
||||
]);
|
||||
|
@ -2825,7 +2818,6 @@ mod tests {
|
|||
file: Some("script.ts".to_string()),
|
||||
json: false,
|
||||
},
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_owned()),
|
||||
..Flags::default()
|
||||
}
|
||||
|
@ -2837,7 +2829,6 @@ mod tests {
|
|||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"cache",
|
||||
"--unstable",
|
||||
"--import-map=import_map.json",
|
||||
"script.ts"
|
||||
]);
|
||||
|
@ -2847,7 +2838,6 @@ mod tests {
|
|||
subcommand: DenoSubcommand::Cache {
|
||||
files: svec!["script.ts"],
|
||||
},
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_owned()),
|
||||
..Flags::default()
|
||||
}
|
||||
|
@ -2859,7 +2849,6 @@ mod tests {
|
|||
let r = flags_from_vec(svec![
|
||||
"deno",
|
||||
"doc",
|
||||
"--unstable",
|
||||
"--import-map=import_map.json",
|
||||
"script.ts"
|
||||
]);
|
||||
|
@ -2872,7 +2861,6 @@ mod tests {
|
|||
json: false,
|
||||
filter: None,
|
||||
},
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_owned()),
|
||||
..Flags::default()
|
||||
}
|
||||
|
@ -2958,7 +2946,7 @@ mod tests {
|
|||
#[test]
|
||||
fn install_with_flags() {
|
||||
#[rustfmt::skip]
|
||||
let r = flags_from_vec(svec!["deno", "install", "--unstable", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "--name", "file_server", "--root", "/foo", "--force", "https://deno.land/std/http/file_server.ts", "foo", "bar"]);
|
||||
let r = flags_from_vec(svec!["deno", "install", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "--name", "file_server", "--root", "/foo", "--force", "https://deno.land/std/http/file_server.ts", "foo", "bar"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -2969,7 +2957,6 @@ mod tests {
|
|||
root: Some(PathBuf::from("/foo")),
|
||||
force: true,
|
||||
},
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_string()),
|
||||
no_remote: true,
|
||||
config_path: Some("tsconfig.json".to_string()),
|
||||
|
@ -3490,7 +3477,7 @@ mod tests {
|
|||
#[test]
|
||||
fn compile_with_flags() {
|
||||
#[rustfmt::skip]
|
||||
let r = flags_from_vec(svec!["deno", "compile", "--unstable", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--output", "colors", "https://deno.land/std/examples/colors.ts", "foo", "bar"]);
|
||||
let r = flags_from_vec(svec!["deno", "compile", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--output", "colors", "https://deno.land/std/examples/colors.ts", "foo", "bar"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
|
@ -3501,7 +3488,6 @@ mod tests {
|
|||
target: None,
|
||||
lite: false,
|
||||
},
|
||||
unstable: true,
|
||||
import_map_path: Some("import_map.json".to_string()),
|
||||
no_remote: true,
|
||||
config_path: Some("tsconfig.json".to_string()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue