Skip to content

Commit

Permalink
Merge the wasm-bridge-js crate
Browse files Browse the repository at this point in the history
  • Loading branch information
kajacx committed Mar 10, 2024
1 parent 28c4cc7 commit b9c4503
Show file tree
Hide file tree
Showing 44 changed files with 22 additions and 42 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

members = [
"crates/wasm-bridge",
"crates/wasm-bridge-js",
"crates/wasm-bridge-wasi",
"crates/wasm-bridge-macros",
]
Expand Down
27 changes: 0 additions & 27 deletions crates/wasm-bridge-js/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions crates/wasm-bridge-js/README.md

This file was deleted.

20 changes: 15 additions & 5 deletions crates/wasm-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ wasm-bridge-macros = { workspace = true, optional = true }
async-trait = { workspace = true, optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bridge-js = { workspace = true }
js-sys = { workspace = true }
wasm-bindgen = { workspace = true }
wasm-bindgen-futures = { workspace = true }
wat = { workspace = true, optional = true }
wasm-bridge-macros = { workspace = true, optional = true }
async-trait = { workspace = true, optional = true }
js-component-bindgen = { workspace = true, optional = true }
anyhow = { workspace = true }

[dev-dependencies]
wasm-bindgen-test = { workspace = true }

[features]
default = ["wat", "error-logging"]
wat = ["wasmtime/wat", "wasm-bridge-js/wat"]
component-model = ["wasmtime/component-model", "wasm-bridge-macros", "wasm-bridge-js/component-model"]
async = ["wasmtime/async", "async-trait", "wasm-bridge-js/async", "wasm-bridge-macros/async"]
error-logging = ["wasm-bridge-js/error-logging"]
wat = ["dep:wat", "wasmtime/wat"]
component-model = ["wasmtime/component-model", "wasm-bridge-macros", "js-component-bindgen"]
async = ["wasmtime/async", "async-trait", "wasm-bridge-macros/async"]
error-logging = []
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::rc::Rc;

use wasm_bindgen::{prelude::*, JsValue};

use crate::conversions::FromJsValue;
use crate::direct::*;
use crate::FromJsValue;
use crate::{DataHandle, DropHandle, Result, StoreContextMut};
use js_sys::{Array, Function};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::component::ResourceAny;
use crate::Result;
use crate::{component::Resource, conversions::FromJsValue};
use crate::{component::Resource, FromJsValue};
use anyhow::{bail, Context};
use wasm_bindgen::JsValue;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;
use crate::component::{Resource, ResourceAny};
use crate::conversions::ToJsValue;
use crate::Result;
use crate::ToJsValue;
use wasm_bindgen::JsValue;

macro_rules! lower_primitive {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion crates/wasm-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ mod sys;
pub use sys::*;

#[cfg(target_arch = "wasm32")]
pub use wasm_bridge_js::*;
mod js;

#[cfg(target_arch = "wasm32")]
pub use js::*;
1 change: 0 additions & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ echo

echo Releasing crates
cargo publish -p wasm-bridge-macros
cargo publish -p wasm-bridge-js
cargo publish -p wasm-bridge
cargo publish -p wasm-bridge-wasi
echo
Expand Down

0 comments on commit b9c4503

Please sign in to comment.