Skip to content

Commit

Permalink
add playground (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
goccy authored Jan 10, 2025
1 parent 80a7d85 commit d92bedc
Show file tree
Hide file tree
Showing 29 changed files with 9,145 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ jobs:
run: |
./bin/ycat .github/workflows/go.yml
page:
name: page
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: docs/playground/package-lock.json
- name: install dependencies
run: make -C ./docs/playground deps
- name: build
run: make -C ./docs/playground build

coverage:
name: Coverage
runs-on: ubuntu-latest
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy static content to Pages
on:
push:
tags:
- v*

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: docs/playground/package-lock.json
- name: install dependencies
run: make -C ./docs/playground deps
- name: build
run: make -C ./docs/playground build
- name: setup Pages
uses: actions/configure-pages@v4
- name: upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs/playground/dist'
- name: deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions docs/playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
*.wasm
dist
8 changes: 8 additions & 0 deletions docs/playground/.vite/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"hash": "a456637e",
"configHash": "358b79f2",
"lockfileHash": "c66b5dca",
"browserHash": "923911c5",
"optimized": {},
"chunks": {}
}
3 changes: 3 additions & 0 deletions docs/playground/.vite/deps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
18 changes: 18 additions & 0 deletions docs/playground/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: build
build: build/wasm build/page

.PHONY: build/wasm
build/wasm:
GOOS=js GOARCH=wasm go build -o src/yaml.wasm ./cmd/yaml

.PHONY: build/page
build/page:
npm run build

.PHONY: deps
deps:
npm ci

.PHONY: dev
dev:
npm run dev
14 changes: 14 additions & 0 deletions docs/playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Playground

## Architecture

- Vite
- React
- TypeScript
- WebWorker
- WebAssembly
- Built with Go
- Components
- [Monaco Editor](https://microsoft.github.io/monaco-editor/)
- [Xterm.js](https://xtermjs.org/)
- [MUI](https://mui.com/)
Loading

0 comments on commit d92bedc

Please sign in to comment.