diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-30 18:58:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-30 13:58:58 -0400 |
commit | b1c6142f741a507ba6594ab174065e00213100b9 (patch) | |
tree | f3dce3e55e4b10b6cf0570dddb6f69340da7a0cf /cli/args/flags.rs | |
parent | 4639ae655e9db396fdf4408961db59372334b69b (diff) |
BREAKING: `DENO_FUTURE=1` by default, or welcome to Deno 2.0 (#25213)
This commit effectively turns Deno into Deno 2.0.
This is done by forcing `DENO_FUTURE=1` env var, that was available in
the past few months to try Deno 2 changes.
This commit contains several breaking changes scheduled for Deno 2:
- all deprecated JavaScript APIs are not available any more, mostly
`Deno.*` APIs
- `window` global is removed
- FFI, WebGPU and FS APIs are now stable and don't require
`--unstable-*` flags
- import assertions are no longer supported
- "bring your own node modules" is enabled by default
This is the first commit in a series that are scheduled before the Deno
2 release.
Follow up work is tracked in
https://github.com/denoland/deno/issues/25241.
---------
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
Co-authored-by: Nathan Whitaker <nathan@deno.com>
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 3ac280869..050d55f4c 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -8244,8 +8244,12 @@ mod tests { #[test] fn install() { - let r = - flags_from_vec(svec!["deno", "install", "jsr:@std/http/file-server"]); + let r = flags_from_vec(svec![ + "deno", + "install", + "-g", + "jsr:@std/http/file-server" + ]); assert_eq!( r.unwrap(), Flags { @@ -8257,7 +8261,7 @@ mod tests { root: None, force: false, }), - global: false, + global: true, }), ..Flags::default() } @@ -8290,7 +8294,7 @@ mod tests { #[test] fn install_with_flags() { #[rustfmt::skip] - let r = flags_from_vec(svec!["deno", "install", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--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", "--env=.example.env", "jsr:@std/http/file-server", "foo", "bar"]); + let r = flags_from_vec(svec!["deno", "install", "--global", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--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", "--env=.example.env", "jsr:@std/http/file-server", "foo", "bar"]); assert_eq!( r.unwrap(), Flags { @@ -8302,7 +8306,7 @@ mod tests { root: Some("/foo".to_string()), force: true, }), - global: false, + global: true, }), import_map_path: Some("import_map.json".to_string()), no_remote: true, @@ -8682,25 +8686,7 @@ mod tests { watch: None, bare: true, }), - node_modules_dir: Some(true), - code_cache_enabled: true, - ..Flags::default() - } - ); - - let r = flags_from_vec(svec![ - "deno", - "run", - "--node-modules-dir=false", - "script.ts" - ]); - assert_eq!( - r.unwrap(), - Flags { - subcommand: DenoSubcommand::Run(RunFlags::new_default( - "script.ts".to_string(), - )), - node_modules_dir: Some(false), + node_modules_dir: None, code_cache_enabled: true, ..Flags::default() } |