Skip to content

Commit d92bedc

Browse files
authored
add playground (#611)
1 parent 80a7d85 commit d92bedc

29 files changed

+9145
-2
lines changed

.github/workflows/go.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ jobs:
8888
run: |
8989
./bin/ycat .github/workflows/go.yml
9090
91+
page:
92+
name: page
93+
runs-on: ubuntu-latest
94+
steps:
95+
- name: checkout
96+
uses: actions/checkout@v4
97+
- name: setup Node
98+
uses: actions/setup-node@v4
99+
with:
100+
node-version: 20
101+
cache: 'npm'
102+
cache-dependency-path: docs/playground/package-lock.json
103+
- name: install dependencies
104+
run: make -C ./docs/playground deps
105+
- name: build
106+
run: make -C ./docs/playground build
107+
91108
coverage:
92109
name: Coverage
93110
runs-on: ubuntu-latest

.github/workflows/pages.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy static content to Pages
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: 'pages'
16+
cancel-in-progress: true
17+
18+
jobs:
19+
deploy:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: checkout
23+
uses: actions/checkout@v4
24+
- name: setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: 'npm'
29+
cache-dependency-path: docs/playground/package-lock.json
30+
- name: install dependencies
31+
run: make -C ./docs/playground deps
32+
- name: build
33+
run: make -C ./docs/playground build
34+
- name: setup Pages
35+
uses: actions/configure-pages@v4
36+
- name: upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: './docs/playground/dist'
40+
- name: deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v4

docs/playground/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
*.wasm
3+
dist
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"hash": "a456637e",
3+
"configHash": "358b79f2",
4+
"lockfileHash": "c66b5dca",
5+
"browserHash": "923911c5",
6+
"optimized": {},
7+
"chunks": {}
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

docs/playground/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.PHONY: build
2+
build: build/wasm build/page
3+
4+
.PHONY: build/wasm
5+
build/wasm:
6+
GOOS=js GOARCH=wasm go build -o src/yaml.wasm ./cmd/yaml
7+
8+
.PHONY: build/page
9+
build/page:
10+
npm run build
11+
12+
.PHONY: deps
13+
deps:
14+
npm ci
15+
16+
.PHONY: dev
17+
dev:
18+
npm run dev

docs/playground/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Playground
2+
3+
## Architecture
4+
5+
- Vite
6+
- React
7+
- TypeScript
8+
- WebWorker
9+
- WebAssembly
10+
- Built with Go
11+
- Components
12+
- [Monaco Editor](https://microsoft.github.io/monaco-editor/)
13+
- [Xterm.js](https://xtermjs.org/)
14+
- [MUI](https://mui.com/)

0 commit comments

Comments
 (0)