Skip to content

Commit 955b649

Browse files
committed
save
1 parent 2e202c6 commit 955b649

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

Makefile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,27 @@ setup:
1414
rustup target add wasm32-unknown-unknown
1515
command -v cargo-binstall || curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
1616
command -v cargo-component || cargo binstall cargo-component -y
17-
if ! command -v node; then \
18-
if [ "$$OS" = "Windows_NT" ]; then \
19-
curl -sS https://webi.sh/node | sh; \
20-
else \
21-
curl.exe https://webi.ms/node | powershell; \
22-
fi \
23-
fi
17+
command -v node || { echo 'Please install Node.js manually'; exit 1; }
2418
command -v jco || npm install -g @bytecodealliance/jco
2519
command -v deno || curl -fsSL https://deno.land/install.sh | sh
2620
command -v bun || curl -fsSL https://bun.sh/install | bash
21+
command -v python3 || { echo 'Please install Python manually'; exit 1; }
2722
command -v wit-bindgen || cargo binstall --git https://github.com/bytecodealliance/wit-bindgen wit-bindgen-cli -y
2823
command -v static-web-server || cargo binstall static-web-server -y
2924
command -v wasm-tools || cargo binstall wasm-tools -y
3025

3126
test-js:
32-
cd tests/js; \
27+
set -e; cd tests/js; \
3328
[ -d node_modules ] || npm install; \
3429
npm run build; \
3530
npm test
3631

3732
test-rs:
3833
# https://github.com/bytecodealliance/wasmtime/issues/7784
39-
# cargo test -p tests-rs
34+
cargo test -p tests-rs || true
4035

4136
test-py:
42-
cd tests/py; \
37+
set -e; cd tests/py; \
4338
[ -d .venv ] || $(MAKE) venv; \
4439
$(MAKE) fetch; \
4540
$(MAKE) build; \
@@ -48,7 +43,7 @@ test-py:
4843
test: test-js test-rs test-py
4944

5045
publish:
51-
version=$$(cargo pkgid | cut -d'#' -f2 | cut -d'@' -f2); \
46+
set -e; version=$$(cargo pkgid | cut -d'#' -f2 | cut -d'@' -f2); \
5247
echo -n | gh release create \
5348
"v$$version" \
5449
--generate-notes \

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
# unicode-math-class for WebAssembly
22

3-
🦀
3+
🦀 [unicode-math-class] Rust crate compiled to a [WebAssembly component]
44

5-
🟪 Compiles [unicode-math-class] to a WebAssembly component \
6-
🏷️ Uses [unicode-math-class] v0.1.0
5+
<p align=center>
6+
7+
</p>
8+
9+
🏷️ Uses [unicode-math-class] v0.1.0 \
10+
🟪 Distributed as WebAssembly to run anywhere \
11+
🤝 Composes well with other WebAssembly components
12+
13+
**👀 You might be looking for the [JavaScript bindings] or the [Python
14+
bindings].**
715

816
## Usage
917

1018
![WebAssembly](https://img.shields.io/static/v1?style=for-the-badge&message=WebAssembly&color=654FF0&logo=WebAssembly&logoColor=FFFFFF&label=)
1119

12-
🛑 You might be interested in the premade bindings for [JavaScript].
13-
14-
You can also download the [unicode-math-class.wasm] WebAssembly component file
15-
from [this repository's GitHub releases page]. To actually _use_ the WebAssembly
20+
You can download the [unicode-math-class.wasm] WebAssembly component file from
21+
[this repository's GitHub releases page]. To actually _use_ the WebAssembly
1622
component, you'll need to use a [WebAssembly component host runtime].
1723

1824
[![Download](https://img.shields.io/static/v1?style=for-the-badge&message=Download&color=24A47F&logo=GitHub&logoColor=FFFFFF&label=)]()
@@ -40,4 +46,6 @@ using it in JavaScript and Rust. Use `make build-docs` to build the docs. Run
4046

4147
<!-- prettier-ignore-start -->
4248
[the `make publish` workflow]: https://github.com/jcbhmr/unicode-math-class.wasm/actions/workflows/make-publish.yml
49+
[unicode-math-class]: https://crates.io/crates/unicode-math-class
50+
4351
<!-- prettier-ignore-end -->

tests/py/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
PYTHON := python3.12
1+
PYTHON := python3
22
WORLD := unicode-math-class
33

44
.PHONY: build
55
build:
6-
. .venv/bin/activate; \
6+
set -e; . .venv/bin/activate; \
77
python -m wasmtime.bindgen \
88
../../target/wasm32-unknown-unknown/$(if $(RELEASE),release,debug)/$(WORLD).wasm \
99
--out-dir build
1010

1111
fetch:
12-
. .venv/bin/activate; \
12+
set -e; . .venv/bin/activate; \
1313
python -m pip install -r requirements.txt
1414

1515
venv:
@@ -22,5 +22,5 @@ shell:
2222
exec bash -c 'exec bash --rcfile <(echo ". ~/.bashrc; . .venv/bin/activate")'
2323

2424
test:
25-
. .venv/bin/activate; \
25+
set -e; . .venv/bin/activate; \
2626
python -m unittest

0 commit comments

Comments
 (0)