Skip to content

Commit f121bfc

Browse files
committed
Added WebAssembly support, including minimizing some assets to reduce binary size. Updated dependencies and build scripts.
1 parent db6a9c8 commit f121bfc

File tree

18 files changed

+1711
-131
lines changed

18 files changed

+1711
-131
lines changed

.cargo/config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[target.wasm32-unknown-unknown]
2+
rustflags = ["-C", "link-arg=-zstack-size=32768", "-C", "target-feature=+simd128"]
3+
4+
[target.wasm32-wasip2]
5+
rustflags = ["-C", "link-arg=-zstack-size=32768", "-C", "target-feature=+simd128"]
6+
runner = "wasmtime"

.github/workflows/rust.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
runs-on: ${{ matrix.os }}
2323
steps:
2424
- uses: actions/checkout@v4
25-
- name: Install Rust toolchain
26-
run: rustup toolchain install stable --profile minimal --no-self-update
27-
- name: Get cache
28-
uses: Swatinem/rust-cache@v2
25+
#- name: Install Rust toolchain
26+
# run: rustup toolchain install stable --profile minimal --no-self-update
27+
#- name: Get cache
28+
# uses: Swatinem/rust-cache@v2
2929
- name: Install ALSA on Linux
3030
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
3131
run: sudo apt-get install -y libasound2-dev

Cargo.lock

Lines changed: 71 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ edition = "2021"
55
repository = "https://github.com/jensyt/timesignal"
66

77
[workspace]
8+
members = ["./", "crates/*", "lib/*"]
9+
default-members = ["./", "crates/*"]
810

911
[dependencies]
1012
cpal = "0.15.3"

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Why use this instead of the many other time signal generators available? Three p
1919
supported clock or watch.
2020

2121
## Quick Setup Guide
22+
Try it online [here](https://timesignal.pages.dev/)!
23+
24+
Alternatively, to install the program locally:
2225
1. Install a recent version of [Rust].
2326
- On Linux, you may also need to install the `libasound2-dev` package on Debian-based
2427
distributions or `alsa-lib-devel` on Fedora.
@@ -33,7 +36,7 @@ clock or watch are in reception mode!
3336
As an alternative to step 3 above, you can build and run the program separately:
3437

3538
3. Run `cargo build -r`
36-
4. Run `target/release/timesignal <signal>`
39+
4. Run `./target/release/timesignal <signal>`
3740

3841
## Command Line Options
3942
The general form for running this program is
@@ -94,10 +97,12 @@ timesignal -t "2024-06-03 17:21:05.692 -08:00" wwvb
9497
```
9598

9699
## Modifying the Code
97-
Feel free to modify and add code as you see fit. To build the documentation, run `cargo doc` and
98-
then open `target/doc/timesignal/index.html`. To run unit tests, run `cargo test` or if you have
100+
Feel free to modify and add code as you see fit. To build the documentation, run `just doc` and
101+
then open `target/doc/timesignal/index.html`. To run unit tests, run `just test` or if you have
99102
[cargo-nextest] run `cargo nextest run`.
100103

104+
If you don't have [just], you can open and run the commands from `justfile` manually.
105+
101106
Documentation for the Junghans message format can be found at the top of `src/junghans.rs`.
102107

103108
[DCF77]: https://en.wikipedia.org/wiki/DCF77
@@ -112,3 +117,4 @@ Documentation for the Junghans message format can be found at the top of `src/ju
112117
[TZ string]: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
113118
[cargo-nextest]: https://nexte.st/
114119
[Javascript]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
120+
[just]: https://github.com/casey/just
-448 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)