From e1c8d2755e23182875b8fefeb558e603dd981418 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 23 Sep 2024 14:46:50 -0400 Subject: BREAKING: remove support for remote import maps in deno.json (#25836) This is for security reasons for the time being for Deno 2. Details to follow post Deno 2.0 release. Remote import maps seem incredibly rare (only 2 usages on GitHub from what I can tell), so we'll add this back with more permissions if there's enough demand for it: https://github.com/search?type=code&q=%2F%22importMap%22%3A+%22http%2F In the meantime, use the `--import-map` flag and `"deno.importMap"` config in the LSP for remote import maps. --- cli/args/mod.rs | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'cli/args/mod.rs') diff --git a/cli/args/mod.rs b/cli/args/mod.rs index cec1b53b2..b8a05f325 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1065,27 +1065,13 @@ impl CliOptions { None => None, } }; - Ok( - self - .workspace() - .create_resolver( - CreateResolverOptions { - pkg_json_dep_resolution, - specified_import_map: cli_arg_specified_import_map, - }, - |specifier| { - let specifier = specifier.clone(); - async move { - let file = file_fetcher - .fetch_bypass_permissions(&specifier) - .await? - .into_text_decoded()?; - Ok(file.source.to_string()) - } - }, - ) - .await?, - ) + Ok(self.workspace().create_resolver( + CreateResolverOptions { + pkg_json_dep_resolution, + specified_import_map: cli_arg_specified_import_map, + }, + |path| Ok(std::fs::read_to_string(path)?), + )?) } pub fn node_ipc_fd(&self) -> Option { -- cgit v1.2.3