diff --git a/Cargo.lock b/Cargo.lock index 907fa0f..ee44b55 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -304,9 +304,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.55.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09c93dac12402a37be3ee24e0b6a691ddc5fdef13831b375b6c0950efc89e40" +checksum = "36ea06eb5d80c3b22d93b5bf7c48280a4dddf00f0f775d5181ab68ffcb64d0fb" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 950ae10..f06230b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ path = "src/examples/viewer.rs" anyhow = "1" base64 = "0.21.0" deno_ast = { version = "0.29.3", features = ["transpiling"] } -deno_graph = "0.55.0" +deno_graph = "0.56.0" deno_npm = "0.15.0" deno_semver = "0.5.0" futures = "0.3.26" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 326a29c..1994e74 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -14,7 +14,7 @@ crate-type = ["cdylib"] [dependencies] anyhow = "1" console_error_panic_hook = "0.1.7" -deno_graph = "0.55.0" +deno_graph = "0.56.0" eszip = { path = "../" } import_map = "0.15.0" js-sys = { version = "0.3.64" } diff --git a/lib/lib.rs b/lib/lib.rs index fa3acbb..7f36ef9 100644 --- a/lib/lib.rs +++ b/lib/lib.rs @@ -2,6 +2,7 @@ use deno_graph::source::load_data_url; use deno_graph::source::CacheInfo; use deno_graph::source::LoadFuture; use deno_graph::source::Loader; +use deno_graph::source::ResolveError; use deno_graph::source::Resolver; use deno_graph::BuildOptions; use deno_graph::GraphKind; @@ -385,9 +386,11 @@ impl Resolver for GraphResolver { &self, specifier: &str, referrer: &deno_graph::ModuleSpecifier, - ) -> Result { + ) -> Result { if let Some(import_map) = &self.0 { - Ok(import_map.resolve(specifier, referrer)?) + import_map + .resolve(specifier, referrer) + .map_err(|err| ResolveError::Other(err.into())) } else { Ok(deno_graph::resolve_import(specifier, referrer)?) } diff --git a/src/examples/builder.rs b/src/examples/builder.rs index 0e3049f..85fdb3b 100644 --- a/src/examples/builder.rs +++ b/src/examples/builder.rs @@ -3,6 +3,7 @@ use std::sync::Arc; use deno_ast::EmitOptions; use deno_graph::source::CacheSetting; +use deno_graph::source::ResolveError; use deno_graph::BuildOptions; use deno_graph::CapturingModuleAnalyzer; use deno_graph::GraphKind; @@ -94,9 +95,11 @@ impl deno_graph::source::Resolver for Resolver { &self, specifier: &str, referrer: &deno_graph::ModuleSpecifier, - ) -> Result { + ) -> Result { if let Some(import_map) = &self.0 { - Ok(import_map.resolve(specifier, referrer)?) + import_map + .resolve(specifier, referrer) + .map_err(|e| ResolveError::Other(e.into())) } else { Ok(deno_graph::resolve_import(specifier, referrer)?) } diff --git a/src/v2.rs b/src/v2.rs index 4edb7b1..6a0b6c4 100644 --- a/src/v2.rs +++ b/src/v2.rs @@ -1146,6 +1146,7 @@ mod tests { use deno_ast::EmitOptions; use deno_graph::source::CacheSetting; use deno_graph::source::LoadResponse; + use deno_graph::source::ResolveError; use deno_graph::BuildOptions; use deno_graph::CapturingModuleAnalyzer; use deno_graph::GraphKind; @@ -1220,8 +1221,11 @@ mod tests { &self, specifier: &str, referrer: &ModuleSpecifier, - ) -> Result { - Ok(self.0.resolve(specifier, referrer)?) + ) -> Result { + self + .0 + .resolve(specifier, referrer) + .map_err(|err| ResolveError::Other(err.into())) } }