Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Add initial AssemblyScript implementation for response and headers #21

Merged
merged 8 commits into from
Mar 4, 2021
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
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ futures = "0.3"
http = "0.2"
reqwest = { version = "0.11", default-features = true, features = ["json", "blocking"] }
tokio = { version = "1.1", features = ["full"] }
wasmtime = "0.23"
wasmtime-wasi = "0.23"
wasi-common = "0.23"
wasi-cap-std-sync = "0.23"
wasmtime = "0.22"
wasmtime-wasi = "0.22"
wasi-common = "0.22"
wasi-experimental-http = {path = "crates/wasi-experimental-http"}
wasi-experimental-http-wasmtime = {path = "crates/wasi-experimental-http-wasmtime"}

[workspace]
members = [
"crates/wasi-experimental-http",
"crates/wasi-experimental-http-wasmtime",
"tests/simple"
"tests/rust"
]
28 changes: 25 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
use std::process;

const TESTS_DIR: &str = "tests";
const SIMPLE_EXAMPLE: &str = "simple";
const RUST_EXAMPLE: &str = "rust";
const AS_EXAMPLE: &str = "as";

fn main() {
println!("cargo:rerun-if-changed=tests/simple/src/lib.rs");
println!("cargo:rerun-if-changed=tests/rust/src/lib.rs");
println!("cargo:rerun-if-changed=crates/wasi-experimental-http/src/lib.rs");
println!("cargo:rerun-if-changed=tests/as/index.ts");
println!("cargo:rerun-if-changed=crates/as/index.ts");

cargo_build_example(TESTS_DIR.to_string(), SIMPLE_EXAMPLE.to_string())
cargo_build_example(TESTS_DIR.to_string(), RUST_EXAMPLE.to_string());
as_build_example(TESTS_DIR.to_string(), AS_EXAMPLE.to_string());
}

fn cargo_build_example(dir: String, example: String) {
Expand All @@ -23,3 +27,21 @@ fn cargo_build_example(dir: String, example: String) {
.arg("--release");
cmd.output().unwrap();
}

fn as_build_example(dir: String, example: String) {
let dir = format!("{}/{}", dir, example);

let mut cmd = process::Command::new("npm");
cmd.current_dir(dir.clone());
cmd.stdout(process::Stdio::piped());
cmd.stderr(process::Stdio::piped());
cmd.arg("install");
cmd.output().unwrap();

let mut cmd = process::Command::new("npm");
cmd.current_dir(dir);
cmd.stdout(process::Stdio::piped());
cmd.stderr(process::Stdio::piped());
cmd.arg("run").arg("asbuild");
cmd.output().unwrap();
}
Loading