Skip to content

Commit 7f8639f

Browse files
authored
Version bumps (#17)
1 parent 8aa9afe commit 7f8639f

File tree

9 files changed

+39
-34
lines changed

9 files changed

+39
-34
lines changed

apex.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ generates:
1313
model/msgpack.go:
1414
module: 'jsr:@apexlang/codegen@^0.2.9/go'
1515
visitorClass: MsgPackVisitor
16-
model/wapc.go:
17-
module: 'jsr:@wapc/codegen@^0.1.1/tinygo'
18-
visitorClass: ExportVisitor
19-
cmd/wapc/main.go:
20-
module: 'jsr:@wapc/codegen@^0.1.1/tinygo'
21-
visitorClass: MainVisitor
22-
config:
23-
import: github.com/apexlang/apex-go/model
24-
package: model
16+
# model/wapc.go:
17+
# module: 'jsr:@wapc/codegen@^0.1.1/tinygo'
18+
# visitorClass: ExportVisitor
19+
# cmd/wapc/main.go:
20+
# module: 'jsr:@wapc/codegen@^0.1.1/tinygo'
21+
# visitorClass: MainVisitor
22+
# config:
23+
# import: github.com/apexlang/apex-go/model
24+
# package: model

cmd/host/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/apexlang/apex-go/cmd/host
22

3-
go 1.21
3+
go 1.22.0
44

55
require (
66
github.com/mitchellh/go-homedir v1.1.0
7-
github.com/tetratelabs/wazero v1.6.0
7+
github.com/tetratelabs/wazero v1.9.0
88
)

cmd/host/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
22
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
33
github.com/tetratelabs/wazero v1.6.0 h1:z0H1iikCdP8t+q341xqepY4EWvHEw8Es7tlqiVzlP3g=
44
github.com/tetratelabs/wazero v1.6.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A=
5+
github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I=
6+
github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM=

cmd/host/main.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"crypto/rand"
56
_ "embed"
67
"fmt"
78
"os"
@@ -29,9 +30,6 @@ func main() {
2930
panic(err)
3031
}
3132

32-
config := wazero.NewModuleConfig().
33-
WithStdout(os.Stdout).WithStderr(os.Stderr)
34-
3533
// Create a new WebAssembly Runtime.
3634
r := wazero.NewRuntimeWithConfig(ctx, wazero.NewRuntimeConfig().
3735
WithCoreFeatures(api.CoreFeaturesV2))
@@ -63,6 +61,15 @@ func main() {
6361
}
6462
defer closer.Close(ctx)
6563

64+
config := wazero.NewModuleConfig().
65+
WithStartFunctions("_initialize").
66+
WithStdout(os.Stdout).
67+
WithStderr(os.Stderr).
68+
WithRandSource(rand.Reader).
69+
WithSysNanosleep().
70+
WithSysNanotime().
71+
WithSysWalltime()
72+
6673
code, err := r.CompileModule(ctx, apexWasm)
6774
if err != nil {
6875
panic(err)

cmd/wapc/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
// Code generated by @apexlang/codegen. DO NOT EDIT.
2-
31
package main
42

53
import (
64
"github.com/apexlang/apex-go/model"
5+
"github.com/apexlang/apex-go/wapc"
76
)
87

98
//go:wasmexport wapc_init
109
func Initialize() {
1110
// Create providers
12-
resolverProvider := model.NewResolver()
11+
resolverProvider := wapc.NewResolver()
1312

1413
// Create services
1514
parserService := model.NewParser(resolverProvider)
1615

1716
// Register services
18-
model.RegisterParser(parserService)
17+
wapc.RegisterParser(parserService)
1918
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/apexlang/apex-go
22

3-
go 1.21
3+
go 1.22
44

55
require (
66
github.com/CosmWasm/tinyjson v0.9.0

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
88
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
99
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1010
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
11-
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
12-
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
11+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
12+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1313
github.com/tetratelabs/tinymem v0.1.0 h1:Qza1JAg9lquPPJ/CIei5qQYx7t18KLie83O2WR6CM58=
1414
github.com/tetratelabs/tinymem v0.1.0/go.mod h1:WFFTZFhLod6lTL+UetFAopVbGaB+KFsVcIY+RUv7NeY=
15-
github.com/wapc/tinygo-msgpack v0.1.6 h1:geW3N0MAVehJBZp1ITnK2J1R2woI/S1APJB+tFShO6Y=
16-
github.com/wapc/tinygo-msgpack v0.1.6/go.mod h1:2P4rQimy/6oQAkytwC2LdtVjLJ2D1dYkQHejfCtZXZQ=
1715
github.com/wapc/tinygo-msgpack v0.1.8 h1:KUKeWQ2G/SBVU7EOolTAjFaVWg6oDhAqlD/o1weeyBo=
1816
github.com/wapc/tinygo-msgpack v0.1.8/go.mod h1:u5RU3BuXpvLgefF1DT33saNDgkE9qYeu0PeoE3aGRCs=
1917
github.com/wapc/wapc-guest-tinygo v0.3.3 h1:jLebiwjVSHLGnS+BRabQ6+XOV7oihVWAc05Hf1SbeR0=

go.work

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
go 1.21
1+
go 1.22.0
22

33
use (
4-
.
5-
./cmd/host
4+
.
5+
./cmd/host
66
)

model/wapc.go renamed to wapc/wapc.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
// Code generated by @apexlang/codegen. DO NOT EDIT.
2-
3-
package model
1+
package wapc
42

53
import (
64
"context"
75

8-
"github.com/wapc/tinygo-msgpack"
6+
"github.com/apexlang/apex-go/model"
7+
msgpack "github.com/wapc/tinygo-msgpack"
98
"github.com/wapc/wapc-guest-tinygo"
109
)
1110

@@ -24,7 +23,7 @@ func NewResolver(binding ...string) *ResolverImpl {
2423
}
2524

2625
func (h *ResolverImpl) Resolve(ctx context.Context, location string, from string) (string, error) {
27-
inputArgs := ResolverResolveArgs{
26+
inputArgs := model.ResolverResolveArgs{
2827
Location: location,
2928
From: from,
3029
}
@@ -45,15 +44,15 @@ func (h *ResolverImpl) Resolve(ctx context.Context, location string, from string
4544
return decoder.ReadString()
4645
}
4746

48-
func RegisterParser(svc Parser) {
47+
func RegisterParser(svc model.Parser) {
4948
wapc.RegisterFunction("apexlang.v1.Parser/parse", parserParseWrapper(svc))
5049
}
5150

52-
func parserParseWrapper(svc Parser) wapc.Function {
51+
func parserParseWrapper(svc model.Parser) wapc.Function {
5352
return func(payload []byte) ([]byte, error) {
5453
ctx := context.Background()
5554
decoder := msgpack.NewDecoder(payload)
56-
var inputArgs ParserParseArgs
55+
var inputArgs model.ParserParseArgs
5756
inputArgs.Decode(&decoder)
5857
response, err := svc.Parse(ctx, inputArgs.Source)
5958
if err != nil {

0 commit comments

Comments
 (0)