Skip to content

Commit

Permalink
refactor: deno_fetch op crate (#7524)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Sep 18, 2020
1 parent cead79f commit 7845740
Show file tree
Hide file tree
Showing 34 changed files with 2,544 additions and 2,234 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -4,6 +4,7 @@ members = [
"core",
"test_plugin",
"test_util",
"op_crates/fetch",
"op_crates/web",
]
exclude = [
Expand Down
2 changes: 2 additions & 0 deletions cli/Cargo.toml
Expand Up @@ -22,6 +22,7 @@ path = "./bench/main.rs"
[build-dependencies]
deno_core = { path = "../core", version = "0.57.0" }
deno_web = { path = "../op_crates/web", version = "0.8.0" }
deno_fetch = { path = "../op_crates/fetch", version = "0.1.0" }

[target.'cfg(windows)'.build-dependencies]
winres = "0.1.11"
Expand All @@ -32,6 +33,7 @@ deno_core = { path = "../core", version = "0.57.0" }
deno_doc = "0.1.9"
deno_lint = { version = "0.2.0", features = ["json"] }
deno_web = { path = "../op_crates/web", version = "0.8.0" }
deno_fetch = { path = "../op_crates/fetch", version = "0.1.0" }

atty = "0.2.14"
base64 = "0.12.3"
Expand Down
9 changes: 9 additions & 0 deletions cli/build.rs
Expand Up @@ -16,6 +16,7 @@ fn create_snapshot(
files: Vec<PathBuf>,
) {
deno_web::init(&mut isolate);
deno_fetch::init(&mut isolate);
// TODO(nayeemrmn): https://github.com/rust-lang/cargo/issues/3946 to get the
// workspace root.
let display_root = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap();
Expand Down Expand Up @@ -52,6 +53,10 @@ fn create_compiler_snapshot(
let mut custom_libs: HashMap<String, PathBuf> = HashMap::new();
custom_libs
.insert("lib.deno.web.d.ts".to_string(), deno_web::get_declaration());
custom_libs.insert(
"lib.deno.fetch.d.ts".to_string(),
deno_fetch::get_declaration(),
);
custom_libs.insert(
"lib.deno.window.d.ts".to_string(),
cwd.join("dts/lib.deno.window.d.ts"),
Expand Down Expand Up @@ -112,6 +117,10 @@ fn main() {
"cargo:rustc-env=DENO_WEB_LIB_PATH={}",
deno_web::get_declaration().display()
);
println!(
"cargo:rustc-env=DENO_FETCH_LIB_PATH={}",
deno_fetch::get_declaration().display()
);

println!(
"cargo:rustc-env=TARGET={}",
Expand Down

0 comments on commit 7845740

Please sign in to comment.