Skip to content

Commit

Permalink
chore: import_map 0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Feb 23, 2024
1 parent 96fb176 commit 80e47b9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
[workspace.dependencies]
anyhow = "1.0.44"
base64 = "0.21.5"
deno_graph = { version = "0.69.0", default-features = false }
deno_graph = { version = "0.69.3", default-features = false }
url = { version = "2.3.1" }

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion rs-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ deno_ast = { version = "0.34.0", features = ["bundler", "codegen", "proposal", "
deno_graph = { workspace = true }
escape8259 = "0.5.2"
futures = "0.3.17"
import_map = "0.18.1"
import_map = "0.19.0"
parking_lot = { version = "0.11.2" }
url = { workspace = true }

Expand Down
20 changes: 17 additions & 3 deletions rs-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use deno_graph::ModuleGraph;
use deno_graph::ParsedSourceStore;
use deno_graph::Range;
use import_map::ImportMap;
use import_map::ImportMapOptions;
use std::collections::HashMap;
use url::Url;

Expand Down Expand Up @@ -143,9 +144,14 @@ async fn get_import_map_from_input(
specifier,
maybe_headers: _,
} => {
let import_map = import_map::parse_from_json(
let import_map = import_map::parse_from_json_with_options(
&specifier,
&String::from_utf8(content.to_vec())?,
ImportMapOptions {
address_hook: None,
// always do this for simplicity
expand_imports: true,
},
)?
.import_map;
Ok(Some(import_map))
Expand All @@ -156,8 +162,16 @@ async fn get_import_map_from_input(
base_url,
json_string,
} => {
let import_map =
import_map::parse_from_json(base_url, json_string)?.import_map;
let import_map = import_map::parse_from_json_with_options(
base_url,
json_string,
ImportMapOptions {
address_hook: None,
// always do this for simplicity
expand_imports: true,
},
)?
.import_map;
Ok(Some(import_map))
}
}
Expand Down

0 comments on commit 80e47b9

Please sign in to comment.