feat(api) Remove all references to wasmer-js.

This commit is contained in:
Ivan Enderlin
2021-07-23 12:30:08 +02:00
parent b30284897e
commit 9bc0910a6b
11 changed files with 57 additions and 57 deletions

View File

@@ -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)
@@ -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
#####

View File

@@ -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);
@@ -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);
@@ -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);

View File

@@ -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 {
@@ -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>,

View File

@@ -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
@@ -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();

View File

@@ -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]);
@@ -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]);
@@ -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)]
@@ -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]);
///
@@ -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 {
@@ -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)]
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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.

View File

@@ -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));
@@ -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));
@@ -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));
@@ -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));
@@ -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));
@@ -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));
@@ -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));
@@ -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));
@@ -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));

View File

@@ -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();
@@ -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);
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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.
@@ -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();

View File

@@ -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();
@@ -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");
/// ```
@@ -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);
@@ -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" => {

View File

@@ -71,7 +71,7 @@ impl Instance {
/// [`ImportObject`]: crate::js::ImportObject
///
/// ```
/// # use wasmer_js::{imports, Store, Module, Global, Value, Instance};
/// # use wasmer::{imports, Store, Module, Global, Value, Instance};
/// # fn main() -> anyhow::Result<()> {
/// let store = Store::default();
/// let module = Module::new(&store, "(module)")?;

View File

@@ -89,7 +89,7 @@ impl Module {
/// Reading from a WAT file.
///
/// ```
/// use wasmer_js::*;
/// use wasmer::*;
/// # fn main() -> anyhow::Result<()> {
/// # let store = Store::default();
/// let wat = "(module)";
@@ -101,7 +101,7 @@ impl Module {
/// Reading from bytes:
///
/// ```
/// use wasmer_js::*;
/// use wasmer::*;
/// # fn main() -> anyhow::Result<()> {
/// # let store = Store::default();
/// // The following is the same as:
@@ -261,7 +261,7 @@ impl Module {
/// # Example
///
/// ```
/// # use wasmer_js::*;
/// # use wasmer::*;
/// # fn main() -> anyhow::Result<()> {
/// # let store = Store::default();
/// let wat = "(module $moduleName)";
@@ -285,7 +285,7 @@ impl Module {
/// # Example
///
/// ```
/// # use wasmer_js::*;
/// # use wasmer::*;
/// # fn main() -> anyhow::Result<()> {
/// # let store = Store::default();
/// let wat = "(module)";
@@ -320,7 +320,7 @@ impl Module {
/// # Example
///
/// ```
/// # use wasmer_js::*;
/// # use wasmer::*;
/// # fn main() -> anyhow::Result<()> {
/// # let store = Store::default();
/// let wat = r#"(module
@@ -418,7 +418,7 @@ impl Module {
/// # Example
///
/// ```
/// # use wasmer_js::*;
/// # use wasmer::*;
/// # fn main() -> anyhow::Result<()> {
/// # let store = Store::default();
/// let wat = r#"(module

View File

@@ -23,8 +23,8 @@ pub struct Item;
///
/// This type can be used directly in the host function arguments:
/// ```
/// # use wasmer_js::Memory;
/// # use wasmer_js::WasmPtr;
/// # use wasmer::Memory;
/// # use wasmer::WasmPtr;
/// pub fn host_import(memory: Memory, ptr: WasmPtr<u32>) {
/// let derefed_ptr = ptr.deref(&memory).expect("pointer in bounds");
/// let inner_val: u32 = derefed_ptr.get();
@@ -37,9 +37,9 @@ pub struct Item;
/// This type can also be used with primitive-filled structs, but be careful of
/// guarantees required by `ValueType`.
/// ```
/// # use wasmer_js::Memory;
/// # use wasmer_js::WasmPtr;
/// # use wasmer_js::ValueType;
/// # use wasmer::Memory;
/// # use wasmer::WasmPtr;
/// # use wasmer::ValueType;
///
/// #[derive(Copy, Clone, Debug)]
/// #[repr(C)]