summaryrefslogtreecommitdiff
path: root/cli/args
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-09-23 14:46:50 -0400
committerGitHub <noreply@github.com>2024-09-23 18:46:50 +0000
commite1c8d2755e23182875b8fefeb558e603dd981418 (patch)
tree0202f2aeea0038f8ac3c7d48553fc6cb264b073c /cli/args
parent1287739ddfa659c0b2bd88930eb10e9469b59099 (diff)
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.
Diffstat (limited to 'cli/args')
-rw-r--r--cli/args/mod.rs28
1 files changed, 7 insertions, 21 deletions
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<i64> {