Skip to content
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3bf1e70
Scala.js binding generator, work in progress
vigoo Jan 23, 2025
9d261a8
Scala.js binding generator, work in progress
vigoo Jan 29, 2025
0481643
Scala.js binding generator, work in progress
vigoo Jan 30, 2025
996a9b4
Scala.js binding generator, work in progress
vigoo Feb 1, 2025
d74996b
Scala.js binding generator, work in progress
vigoo Feb 1, 2025
e9744a4
Scala.js binding generator, work in progress
vigoo Feb 1, 2025
10f48c9
Scala.js binding generator, work in progress
vigoo Feb 1, 2025
b36297d
Scala.js binding generator, work in progress
vigoo Feb 1, 2025
68aada8
Scala.js binding generator, work in progress
vigoo Feb 2, 2025
8b7f6fc
Scala.js binding generator, work in progress
vigoo Feb 4, 2025
170bb19
World exports
vigoo Feb 6, 2025
e58fca0
Restructuring
vigoo Feb 6, 2025
2897791
Scala.js binding generator, feature complete
vigoo Feb 6, 2025
7048c1f
Fix clap attributes
vigoo Feb 7, 2025
15940f7
Fixed export name
vigoo Feb 7, 2025
c29093b
Fixes
vigoo Feb 8, 2025
9c16e8f
Uint8Array
vigoo Feb 9, 2025
e01bdf7
Result return types are exceptions
vigoo Feb 19, 2025
8e7a2e1
Generate top-level class exports for resources, with prefixed names
vigoo Feb 23, 2025
d9c42f1
Remove resource constructors from interface base traits
vigoo Feb 23, 2025
8117ffa
Format and CI fixes
vigoo Feb 23, 2025
3253e54
Fix typo
vigoo Feb 23, 2025
86d8ba2
No need for setup-scala
vigoo Feb 23, 2025
5b1979e
setup-scala is needed, but does not work on Windows
vigoo Feb 23, 2025
01b6e37
CI fix
vigoo Feb 23, 2025
8fd55a2
CI fix
vigoo Feb 23, 2025
f30fdae
Merge pull request #1 from vigoo/scalajs
vigoo Feb 23, 2025
cb8ad56
Disable ScalaJS tests on MacOS too for CI
vigoo Feb 25, 2025
7a923cb
Reenabled all features
vigoo Feb 25, 2025
8c1aec0
Undo readme change
vigoo Feb 25, 2025
b0c7f84
Undo executable name
vigoo Feb 25, 2025
0488de5
No runtime scalajs tests yet
vigoo Feb 25, 2025
5998e3a
Undo Cargo.toml change
vigoo Feb 25, 2025
9011a55
Merge remote-tracking branch 'upstream/main' into upstream-scalajs
vigoo Feb 25, 2025
f3bc801
Fix after updating to latest wit-parser
vigoo Feb 25, 2025
c82af1e
Update crates/scalajs/Cargo.toml
vigoo Feb 26, 2025
178be86
Using js.TupleN and up-to-date github action steps
vigoo Feb 27, 2025
809bac7
Renamed to scalajs-jco
vigoo Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# moonbit removed from language matrix for now - causing CI failures
lang: [c, rust, teavm-java, go, csharp]
lang: [c, rust, teavm-java, go, csharp, scalajs]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -112,12 +112,16 @@ jobs:
with:
tinygo-version: 0.31.0

- uses: olafurpg/setup-scala@v11
if: matrix.lang == 'scalajs'

- run: |
cargo test \
-p wit-bindgen-cli \
-p wit-bindgen-${{ matrix.lang }} \
--no-default-features \
--features ${{ matrix.lang }}
if: ${{ (! (matrix.os == 'windows-latest' && matrix.lang == 'scalajs')) && (! (matrix.os == 'macos-latest' && matrix.lang == 'scalajs')) }} # setup-scala does not make sbt available on Windows, and the scalajs tests are very slow on macos

test_unit:
name: Crate Unit Tests
Expand Down Expand Up @@ -161,6 +165,7 @@ jobs:
- run: cargo build --no-default-features --features csharp
- run: cargo build --no-default-features --features markdown
- run: cargo build --no-default-features --features moonbit
- run: cargo build --no-default-features --features scalajs

# Feature combos of the `wit-bindgen` crate
- run: cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features
Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ wit-bindgen-go = { path = 'crates/go', version = '0.39.0' }
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.39.0' }
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.39.0' }
wit-bindgen-moonbit = { path = 'crates/moonbit', version = '0.39.0' }
wit-bindgen-scalajs = { path = 'crates/scalajs', version = '0.39.0' }
wit-bindgen = { path = 'crates/guest-rust', version = '0.39.0', default-features = false }

[[bin]]
Expand All @@ -63,6 +64,7 @@ wit-bindgen-moonbit = { workspace = true, features = ['clap'], optional = true }
wit-bindgen-teavm-java = { workspace = true, features = ['clap'], optional = true }
wit-bindgen-go = { workspace = true, features = ['clap'], optional = true }
wit-bindgen-csharp = { workspace = true, features = ['clap'], optional = true }
wit-bindgen-scalajs = { workspace = true, features = ['clap'], optional = true }
wit-component = { workspace = true }
wasm-encoder = { workspace = true }

Expand All @@ -75,6 +77,7 @@ default = [
'go',
'csharp',
'moonbit',
'scalajs',
'async',
]
c = ['dep:wit-bindgen-c']
Expand All @@ -85,6 +88,7 @@ go = ['dep:wit-bindgen-go']
csharp = ['dep:wit-bindgen-csharp']
csharp-mono = ['csharp']
moonbit = ['dep:wit-bindgen-moonbit']
scalajs = ['dep:wit-bindgen-scalajs']
async = []

[dev-dependencies]
Expand Down
21 changes: 21 additions & 0 deletions crates/scalajs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "wit-bindgen-scalajs"
authors = ["Daniel Vigovszky <[email protected]>"]
version = { workspace = true }
edition = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
homepage = 'https://github.com/bytecodealliance/wit-bindgen'
description = """
Scala.JS bindings generator for WIT and the component model, typically used
through the `wit-bindgen-cli` crate.
"""

[dependencies]
anyhow = { workspace = true }
wit-bindgen-core = { workspace = true }
heck = { workspace = true }
clap = { workspace = true, optional = true }

[dev-dependencies]
test-helpers = { path = '../test-helpers' }
1 change: 1 addition & 0 deletions crates/scalajs/scala/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version = 1.10.7
7 changes: 7 additions & 0 deletions crates/scalajs/scala/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lazy val root = project
.in(file("."))
.settings(
name := "wit-bindgen-scalajs-test",
scalaVersion := "2.13.16",
)
.enablePlugins(ScalaJSPlugin)
1 change: 1 addition & 0 deletions crates/scalajs/scala/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.2")
Loading
Loading