Skip to content

Commit 6b8d3d6

Browse files
authored
Merge pull request #207 from bytecodealliance/ydnar/tidy
wit/bindgen: tidy up .wasm.go file generation
2 parents 97b5531 + a155863 commit 6b8d3d6

3 files changed

Lines changed: 76 additions & 64 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
77
### Added
88

99
- Go [type aliases](https://go.dev/ref/spec#Alias_declarations) are now generated for each WIT type alias (`type foo = bar`). Deep chains of type aliases (`type b = a; type c = b;`) are fully supported. Generated documentation now reflects whether a type is an alias. Fixes [#204](https://github.com/bytecodealliance/wasm-tools-go/issues/204).
10+
- `go:wasmimport` and `go:wasmexport` functions are now generated in a separate `.wasm.go` file. This helps enable testing or use of generated packages outside of WebAssembly.
1011
- `wit-bindgen-go wit` now accepts a `--world` argument in the form of `imports`, `wasi:clocks/imports`, or `wasi:clocks/imports@0.2.0`. This filters the serialized WIT to a specific world and interfaces it references. This can be used to generate focused WIT for a specific world with a minimal set of dependencies.
1112

1213
### Changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,12 @@ $(wit_files):
1212
.PHONY: golden
1313
golden: json
1414
go test ./wit -update
15+
16+
# generated writes test Go code to the filesystem
17+
.PHONY: generated
18+
generated: clean
19+
go test ./wit/bindgen -write
20+
21+
.PHONY: clean
22+
clean:
23+
rm -rf ./generated/*

0 commit comments

Comments
 (0)