Skip to content

Commit f8c4490

Browse files
Reworking the playground for go1.19
1 parent 2f8f294 commit f8c4490

File tree

260 files changed

+111020
-1515
lines changed

Some content is hidden

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

260 files changed

+111020
-1515
lines changed

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
playground/go.sum linguist-generated
2+
playground/internal/cmd/precompile/go.sum linguist-generated
3+
4+
**/*.a.js linguist-generated
5+
playground/playground.js linguist-generated
6+
7+
playground/internal/imports/zstdlib.go linguist-generated

.github/workflows/ci.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "*" ]
6+
pull_request:
7+
branches: [ "*" ]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
13+
concurrency:
14+
group: ci-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
GO_VERSION: 1.19.13
19+
NODE_VERSION: 18
20+
GOLANGCI_VERSION: v1.53.3
21+
SOURCE_MAP_SUPPORT: true
22+
GOPATH: ${{ github.workspace }}/go
23+
GOPHERJS_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
24+
25+
jobs:
26+
lint:
27+
name: Lint Checks
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
path: ${{ env.GOPHERJS_PATH }}
33+
- uses: actions/setup-go@v5
34+
with:
35+
go-version: ${{ env.GO_VERSION }}
36+
- name: Install golangci-lint
37+
uses: golangci/golangci-lint-action@v3
38+
with:
39+
working-directory: ${{ env.GOPHERJS_PATH }}
40+
version: ${{ env.GOLANGCI_VERSION }}
41+
only-new-issues: true
42+
- name: Check go.mod
43+
working-directory: ${{ env.GOPHERJS_PATH }}
44+
run: go mod tidy && git diff --exit-code
45+
- name: Check natives build tags
46+
working-directory: ${{ env.GOPHERJS_PATH }}
47+
run: |
48+
echo "Any following packages have at least one file that is missing //go:build js"
49+
diff -u <(echo -n) <(go list ./compiler/natives/src/...)
50+
51+
go_tests:
52+
name: Go Tests
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
with:
57+
path: ${{ env.GOPHERJS_PATH }}
58+
- name: Copy Actions
59+
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
60+
- name: Setup Go
61+
uses: actions/setup-go@v5
62+
with:
63+
go-version: ${{ env.GO_VERSION }}
64+
- name: Setup Go Environment
65+
working-directory: ${{ env.GOPHERJS_PATH }}
66+
shell: bash
67+
run: echo "GOROOT=$(go env GOROOT)" >> $GITHUB_ENV
68+
- name: Setup Node.js
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: ${{ env.NODE_VERSION }}
72+
- name: Install Node.js for Linux
73+
working-directory: ${{ env.GOPHERJS_PATH }}
74+
shell: bash
75+
# Install required Node.js packages including optional (node-syscall).
76+
run: |
77+
npm install --include=optional --no-package-lock
78+
- name: Setup Node.js Environment
79+
working-directory: ${{ env.GOPHERJS_PATH }}
80+
shell: bash
81+
# Make nodejs able to require installed modules from any working path.
82+
run: echo "NODE_PATH=$(npm root)" >> $GITHUB_ENV
83+
- name: Install GopherJS
84+
working-directory: ${{ env.GOPHERJS_PATH }}
85+
shell: bash
86+
run: go install -v
87+
- name: Setup information
88+
shell: bash
89+
run: |
90+
echo ::notice::go version: $(go version)
91+
echo ::notice::node version: $(node -v)
92+
echo ::notice::npm version: $(npm -v)
93+
echo ::notice::gopherjs version: $(gopherjs version)
94+
- name: Run Tests
95+
working-directory: ${{ env.GOPHERJS_PATH }}
96+
run: go test -v -race ./...

go.work

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
go 1.19
2+
3+
use (
4+
./playground
5+
./playground/internal/cmd/precompile
6+
)

go.work.sum

Lines changed: 610 additions & 0 deletions
Large diffs are not rendered by default.

playground/favicon-gopherjs.png

23.6 KB
Loading

playground/gen.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:generate go run ./internal/cmd/precompile
2-
//go:generate go install github.com/gopherjs/gopherjs
3-
//go:generate gopherjs build -m .
1+
//go:generate go1.19.13 run ./internal/cmd/precompile
2+
//go:generate go1.19.13 install github.com/gopherjs/gopherjs
3+
//go:generate env GOOS=js GOARCH=ecmascript gopherjs build -m .
44

55
package main

playground/go.mod

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
module github.com/gopherjs/gopherjs.github.io/playground
22

3-
go 1.17
3+
go 1.19
44

55
require (
6-
github.com/gopherjs/gopherjs v1.18.0-beta1
7-
github.com/neelance/go-angularjs v0.0.0-20170205214111-8c6312cca6e2
8-
github.com/sirupsen/logrus v1.8.1
9-
golang.org/x/tools v0.1.12
10-
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2
6+
github.com/google/go-cmp v0.5.8
7+
github.com/gopherjs/gopherjs v1.19.0-beta2.0.20251008200541-113c92b42b18
8+
golang.org/x/tools v0.16.0
119
honnef.co/go/js/xhr v0.0.0-20150307031022-00e3346113ae
1210
)
1311

1412
require (
15-
github.com/fsnotify/fsnotify v1.5.1 // indirect
13+
github.com/evanw/esbuild v0.25.4 // indirect
1614
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86 // indirect
17-
github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c // indirect
18-
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
19-
github.com/stretchr/testify v1.7.0 // indirect
20-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
21-
gopkg.in/yaml.v3 v3.0.1 // indirect
15+
github.com/sirupsen/logrus v1.8.1 // indirect
16+
github.com/stretchr/testify v1.11.1 // indirect
17+
golang.org/x/sys v0.10.0 // indirect
2218
honnef.co/go/js/util v0.0.0-20150216223935-96b8dd9d1621 // indirect
2319
)

0 commit comments

Comments
 (0)