Skip to content

Commit 92fc9c7

Browse files
authored
Merge pull request #234 from bytecodealliance/bytecodealliance/main
all: global find and replace of wasm-tools-go
2 parents bf4d524 + 49305c8 commit 92fc9c7

File tree

81 files changed

+846
-140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+846
-140
lines changed

CHANGELOG.md

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1111

1212
### Fixed
1313

14-
- [#215](https://github.com/bytecodealliance/wasm-tools-go/issues/215): generate variant accessor methods with the correct scope for Go names.
14+
- [#215](https://github.com/bytecodealliance/go-modules/issues/215): generate variant accessor methods with the correct scope for Go names.
1515

1616
### New Contributors
1717

18-
- [@vados-cosmonic](https://github.com/vados-cosmonic): [#212](https://github.com/bytecodealliance/wasm-tools-go/issues/212) and [#214](https://github.com/bytecodealliance/wasm-tools-go/pull/214) — verbose logging controls in `wit-bindgen-go`.
18+
- [@vados-cosmonic](https://github.com/vados-cosmonic): [#212](https://github.com/bytecodealliance/go-modules/issues/212) and [#214](https://github.com/bytecodealliance/go-modules/pull/214) — verbose logging controls in `wit-bindgen-go`.
1919

2020
## [v0.3.0] — 2024-10-11
2121

2222
### Added
2323

24-
- 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).
24+
- 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/go-modules/issues/204).
2525
- `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.
2626
- `wit-bindgen-go generate` now generates a WIT file for each WIT world in its corresponding Go package directory. For example the `wasi:http/proxy` world would generate `wasi/http/proxy/proxy.wit`.
2727
- `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.
@@ -69,18 +69,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6969
### Added
7070

7171
- Generated structs and structs in package `cm` now include a [`HostLayout` field](https://github.com/golang/go/issues/66408) in order to conform with the [relaxed types proposal](https://github.com/golang/go/issues/66984) for `GOARCH=wasm32`. The `cm.HostLayout` type is an alias for `structs.HostLayout` on Go 1.23 or later, and a polyfill for Go 1.22 or earlier.
72-
- [#163](https://github.com/bytecodealliance/wasm-tools-go/issues/163): added `cm.F32ToU64()` and `cm.U64ToF32()` for flattening `f32` and `u64` types in the Canonical ABI.
72+
- [#163](https://github.com/bytecodealliance/go-modules/issues/163): added `cm.F32ToU64()` and `cm.U64ToF32()` for flattening `f32` and `u64` types in the Canonical ABI.
7373
- Test data from [bytecodealliance/wit-bindgen/tests/codegen](https://github.com/bytecodealliance/wit-bindgen/tree/main/tests/codegen).
7474

7575
### Fixed
7676

77-
- [#159](https://github.com/bytecodealliance/wasm-tools-go/pull/159): correctly escape all WIT keywords, including when used in package names.
78-
- [#160](https://github.com/bytecodealliance/wasm-tools-go/issues/160): fixed the use of Go reserved keywords in function returns as result types.
79-
- [#161](https://github.com/bytecodealliance/wasm-tools-go/issues/161): correctly handle `constructor` as a WIT keyword in wit.
80-
- [#165](https://github.com/bytecodealliance/wasm-tools-go/issues/165): fixed use of imported types in exported functions.
81-
- [#167](https://github.com/bytecodealliance/wasm-tools-go/issues/167): fixed a logic flaw in `TestHasBorrow`.
82-
- [#170](https://github.com/bytecodealliance/wasm-tools-go/issues/170): resolve implied names for interface imports and exports in a world.
83-
- [#175](https://github.com/bytecodealliance/wasm-tools-go/issues/175): generated correct symbol names for imported and exported functions in worlds (`$root`) or interfaces declared inline in worlds.
77+
- [#159](https://github.com/bytecodealliance/go-modules/pull/159): correctly escape all WIT keywords, including when used in package names.
78+
- [#160](https://github.com/bytecodealliance/go-modules/issues/160): fixed the use of Go reserved keywords in function returns as result types.
79+
- [#161](https://github.com/bytecodealliance/go-modules/issues/161): correctly handle `constructor` as a WIT keyword in wit.
80+
- [#165](https://github.com/bytecodealliance/go-modules/issues/165): fixed use of imported types in exported functions.
81+
- [#167](https://github.com/bytecodealliance/go-modules/issues/167): fixed a logic flaw in `TestHasBorrow`.
82+
- [#170](https://github.com/bytecodealliance/go-modules/issues/170): resolve implied names for interface imports and exports in a world.
83+
- [#175](https://github.com/bytecodealliance/go-modules/issues/175): generated correct symbol names for imported and exported functions in worlds (`$root`) or interfaces declared inline in worlds.
8484

8585
## [v0.2.0] — 2024-09-05
8686

@@ -95,7 +95,7 @@ Going forward, please update your Go imports from `github.com/ydnar/wasm-tools-g
9595

9696
### Fixed
9797

98-
- [#151](https://github.com/bytecodealliance/wasm-tools-go/issues/151): backport support for JSON generated by `wasm-tools` prior to v1.209.0, which added `@since` and `@unstable` feature gates.
98+
- [#151](https://github.com/bytecodealliance/go-modules/issues/151): backport support for JSON generated by `wasm-tools` prior to v1.209.0, which added `@since` and `@unstable` feature gates.
9999

100100
## [v0.1.5] — 2024-08-23
101101

@@ -105,7 +105,7 @@ Going forward, please update your Go imports from `github.com/ydnar/wasm-tools-g
105105

106106
### Changed
107107

108-
- Omit the default `//go:build !wasip1` build tags from generated Go files. This enables `wit-bindgen-go` to target `GOOS=wasip1` (fixes [#147](https://github.com/bytecodealliance/wasm-tools-go/issues/147)).
108+
- Omit the default `//go:build !wasip1` build tags from generated Go files. This enables `wit-bindgen-go` to target `GOOS=wasip1` (fixes [#147](https://github.com/bytecodealliance/go-modules/issues/147)).
109109
- Package `wit` now serializes multi-package WIT files with an un-nested “root” package. See [WebAssembly/component-model#380](https://github.com/WebAssembly/component-model/pull/380) and [bytecodealliance/wasm-tools#1700](https://github.com/bytecodealliance/wasm-tools/pull/1700).
110110

111111
## [v0.1.4] — 2024-07-16
@@ -124,12 +124,12 @@ Going forward, please update your Go imports from `github.com/ydnar/wasm-tools-g
124124

125125
### Added
126126

127-
- [#128](https://github.com/bytecodealliance/wasm-tools-go/pull/128): implemented `String` method for `enum` types ([@rajatjindal](https://github.com/rajatjindal)).
127+
- [#128](https://github.com/bytecodealliance/go-modules/pull/128): implemented `String` method for `enum` types ([@rajatjindal](https://github.com/rajatjindal)).
128128

129129
### Fixed
130130

131-
- [#130](https://github.com/bytecodealliance/wasm-tools-go/issues/130): anonymous `tuple` types now correctly have exported Go struct fields.
132-
- [#129](https://github.com/bytecodealliance/wasm-tools-go/issues/129): correctly handle zero-length `tuple` and `record` types, represented as `struct{}`.
131+
- [#130](https://github.com/bytecodealliance/go-modules/issues/130): anonymous `tuple` types now correctly have exported Go struct fields.
132+
- [#129](https://github.com/bytecodealliance/go-modules/issues/129): correctly handle zero-length `tuple` and `record` types, represented as `struct{}`.
133133

134134
## [v0.1.2] — 2024-07-05
135135

@@ -164,7 +164,7 @@ This release changes the memory layout of `variant` and `result` types to permit
164164

165165
### Fixed
166166

167-
- [#95](https://github.com/bytecodealliance/wasm-tools-go/issues/95): `wit-bindgen-go` now correctly generates packed `data` shape types for `variant` and `result` types.
167+
- [#95](https://github.com/bytecodealliance/go-modules/issues/95): `wit-bindgen-go` now correctly generates packed `data` shape types for `variant` and `result` types.
168168
- Fixed swapped `Shape` and `Align` type parameters in the functions `cm.New` and `cm.Case` for manipulating `variant` types.
169169
- Variant validation now correctly reports `variant` instead of `result` in panic messages.
170170

@@ -174,23 +174,22 @@ Initial version, supporting [TinyGo](https://tinygo.org/) + [WASI](https://wasi.
174174

175175
### Known Issues
176176

177-
- [#95](https://github.com/bytecodealliance/wasm-tools-go/issues/95): `variant` and `result` types without fully-packed `data` shape types will not correctly represent all associated types.
178-
- [#111](https://github.com/bytecodealliance/wasm-tools-go/issues/111): `flags` types with > 32 labels are not correctly supported. See [component-model#370](https://github.com/WebAssembly/component-model/issues/370) and [wasm-tools#1635](https://github.com/bytecodealliance/wasm-tools/pull/1635) for more information.
179-
- [#118](https://github.com/bytecodealliance/wasm-tools-go/issues/118): Canonial ABI [post-return](https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md#canon-lift) functions to clean up allocations are not currently generated.
177+
- [#95](https://github.com/bytecodealliance/go-modules/issues/95): `variant` and `result` types without fully-packed `data` shape types will not correctly represent all associated types.
178+
- [#111](https://github.com/bytecodealliance/go-modules/issues/111): `flags` types with > 32 labels are not correctly supported. See [component-model#370](https://github.com/WebAssembly/component-model/issues/370) and [wasm-tools#1635](https://github.com/bytecodealliance/wasm-tools/pull/1635) for more information.
179+
- [#118](https://github.com/bytecodealliance/go-modules/issues/118): Canonial ABI [post-return](https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md#canon-lift) functions to clean up allocations are not currently generated.
180180
- Because Go does not have a native tagged union type, pointers represented in `variant` and `result` types may not be visible to the garbage collector and may be freed while still in use.
181181
- Support for mainline [Go](https://go.dev/).
182182

183-
[Unreleased]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.3.1..HEAD>
184-
[v0.3.1]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.3.0..v0.3.1>
185-
[v0.3.0]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.2.4..v0.3.0>
186-
[v0.2.4]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.2.3..v0.2.4>
187-
[v0.2.3]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.2.2..v0.2.3>
188-
[v0.2.2]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.2.1..v0.2.2>
189-
[v0.2.1]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.2.0...v0.2.1>
190-
[v0.2.0]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.1.5...v0.2.0>
191-
[v0.1.5]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.1.4...v0.1.5>
192-
[v0.1.4]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.1.3...v0.1.4>
193-
[v0.1.3]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.1.2...v0.1.3>
194-
[v0.1.2]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.1.1...v0.1.2>
195-
[v0.1.1]: <https://github.com/bytecodealliance/wasm-tools-go/compare/v0.1.0...v0.1.1>
196-
[v0.1.0]: <https://github.com/bytecodealliance/wasm-tools-go/tree/v0.1.0>
183+
[v0.3.1]: <https://github.com/bytecodealliance/go-modules/compare/v0.3.0..v0.3.1>
184+
[v0.3.0]: <https://github.com/bytecodealliance/go-modules/compare/v0.2.4..v0.3.0>
185+
[v0.2.4]: <https://github.com/bytecodealliance/go-modules/compare/v0.2.3..v0.2.4>
186+
[v0.2.3]: <https://github.com/bytecodealliance/go-modules/compare/v0.2.2..v0.2.3>
187+
[v0.2.2]: <https://github.com/bytecodealliance/go-modules/compare/v0.2.1..v0.2.2>
188+
[v0.2.1]: <https://github.com/bytecodealliance/go-modules/compare/v0.2.0...v0.2.1>
189+
[v0.2.0]: <https://github.com/bytecodealliance/go-modules/compare/v0.1.5...v0.2.0>
190+
[v0.1.5]: <https://github.com/bytecodealliance/go-modules/compare/v0.1.4...v0.1.5>
191+
[v0.1.4]: <https://github.com/bytecodealliance/go-modules/compare/v0.1.3...v0.1.4>
192+
[v0.1.3]: <https://github.com/bytecodealliance/go-modules/compare/v0.1.2...v0.1.3>
193+
[v0.1.2]: <https://github.com/bytecodealliance/go-modules/compare/v0.1.1...v0.1.2>
194+
[v0.1.1]: <https://github.com/bytecodealliance/go-modules/compare/v0.1.0...v0.1.1>
195+
[v0.1.0]: <https://github.com/bytecodealliance/go-modules/tree/v0.1.0>

DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Similarly, a function is exported for each resource method (e.g. `drink` and `sp
4040

4141
### Post-Return
4242

43-
**Note: as of v0.1.0, this package does not support post-return functions.** See [#118](https://github.com/bytecodealliance/wasm-tools-go/issues/118) for more information.
43+
**Note: as of v0.1.0, this package does not support post-return functions.** See [#118](https://github.com/bytecodealliance/go-modules/issues/118) for more information.
4444

4545
For each exported function that returns allocated memory, there is a [post-return](https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md#canon-lift) function called by the Canonical ABI machinery to allow the component to free the allocation(s).
4646

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wasm-tools-go
22

3-
[![build status](https://img.shields.io/github/actions/workflow/status/bytecodealliance/wasm-tools-go/test.yaml?branch=main)](https://github.com/bytecodealliance/wasm-tools-go/actions)
3+
[![build status](https://img.shields.io/github/actions/workflow/status/bytecodealliance/wasm-tools-go/test.yaml?branch=main)](https://github.com/bytecodealliance/go-modules/actions)
44
[![pkg.go.dev](https://img.shields.io/badge/docs-pkg.go.dev-blue.svg)](https://pkg.go.dev/github.com/bytecodealliance/wasm-tools-go)
55

66
## [WebAssembly](https://webassembly.org) + [WASI](https://wasi.dev) tools for [Go](https://go.dev)

cm/debug_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strings"
66
"unsafe"
77

8-
"github.com/bytecodealliance/wasm-tools-go/internal/tinyunsafe"
8+
"go.bytecodealliance.org/internal/tinyunsafe"
99
)
1010

1111
func typeName(v any) string {

cm/hostlayout_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
"unsafe"
77

8-
"github.com/bytecodealliance/wasm-tools-go/internal/tinyunsafe"
8+
"go.bytecodealliance.org/internal/tinyunsafe"
99
)
1010

1111
func TestFieldAlignment(t *testing.T) {

cmd/wit-bindgen-go/cmd/generate/generate.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"path/filepath"
88
"strings"
99

10-
"github.com/bytecodealliance/wasm-tools-go/internal/codec"
11-
"github.com/bytecodealliance/wasm-tools-go/internal/go/gen"
12-
"github.com/bytecodealliance/wasm-tools-go/internal/witcli"
13-
"github.com/bytecodealliance/wasm-tools-go/wit/bindgen"
14-
"github.com/bytecodealliance/wasm-tools-go/wit/logging"
10+
"go.bytecodealliance.org/internal/codec"
11+
"go.bytecodealliance.org/internal/go/gen"
12+
"go.bytecodealliance.org/internal/witcli"
13+
"go.bytecodealliance.org/wit/bindgen"
14+
"go.bytecodealliance.org/wit/logging"
1515
"github.com/urfave/cli/v3"
1616
)
1717

@@ -51,7 +51,7 @@ var Command = &cli.Command{
5151
Value: "",
5252
OnlyOnce: true,
5353
Config: cli.StringConfig{TrimSpace: true},
54-
Usage: "Import path for the Component Model utility package, e.g. github.com/bytecodealliance/wasm-tools-go/cm",
54+
Usage: "Import path for the Component Model utility package, e.g. go.bytecodealliance.org/cm",
5555
},
5656
&cli.BoolFlag{
5757
Name: "versioned",

cmd/wit-bindgen-go/cmd/wit/wit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/bytecodealliance/wasm-tools-go/internal/witcli"
8-
"github.com/bytecodealliance/wasm-tools-go/wit"
7+
"go.bytecodealliance.org/internal/witcli"
8+
"go.bytecodealliance.org/wit"
99
"github.com/urfave/cli/v3"
1010
)
1111

cmd/wit-bindgen-go/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77

88
"github.com/urfave/cli/v3"
99

10-
"github.com/bytecodealliance/wasm-tools-go/cmd/wit-bindgen-go/cmd/generate"
11-
"github.com/bytecodealliance/wasm-tools-go/cmd/wit-bindgen-go/cmd/wit"
12-
"github.com/bytecodealliance/wasm-tools-go/internal/witcli"
10+
"go.bytecodealliance.org/cmd/wit-bindgen-go/cmd/generate"
11+
"go.bytecodealliance.org/cmd/wit-bindgen-go/cmd/wit"
12+
"go.bytecodealliance.org/internal/witcli"
1313
)
1414

1515
func main() {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/bytecodealliance/wasm-tools-go
1+
module go.bytecodealliance.org
22

33
go 1.22.0
44

internal/codec/json/decoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"io"
77

8-
"github.com/bytecodealliance/wasm-tools-go/internal/codec"
8+
"go.bytecodealliance.org/internal/codec"
99
)
1010

1111
type Decoder struct {

0 commit comments

Comments
 (0)