mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-24 16:34:20 +01:00
Setup emscripten (#782)
This commit is contained in:
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
@@ -79,6 +79,9 @@ jobs:
|
||||
version: "27.2"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
|
||||
- name: Clippy
|
||||
run: make wasm-clippy
|
||||
|
||||
@@ -143,6 +146,9 @@ jobs:
|
||||
version: "27.2"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
|
||||
- name: Cargo build
|
||||
working-directory: lib/wasm
|
||||
run: cargo build --target=wasm32-unknown-unknown
|
||||
@@ -295,6 +301,9 @@ jobs:
|
||||
version: "27.2"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
|
||||
- name: Test WASM
|
||||
run: make wasm-test
|
||||
|
||||
|
||||
@@ -34,7 +34,11 @@ __*[lib/bindings](lib/bindings)*__
|
||||
__*[lib/core](lib/core)*__
|
||||
* [bindings.rs](lib/core/src/bindings.rs) - Update the Rust interface for the Flutter Rust Bridge bindings.
|
||||
|
||||
After making these changes the [Dart](packages/dart), [Flutter](packages/flutter) and [React Native](packages/react-native) bindings code also need to be regenerated and included in your pull request. You can regenerate these from the project root using `make codegen`. Please see the prerequisites for [Flutter](lib/bindings/langs/flutter/README.md) and [React Native](packages/react-native/DEVELOPING.md) if this is your first time generating code.
|
||||
__*[lib/wasm](lib/wasm)*__
|
||||
* [model.rs](lib/wasm/src/model.rs) - Update the structs/enums exported.
|
||||
* [lib.rs](lib/wasm/src/lib.rs) - Update the Rust interface for the WASM bindings.
|
||||
|
||||
After making these changes the [Dart](packages/dart), [Flutter](packages/flutter) and [React Native](packages/react-native) bindings code also need to be regenerated and included in your pull request. You can regenerate these from the project root using `make codegen`. Please see the prerequisites for [Flutter](lib/bindings/langs/flutter/README.md), [React Native](packages/react-native/DEVELOPING.md) and [WASM](lib/wasm/DEVELOPING.md) if this is your first time generating code.
|
||||
|
||||
#### Testing
|
||||
Please adequately test your code using the existing tests and write additional tests for new features. You can run the tests from the project root using `make test`. You can also make use of the [CLI](cli) to test changes while developing your feature.
|
||||
|
||||
10
lib/Cargo.lock
generated
10
lib/Cargo.lock
generated
@@ -5974,6 +5974,16 @@ dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "web-time"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki"
|
||||
version = "0.22.4"
|
||||
|
||||
33
lib/wasm/DEVELOPING.md
Normal file
33
lib/wasm/DEVELOPING.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Building WASM
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To build some dependencies you need to first install [emscripten](https://emscripten.org/docs/getting_started/downloads.html):
|
||||
```bash
|
||||
brew install emscripten
|
||||
```
|
||||
|
||||
On first usage you will need to run:
|
||||
```bash
|
||||
make init
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
```bash
|
||||
make pack
|
||||
```
|
||||
|
||||
This will generate the following artifacts:
|
||||
|
||||
- `pkg/package.json`
|
||||
- `pkg/breez_sdk_liquid_wasm_bg.wasm`
|
||||
- `pkg/breez_sdk_liquid_wasm_bg.d.wasm`
|
||||
- `pkg/breez_sdk_liquid_wasm.d.ts`
|
||||
- `pkg/breez_sdk_liquid_wasm.js`
|
||||
|
||||
## Testing
|
||||
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
Reference in New Issue
Block a user