diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-10-11 23:14:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-11 23:14:46 +0200 |
commit | 5508a0f45e233708f3a0a5fc9e9a48ab3c0fb33c (patch) | |
tree | d28b460b0416754fd9ad1a718787dee08e9b402b /cli/compat.rs | |
parent | fbcbbd7ae3fa2d57e8ad026a1f9f01c6d07fd80b (diff) |
feat(compat): pin specific version of std/node (#12396)
Diffstat (limited to 'cli/compat.rs')
-rw-r--r-- | cli/compat.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/compat.rs b/cli/compat.rs index f120ccd04..13be0374d 100644 --- a/cli/compat.rs +++ b/cli/compat.rs @@ -3,7 +3,11 @@ use deno_core::url::Url; use std::collections::HashMap; -static STD_NODE: &str = "https://deno.land/std/node/"; +// TODO(bartlomieju): this needs to be bumped manually for +// each release, a better mechanism is preferable, but it's a quick and dirty +// solution to avoid printing `X-Deno-Warning` headers when the compat layer is +// downloaded +static STD_URL: &str = "https://deno.land/std@0.110.0/"; static GLOBAL_MODULE: &str = "global.ts"; static SUPPORTED_MODULES: &[&str] = &[ @@ -52,7 +56,7 @@ static SUPPORTED_MODULES: &[&str] = &[ ]; lazy_static::lazy_static! { - static ref GLOBAL_URL_STR: String = format!("{}{}", STD_NODE, GLOBAL_MODULE); + static ref GLOBAL_URL_STR: String = format!("{}node/{}", STD_URL, GLOBAL_MODULE); pub(crate) static ref GLOBAL_URL: Url = Url::parse(&GLOBAL_URL_STR).unwrap(); static ref COMPAT_IMPORT_URL: Url = Url::parse("flags:compat").unwrap(); } @@ -71,7 +75,7 @@ pub fn get_mapped_node_builtins() -> HashMap<String, String> { for module in SUPPORTED_MODULES { // TODO(bartlomieju): this is unversioned, and should be fixed to use latest stable? - let module_url = format!("{}{}.ts", STD_NODE, module); + let module_url = format!("{}node/{}.ts", STD_URL, module); mappings.insert(module.to_string(), module_url.clone()); // Support for `node:<module_name>` |