-
Notifications
You must be signed in to change notification settings - Fork 13
feat: add webui-wasm crate #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f276d62
feat: add webui-wasm crate for WebAssembly playground
mohamedmansour e417535
fix: always run WASM build job in PR checks
mohamedmansour e13005d
Potential fix for code scanning alert no. 7: Workflow does not contai…
mohamedmansour 77b4e76
fix: install protoc in WASM CI action
mohamedmansour 4063ea3
fix: install wasi-libc in CI for full WASM C stdlib headers
mohamedmansour e115b8a
fix: correct wasi-libc include path for Ubuntu
mohamedmansour 16b75ce
fix: simplify WASM CI — drop llvm/lld/wasi-libc, use system clang
mohamedmansour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: 'Setup and Build WASM' | ||
| description: 'Install WASM toolchain, build webui-wasm, and verify output' | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Setup Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: 1.93 | ||
| targets: wasm32-unknown-unknown | ||
|
|
||
| - name: Rust Cache | ||
| uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Install wasm-pack | ||
| shell: bash | ||
| run: cargo install wasm-pack | ||
|
|
||
| - name: Install LLVM | ||
| shell: bash | ||
| run: sudo apt-get update && sudo apt-get install -y clang llvm lld | ||
|
|
||
| - name: Setup WASM headers | ||
| shell: bash | ||
| run: | | ||
| cargo fetch | ||
| WASM_HEADERS=$(find $HOME/.cargo/registry/src -path "*/tree-sitter-language-*/wasm/include" -type d | head -1) | ||
| if [ -n "$WASM_HEADERS" ]; then | ||
| echo "WASI_INCLUDE=$WASM_HEADERS" >> $GITHUB_ENV | ||
| else | ||
| echo "::error::Could not find tree-sitter-language WASM headers" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Build WASM | ||
| shell: bash | ||
| run: cargo xtask build-wasm | ||
|
|
||
| - name: Verify WASM output | ||
| shell: bash | ||
| run: | | ||
| test -f docs/public/wasm/webui_wasm_bg.wasm | ||
| test -f docs/public/wasm/webui_wasm.js | ||
| ! grep -q "from 'env'" docs/public/wasm/webui_wasm.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [package] | ||
| name = "webui-wasm" | ||
| description = "WebAssembly bindings for WebUI framework — powers the online playground" | ||
| version.workspace = true | ||
| edition.workspace = true | ||
| authors.workspace = true | ||
| license.workspace = true | ||
| repository.workspace = true | ||
|
|
||
| [package.metadata.wasm-pack.profile.release] | ||
| wasm-opt = false | ||
|
|
||
| [lib] | ||
| crate-type = ["cdylib", "rlib"] | ||
|
|
||
| [dependencies] | ||
| webui-parser = { path = "../webui-parser", default-features = false } | ||
| webui-handler = { path = "../webui-handler" } | ||
| webui-protocol = { path = "../webui-protocol" } | ||
| serde = { workspace = true } | ||
| serde_json = { workspace = true } | ||
| wasm-bindgen = { workspace = true } | ||
| serde-wasm-bindgen = { workspace = true } | ||
|
|
||
| [dev-dependencies] | ||
| webui-test-utils = { path = "../webui-test-utils" } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.