Skip to content

Commit 95589f8

Browse files
committed
WASM / Vercel docs
1 parent 8641157 commit 95589f8

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module github.com/zegl/kube-score
22

33
require (
4+
github.com/buildkite/terminal-to-html v3.2.0+incompatible
45
github.com/eidolon/wordwrap v0.0.0-20161011182207-e0f54129b8bb
56
github.com/fatih/color v1.17.0
67
github.com/google/go-cmp v0.6.0
@@ -16,7 +17,6 @@ require (
1617
)
1718

1819
require (
19-
github.com/buildkite/terminal-to-html v3.2.0+incompatible // indirect
2020
github.com/davecgh/go-spew v1.1.1 // indirect
2121
github.com/go-logr/logr v1.4.1 // indirect
2222
github.com/gogo/protobuf v1.3.2 // indirect
@@ -39,4 +39,4 @@ require (
3939

4040
go 1.22.0
4141

42-
toolchain go1.22.2
42+
toolchain go1.22.4

vercel.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"buildCommand": "dnf install -y go && go env && go install golang.org/dl/go1.22.5@latest && /vercel/go/bin/go1.22.5 download && GOOS=js GOARCH=wasm /vercel/go/bin/go1.22.5 build -o ./web/main.wasm ./cmd/wasm/main.go",
3+
"outputDirectory": "./web"
4+
}

web/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.wasm

web/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# The kube-score website
2+
3+
This directory contains the source for kube-score.com.
4+
5+
kube-score is compiled to WASM (WebAssembly) for usage in browsers, and kube-score.com is running purely in the browser.
6+
7+
## Building
8+
9+
```bash
10+
# Compile the wasm module (run from repo root)
11+
GOOS=js GOARCH=wasm go build -o ./web/main.wasm ./cmd/wasm/main.go
12+
```
13+
14+
```bash
15+
# Start a webserver serving files
16+
python3 -m http.server
17+
```
18+
19+
## Hosting
20+
21+
The site is built and hosted on Vercel. See vercel.json for build configuration.
22+

web/index.html

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ <h1>kube-score</h1>
9191
Use this website to easily test kube-score, just paste your object definition YAML or JSON in the box below.
9292
</p>
9393

94+
<p>
95+
This tool is running 100% in your browser, no data is sent to any server!
96+
</p>
97+
9498
<textarea id="kube-score-input">
9599
apiVersion: apps/v1
96100
kind: Deployment

0 commit comments

Comments
 (0)