Skip to content

Commit

Permalink
feat(api) Remove all references to wasmer-js.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Jul 23, 2021
1 parent b302848 commit 9bc0910
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ ifneq ($(ENABLE_LLVM), 0)
endif
endif

exclude_tests := --exclude wasmer-c-api --exclude wasmer-cli --exclude wasmer-js
exclude_tests := --exclude wasmer-c-api --exclude wasmer-cli
# Is failing to compile in Linux for some reason
exclude_tests += --exclude wasmer-wasi-experimental-io-devices
# We run integration tests separately (it requires building the c-api)
Expand Down Expand Up @@ -501,7 +501,7 @@ test-packages:
cargo test --manifest-path lib/cli/Cargo.toml $(compiler_features) --release

test-js:
cd lib/js-api && wasm-pack test --node -- --features=wat
cd lib/api && wasm-pack test --node -- --no-default-features --features js-default,wat


#####
Expand Down
6 changes: 3 additions & 3 deletions lib/api/src/js/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl<'a, T> WasmCell<'a, T> {
///
/// ```
/// use std::cell::Cell;
/// use wasmer_js::WasmCell;
/// use wasmer::WasmCell;
///
/// let cell = Cell::new(5);
/// let wasm_cell = WasmCell::new(&cell);
Expand All @@ -96,7 +96,7 @@ impl<'a, T: Copy> WasmCell<'a, T> {
///
/// ```
/// use std::cell::Cell;
/// use wasmer_js::WasmCell;
/// use wasmer::WasmCell;
///
/// let cell = Cell::new(5);
/// let wasm_cell = WasmCell::new(&cell);
Expand All @@ -123,7 +123,7 @@ impl<T: Sized> WasmCell<'_, T> {
///
/// ```
/// use std::cell::Cell;
/// use wasmer_js::WasmCell;
/// use wasmer::WasmCell;
///
/// let cell = Cell::new(5);
/// let wasm_cell = WasmCell::new(&cell);
Expand Down
4 changes: 2 additions & 2 deletions lib/api/src/js/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl From<ExportError> for HostEnvInitError {
/// This trait can be derived like so:
///
/// ```
/// use wasmer_js::{WasmerEnv, LazyInit, Memory, NativeFunc};
/// use wasmer::{WasmerEnv, LazyInit, Memory, NativeFunc};
///
/// #[derive(WasmerEnv, Clone)]
/// pub struct MyEnvWithNoInstanceData {
Expand Down Expand Up @@ -63,7 +63,7 @@ impl From<ExportError> for HostEnvInitError {
///
/// This trait may also be implemented manually:
/// ```
/// # use wasmer_js::{WasmerEnv, LazyInit, Memory, Instance, HostEnvInitError};
/// # use wasmer::{WasmerEnv, LazyInit, Memory, Instance, HostEnvInitError};
/// #[derive(Clone)]
/// pub struct MyEnv {
/// memory: LazyInit<Memory>,
Expand Down
4 changes: 2 additions & 2 deletions lib/api/src/js/exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use thiserror::Error;
/// ## Incompatible export type
///
/// ```should_panic
/// # use wasmer_js::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value, ExportError};
/// # use wasmer::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value, ExportError};
/// # let store = Store::default();
/// # let wasm_bytes = wat2wasm(r#"
/// # (module
Expand All @@ -36,7 +36,7 @@ use thiserror::Error;
/// ## Missing export
///
/// ```should_panic
/// # use wasmer_js::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value, ExportError};
/// # use wasmer::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value, ExportError};
/// # let store = Store::default();
/// # let wasm_bytes = wat2wasm("(module)".as_bytes()).unwrap();
/// # let module = Module::new(&store, wasm_bytes).unwrap();
Expand Down
28 changes: 14 additions & 14 deletions lib/api/src/js/externals/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Function {
/// # Examples
///
/// ```
/// # use wasmer_js::{Function, FunctionType, Type, Store, Value};
/// # use wasmer::{Function, FunctionType, Type, Store, Value};
/// # let store = Store::default();
/// #
/// let signature = FunctionType::new(vec![Type::I32, Type::I32], vec![Type::I32]);
Expand All @@ -85,7 +85,7 @@ impl Function {
/// With constant signature:
///
/// ```
/// # use wasmer_js::{Function, FunctionType, Type, Store, Value};
/// # use wasmer::{Function, FunctionType, Type, Store, Value};
/// # let store = Store::default();
/// #
/// const I32_I32_TO_I32: ([Type; 2], [Type; 1]) = ([Type::I32, Type::I32], [Type::I32]);
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Function {
/// # Examples
///
/// ```
/// # use wasmer_js::{Function, FunctionType, Type, Store, Value, WasmerEnv};
/// # use wasmer::{Function, FunctionType, Type, Store, Value, WasmerEnv};
/// # let store = Store::default();
/// #
/// #[derive(WasmerEnv, Clone)]
Expand All @@ -181,7 +181,7 @@ impl Function {
/// With constant signature:
///
/// ```
/// # use wasmer_js::{Function, FunctionType, Type, Store, Value, WasmerEnv};
/// # use wasmer::{Function, FunctionType, Type, Store, Value, WasmerEnv};
/// # let store = Store::default();
/// const I32_I32_TO_I32: ([Type; 2], [Type; 1]) = ([Type::I32, Type::I32], [Type::I32]);
///
Expand Down Expand Up @@ -274,7 +274,7 @@ impl Function {
/// # Example
///
/// ```
/// # use wasmer_js::{Store, Function};
/// # use wasmer::{Store, Function};
/// # let store = Store::default();
/// #
/// fn sum(a: i32, b: i32) -> i32 {
Expand Down Expand Up @@ -315,7 +315,7 @@ impl Function {
/// # Example
///
/// ```
/// # use wasmer_js::{Store, Function, WasmerEnv};
/// # use wasmer::{Store, Function, WasmerEnv};
/// # let store = Store::default();
/// #
/// #[derive(WasmerEnv, Clone)]
Expand Down Expand Up @@ -364,7 +364,7 @@ impl Function {
/// # Example
///
/// ```
/// # use wasmer_js::{Function, Store, Type};
/// # use wasmer::{Function, Store, Type};
/// # let store = Store::default();
/// #
/// fn sum(a: i32, b: i32) -> i32 {
Expand All @@ -390,7 +390,7 @@ impl Function {
/// # Example
///
/// ```
/// # use wasmer_js::{Function, Store, Type};
/// # use wasmer::{Function, Store, Type};
/// # let store = Store::default();
/// #
/// fn sum(a: i32, b: i32) -> i32 {
Expand All @@ -410,7 +410,7 @@ impl Function {
/// # Example
///
/// ```
/// # use wasmer_js::{Function, Store, Type};
/// # use wasmer::{Function, Store, Type};
/// # let store = Store::default();
/// #
/// fn sum(a: i32, b: i32) -> i32 {
Expand All @@ -436,7 +436,7 @@ impl Function {
/// # Examples
///
/// ```
/// # use wasmer_js::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # use wasmer::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # let store = Store::default();
/// # let wasm_bytes = wat2wasm(r#"
/// # (module
Expand Down Expand Up @@ -495,7 +495,7 @@ impl Function {
/// # Examples
///
/// ```
/// # use wasmer_js::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # use wasmer::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # let store = Store::default();
/// # let wasm_bytes = wat2wasm(r#"
/// # (module
Expand All @@ -521,7 +521,7 @@ impl Function {
/// an error will be raised:
///
/// ```should_panic
/// # use wasmer_js::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # use wasmer::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # let store = Store::default();
/// # let wasm_bytes = wat2wasm(r#"
/// # (module
Expand All @@ -545,7 +545,7 @@ impl Function {
/// an error will be raised:
///
/// ```should_panic
/// # use wasmer_js::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # use wasmer::{imports, wat2wasm, Function, Instance, Module, Store, Type, Value};
/// # let store = Store::default();
/// # let wasm_bytes = wat2wasm(r#"
/// # (module
Expand Down Expand Up @@ -654,7 +654,7 @@ mod inner {
#[cfg(feature = "experimental-reference-types-extern-ref")]
pub use wasmer_types::{ExternRef, VMExternRef};
use wasmer_types::{FunctionType, NativeWasmType, Type};
// use wasmer_js::{raise_user_trap, resume_panic};
// use wasmer::{raise_user_trap, resume_panic};

/// A trait to convert a Rust value to a `WasmNativeType` value,
/// or to convert `WasmNativeType` value to a Rust value.
Expand Down
18 changes: 9 additions & 9 deletions lib/api/src/js/externals/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Global {
/// # Example
///
/// ```
/// # use wasmer_js::{Global, Mutability, Store, Value};
/// # use wasmer::{Global, Mutability, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new(&store, Value::I32(1));
Expand All @@ -45,7 +45,7 @@ impl Global {
/// # Example
///
/// ```
/// # use wasmer_js::{Global, Mutability, Store, Value};
/// # use wasmer::{Global, Mutability, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new_mut(&store, Value::I32(1));
Expand Down Expand Up @@ -94,7 +94,7 @@ impl Global {
/// # Example
///
/// ```
/// # use wasmer_js::{Global, Mutability, Store, Type, Value, GlobalType};
/// # use wasmer::{Global, Mutability, Store, Type, Value, GlobalType};
/// # let store = Store::default();
/// #
/// let c = Global::new(&store, Value::I32(1));
Expand All @@ -112,7 +112,7 @@ impl Global {
/// # Example
///
/// ```
/// # use wasmer_js::{Global, Store, Value};
/// # use wasmer::{Global, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new(&store, Value::I32(1));
Expand All @@ -128,7 +128,7 @@ impl Global {
/// # Example
///
/// ```
/// # use wasmer_js::{Global, Store, Value};
/// # use wasmer::{Global, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new(&store, Value::I32(1));
Expand All @@ -150,7 +150,7 @@ impl Global {
/// # Example
///
/// ```
/// # use wasmer_js::{Global, Store, Value};
/// # use wasmer::{Global, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new_mut(&store, Value::I32(1));
Expand All @@ -167,7 +167,7 @@ impl Global {
/// Trying to mutate a immutable global will raise an error:
///
/// ```should_panic
/// # use wasmer_js::{Global, Store, Value};
/// # use wasmer::{Global, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new(&store, Value::I32(1));
Expand All @@ -178,7 +178,7 @@ impl Global {
/// Trying to set a value of a incompatible type will raise an error:
///
/// ```should_panic
/// # use wasmer_js::{Global, Store, Value};
/// # use wasmer::{Global, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new(&store, Value::I32(1));
Expand Down Expand Up @@ -216,7 +216,7 @@ impl Global {
/// # Example
///
/// ```
/// # use wasmer_js::{Global, Store, Value};
/// # use wasmer::{Global, Store, Value};
/// # let store = Store::default();
/// #
/// let g = Global::new(&store, Value::I32(1));
Expand Down
16 changes: 8 additions & 8 deletions lib/api/src/js/externals/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Memory {
/// # Example
///
/// ```
/// # use wasmer_js::{Memory, MemoryType, Pages, Store, Type, Value};
/// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value};
/// # let store = Store::default();
/// #
/// let m = Memory::new(&store, MemoryType::new(1, None, false)).unwrap();
Expand Down Expand Up @@ -116,7 +116,7 @@ impl Memory {
/// # Example
///
/// ```
/// # use wasmer_js::{Memory, MemoryType, Pages, Store, Type, Value};
/// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value};
/// # let store = Store::default();
/// #
/// let mt = MemoryType::new(1, None, false);
Expand All @@ -135,7 +135,7 @@ impl Memory {
/// # Example
///
/// ```
/// # use wasmer_js::{Memory, MemoryType, Pages, Store, Type, Value};
/// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value};
/// # let store = Store::default();
/// #
/// let m = Memory::new(&store, MemoryType::new(1, None, false)).unwrap();
Expand Down Expand Up @@ -189,7 +189,7 @@ impl Memory {
/// # Example
///
/// ```
/// # use wasmer_js::{Memory, MemoryType, Pages, Store, Type, Value};
/// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value};
/// # let store = Store::default();
/// #
/// let m = Memory::new(&store, MemoryType::new(1, None, false)).unwrap();
Expand All @@ -210,7 +210,7 @@ impl Memory {
/// # Example
///
/// ```
/// # use wasmer_js::{Memory, MemoryType, Pages, Store, Type, Value, WASM_MAX_PAGES};
/// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value, WASM_MAX_PAGES};
/// # let store = Store::default();
/// #
/// let m = Memory::new(&store, MemoryType::new(1, Some(3), false)).unwrap();
Expand All @@ -226,7 +226,7 @@ impl Memory {
/// of pages.
///
/// ```should_panic
/// # use wasmer_js::{Memory, MemoryType, Pages, Store, Type, Value, WASM_MAX_PAGES};
/// # use wasmer::{Memory, MemoryType, Pages, Store, Type, Value, WASM_MAX_PAGES};
/// # let store = Store::default();
/// #
/// let m = Memory::new(&store, MemoryType::new(1, Some(1), false)).unwrap();
Expand Down Expand Up @@ -268,7 +268,7 @@ impl Memory {
/// # Usage:
///
/// ```
/// # use wasmer_js::{Memory, MemoryView};
/// # use wasmer::{Memory, MemoryView};
/// # use std::{cell::Cell, sync::atomic::Ordering};
/// # fn view_memory(memory: Memory) {
/// // Without synchronization.
Expand Down Expand Up @@ -305,7 +305,7 @@ impl Memory {
/// # Example
///
/// ```
/// # use wasmer_js::{Memory, MemoryType, Store, Value};
/// # use wasmer::{Memory, MemoryType, Store, Value};
/// # let store = Store::default();
/// #
/// let m = Memory::new(&store, MemoryType::new(1, None, false)).unwrap();
Expand Down
10 changes: 5 additions & 5 deletions lib/api/src/js/import_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub trait LikeNamespace {
///
/// # Usage:
/// ```ignore
/// use wasmer_js::{Exports, ImportObject, Function};
/// use wasmer::{Exports, ImportObject, Function};
///
/// let mut import_object = ImportObject::new();
/// let mut env = Exports::new();
Expand All @@ -55,7 +55,7 @@ impl ImportObject {
///
/// # Usage
/// ```ignore
/// # use wasmer_js::{ImportObject, Instance, Namespace};
/// # use wasmer::{ImportObject, Instance, Namespace};
/// let mut import_object = ImportObject::new();
/// import_object.get_export("module", "name");
/// ```
Expand All @@ -78,7 +78,7 @@ impl ImportObject {
///
/// # Usage:
/// ```ignore
/// # use wasmer_js::{ImportObject, Instance, Namespace};
/// # use wasmer::{ImportObject, Instance, Namespace};
/// let mut import_object = ImportObject::new();
///
/// import_object.register("namespace0", instance);
Expand Down Expand Up @@ -188,9 +188,9 @@ impl fmt::Debug for ImportObject {
/// # Usage
///
/// ```
/// # use wasmer_js::{Function, Store};
/// # use wasmer::{Function, Store};
/// # let store = Store::default();
/// use wasmer_js::imports;
/// use wasmer::imports;
///
/// let import_object = imports! {
/// "env" => {
Expand Down
Loading

0 comments on commit 9bc0910

Please sign in to comment.