File tree Expand file tree Collapse file tree 5 files changed +325
-334
lines changed
Expand file tree Collapse file tree 5 files changed +325
-334
lines changed Original file line number Diff line number Diff line change 1+ build : sqldef.wasm
2+ .PHONY : build
3+
14sqldef.wasm : go.mod go.sum sqldef-wasm.go wasm_exec.js
2- GOOS=js GOARCH=wasm go build $( GOFLAGS ) -o sqldef.wasm ./sqldef-wasm.go
5+ tinygo build -x -o sqldef.wasm -target= wasm ./sqldef-wasm.go
36
47wasm_exec.js :
5- cp $$(go env GOROOT ) /lib/wasm /wasm_exec.js .
8+ cp $$(tinygo env TINYGOROOT ) /targets /wasm_exec.js .
69
710dev : sqldef.wasm
811 @echo " Starting HTTP server at http://localhost:6543"
Original file line number Diff line number Diff line change @@ -14,9 +14,19 @@ The Go source (`sqldef-wasm.go`) compiles to WebAssembly and exposes a `diff` fu
1414
1515## Development
1616
17+ ### Prerequisites
18+
19+ Install [ TinyGo] ( https://tinygo.org/ ) :
20+
21+ ``` sh
22+ brew tap tinygo-org/tools && brew install tinygo
23+ ```
24+
25+ ### Build
26+
1727``` sh
1828# Build the WASM file
19- make
29+ make build
2030
2131# Start local dev server at http://localhost:6543
2232make dev
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ func main() {
7474 c := make (chan bool )
7575
7676 exports := map [string ]any {
77- "diff" : js .FuncOf (sqldefDiff ),
77+ "diff" : js .FuncOf (sqldefDiff ),
7878 "getFullVersion" : js .FuncOf (sqldefGetFullVersion ),
7979 }
8080 js .Global ().Set ("_SQLDEF" , js .ValueOf (exports ))
You can’t perform that action at this time.
0 commit comments