Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed Sep 4, 2024
1 parent c9c4d20 commit fe61832
Show file tree
Hide file tree
Showing 29 changed files with 11,059 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ members = [
"stageleft_tool",
"topolotree",
"variadics",
"wasm_test_site",
"website_playground",
]

Expand Down
2 changes: 2 additions & 0 deletions docs/src/pages/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ if (siteConfig.customFields.LOAD_PLAYGROUND === '1') {
}

playgroundJS.init();

window.test_hydroflow = playgroundJS.test_hydroflow;
}

import mermaid from "mermaid";
Expand Down
8 changes: 8 additions & 0 deletions wasm_test_site/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "08:00"
open-pull-requests-limit: 10
1 change: 1 addition & 0 deletions wasm_test_site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added wasm_test_site/.parcel-cache/data.mdb
Binary file not shown.
Binary file added wasm_test_site/.parcel-cache/lock.mdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
5,911 changes: 5,911 additions & 0 deletions wasm_test_site/.parcel-cache/snapshot-1a5219bd20d19bce.txt

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions wasm_test_site/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "wasm_test_site"
version = "0.1.0"
edition = "2021"

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

[dependencies]
wasm-bindgen = "0.2.84"

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.7", optional = true }

[dev-dependencies]
wasm-bindgen-test = "0.3.43"

[profile.release]
# Tell `rustc` to optimize for small code size.
opt-level = "s"
84 changes: 84 additions & 0 deletions wasm_test_site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<div align="center">

<h1><code>wasm-pack-template</code></h1>

<strong>A template for kick starting a Rust and WebAssembly project using <a href="https://github.com/rustwasm/wasm-pack">wasm-pack</a>.</strong>

<p>
<a href="https://travis-ci.org/rustwasm/wasm-pack-template"><img src="https://img.shields.io/travis/rustwasm/wasm-pack-template.svg?style=flat-square" alt="Build Status" /></a>
</p>

<h3>
<a href="https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html">Tutorial</a>
<span> | </span>
<a href="https://discordapp.com/channels/442252698964721669/443151097398296587">Chat</a>
</h3>

<sub>Built with πŸ¦€πŸ•Έ by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub>
</div>

## About

[**πŸ“š Read this template tutorial! πŸ“š**][template-docs]

This template is designed for compiling Rust libraries into WebAssembly and
publishing the resulting package to NPM.

Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other
templates and usages of `wasm-pack`.

[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html
[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html

## 🚴 Usage

### πŸ‘ Use `cargo generate` to Clone this Template

[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate)

```
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
```

### πŸ› οΈ Build with `wasm-pack build`

```
wasm-pack build
```

### πŸ”¬ Test in Headless Browsers with `wasm-pack test`

```
wasm-pack test --headless --firefox
```

### 🎁 Publish to NPM with `wasm-pack publish`

```
wasm-pack publish
```

## πŸ”‹ Batteries Included

* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating
between WebAssembly and JavaScript.
* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook)
for logging panic messages to the developer console.
* `LICENSE-APACHE` and `LICENSE-MIT`: most Rust projects are licensed this way, so these are included for you

## License

Licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.
Loading

0 comments on commit fe61832

Please sign in to comment.