Skip to content

Commit

Permalink
feat: cargo watch for wasm build
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
  • Loading branch information
elpiel committed Jan 30, 2024
1 parent 58fb818 commit 5477be7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


[alias]
# Requires cargo-watch
watch-wasm = ["watch", "--shell", "./scripts/build.sh --dev"]
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bridge between [stremio-core](https://github.com/stremio/stremio-core) and [stre

Builds a production wasm package and prepares the rest of the dependencies for the npm package.

```
```bash
npm install
npm run build
```
Expand All @@ -18,10 +18,19 @@ npm run build

Building the package using [`./scripts/build.sh`](./scripts/build.sh) with `--dev` would allow you to see more logging messages being emitted, this is intended **only** for debugging as it will log messages with sensitive information!

```
```bash
./scripts/build.sh --dev
```

Or you can also use the development-specific Rust's `wasm-watch` alias from [`./.cargo/config.toml`](./.cargo/config.toml).
It will automatically re-compile the package when a change on the files or dependencies is detected,
including when you're using a local patch for `stremio-core`.

1. Install `cargo-watch`
- `cargo install cargo-watch`
- With `cargo-binstall` (prebuilt binaries): `cargo binstall cargo-watch`
2. Run `cargo wasm-watch`

## Publishing

1. Update version to the next minor/major/patch version in Cargo (`Cargo.toml` and `Cargo.lock`) and npm (`package.json` and `package-lock.json`), e.g. from `0.44.13` to `0.44.14`.
Expand Down

0 comments on commit 5477be7

Please sign in to comment.