Skip to content
Open
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
12 changes: 12 additions & 0 deletions crates/float-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "rain-math-float-wasm"
version = "0.1.0"
edition = "2021"
license = "LicenseRef-DCL-1.0"
homepage = "https://github.com/rainlanguage/rain.math.float"

[lib]
crate-type = ["cdylib"]

[dependencies]
rain-math-float = { path = "../float" }
8 changes: 8 additions & 0 deletions crates/float-wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//! WASM cdylib wrapper for `rain-math-float`.
//!
//! This crate exists solely to produce the cdylib artifact for WASM targets.
//! The core library (`rain-math-float`) is rlib-only to avoid output filename
//! collisions that cause duplicate dependency compilation in downstream
//! consumers.

pub use rain_math_float::*;
2 changes: 1 addition & 1 deletion crates/float/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "LicenseRef-DCL-1.0"
homepage = "https://github.com/rainlanguage/rain.math.float"

[lib]
crate-type = ["rlib", "cdylib"]
crate-type = ["rlib"]

[dependencies]
alloy = { version = "1.0.9", features = ["sol-types", "json-rpc"] }
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ execSync("npm run build-wasm");

// generate node/web bindgens
execSync(
`wasm-bindgen --target nodejs ./target/wasm32-unknown-unknown/release/rain_math_float.wasm --out-dir ./temp/node --out-name float`
`wasm-bindgen --target nodejs ./target/wasm32-unknown-unknown/release/rain_math_float_wasm.wasm --out-dir ./temp/node --out-name float`
);
execSync(
`wasm-bindgen --target web ./target/wasm32-unknown-unknown/release/rain_math_float.wasm --out-dir ./temp/web --out-name float`
`wasm-bindgen --target web ./target/wasm32-unknown-unknown/release/rain_math_float_wasm.wasm --out-dir ./temp/web --out-name float`
);

// encode wasm as base64 into a json for cjs and esm that can be natively imported
Expand Down
Loading