Skip to content

Commit

Permalink
[LS] Restore WASM build (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink authored Apr 16, 2024
1 parent fe1e785 commit 804d55b
Show file tree
Hide file tree
Showing 6 changed files with 648 additions and 524 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
Expand All @@ -66,6 +68,8 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
Expand All @@ -89,6 +93,8 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/setup-node@v2
with:
node-version: '15'
Expand Down Expand Up @@ -118,6 +124,8 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
Expand All @@ -137,6 +145,8 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
Expand Down
4 changes: 2 additions & 2 deletions languageserver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PATH := $(PATH):$(GOPATH)/bin
.PHONY: build
build:
go build -o ./cmd/languageserver/languageserver ./cmd/languageserver
# TODO: GOARCH=wasm GOOS=js go build -o ./cmd/languageserver/languageserver.wasm ./cmd/languageserver
GOARCH=wasm GOOS=js go build -o ./cmd/languageserver/languageserver.wasm -tags no_cgo ./cmd/languageserver

.PHONY: generate
generate:
Expand All @@ -34,7 +34,7 @@ generate:
go mod tidy

.PHONY: test
test: e2e-test generate unit-test # TODO: wasm-test
test: e2e-test generate unit-test wasm-test

.PHONY: unit-test
unit-test:
Expand Down
3 changes: 2 additions & 1 deletion npm-packages/cadence-language-server/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ module.exports = {
"^.+\\.[tj]s$": "ts-jest"
},
setupFilesAfterEnv: [ './tests/setup.js' ],
testPathIgnorePatterns: ["/node_modules/", "/dist/"]
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
testTimeout: 10000,
};
2 changes: 1 addition & 1 deletion npm-packages/cadence-language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"main": "dist/index.js",
"scripts": {
"build": "tsc && cd ../../languageserver && GOARCH=wasm GOOS=js go build -o ../npm-packages/cadence-language-server/dist/cadence-language-server.wasm ./cmd/languageserver && cd ../npm-packages/cadence-language-server",
"build": "tsc && cd ../../languageserver && GOARCH=wasm GOOS=js go build -o ../npm-packages/cadence-language-server/dist/cadence-language-server.wasm -tags no_cgo ./cmd/languageserver && cd ../npm-packages/cadence-language-server",
"test": "jest"
},
"license": "Apache-2.0",
Expand Down
Loading

0 comments on commit 804d55b

Please sign in to comment.