Skip to content

Commit

Permalink
add wasm component (#1073)
Browse files Browse the repository at this point in the history
- This is the WIT bindings on the Rust side. Will follow up with another
PR for the TypeScript side.
- A couple of APIs were disabled with `TODO` comments due to circular
references. Will re-enable after re-organizing the modules.
  • Loading branch information
OmarTawfik committed Aug 15, 2024
1 parent e8dc494 commit 0210156
Show file tree
Hide file tree
Showing 108 changed files with 4,521 additions and 235 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
},
"customizations": {
"vscode": {
// Keep extensions list in-sync with "$REPO_ROOT/.vscode/extensions.json"
// __SLANG_VSCODE_EXTENSIONS_RECOMMENDATIONS__ (keep in sync)
"extensions": [
// Language Support
"dtsvet.vscode-wasm",
"igochkov.vscode-ebnf",
"NomicFoundation.hardhat-solidity",
"redhat.vscode-yaml",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
// Keep recommendations list in-sync with "$REPO_ROOT/.devcontainer/devcontainer.json"
// __SLANG_VSCODE_EXTENSIONS_RECOMMENDATIONS__ (keep in sync)
"recommendations": [
// Language Support
"dtsvet.vscode-wasm",
"igochkov.vscode-ebnf",
"NomicFoundation.hardhat-solidity",
"redhat.vscode-yaml",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"editor.rulers": [120],
"files.associations": {
"**/documentation/overrides/**/*.html": "jinja-html",
"*.ts.jinja2": "jinja-js" // until this is merged: https://github.com/samuelcolvin/jinjahtml-vscode/pull/148
"*.ts.jinja2": "jinja-js", // until 'jinja-ts' is released: https://github.com/samuelcolvin/jinjahtml-vscode/pull/148
"*.wit.jinja2": "wai"
},
"editor.unicodeHighlight.allowedCharacters": {
"꞉": true // used in CST snapshot tests
Expand Down
187 changes: 187 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ napi-derive = { version = "2.16.10" }
nom = { version = "7.1.3" }
num-format = { version = "0.4.4" }
once_cell = { version = "1.19.0" }
paste = { version = "1.0.15" }
proc-macro2 = { version = "1.0.86" }
quote = { version = "1.0.36" }
rayon = { version = "1.10.0" }
Expand Down Expand Up @@ -149,6 +150,7 @@ thiserror = { version = "1.0.63" }
toml = { version = "0.8.19" }
trybuild = { version = "1.0.99" }
url = { version = "2.4.1", features = ["serde"] }
wit-bindgen = { version = "0.30.0" }

[workspace.lints.rust]
unused_crate_dependencies = "warn"
Expand Down
3 changes: 3 additions & 0 deletions crates/codegen/runtime/cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ default = ["cli"]
cli = ["dep:ariadne", "dep:clap", "dep:serde_json"]
__experimental_bindings_api = ["dep:metaslang_bindings"]
__private_testing_utils = ["dep:ariadne"]
__private_wit_bindings = ["dep:paste", "dep:wit-bindgen"]

[build-dependencies]
anyhow = { workspace = true }
Expand All @@ -23,12 +24,14 @@ ariadne = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
metaslang_bindings = { workspace = true, optional = true }
metaslang_cst = { workspace = true }
paste = { workspace = true, optional = true }
semver = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
strum = { workspace = true }
strum_macros = { workspace = true }
thiserror = { workspace = true }
wit-bindgen = { workspace = true, optional = true }

[lints]
workspace = true

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

Loading

0 comments on commit 0210156

Please sign in to comment.