Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: import_map 0.19 #166

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish -p deno_emit -vv
cargo publish -p deno_emit

- name: Get tag version
if: contains(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/')
Expand Down
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
Loading