Skip to content

Commit

Permalink
Merge pull request #938 from berkeli/playground-update-docs-local-dev…
Browse files Browse the repository at this point in the history
…elopment

[playground] update docs for playground local dev
  • Loading branch information
tolgaOzen committed Dec 15, 2023
2 parents d071151 + c892d01 commit 2d04044
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ clean: ## Remove temporary and generated files
rm -f coverage.out coverage.html

.PHONY: wasm-build
wasm-build: ## Build wasm
wasm-build: ## Build wasm & place it in playground
cd ./pkg/development/wasm && GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o main.wasm && wasm-opt main.wasm --enable-bulk-memory -Oz -o play.wasm
cp ./pkg/development/wasm/play.wasm ./playground/public/play.wasm

.PHONY: release
release: format test security-scan clean ## Prepare for release
Expand Down
18 changes: 18 additions & 0 deletions playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
This directory contains a Permify playground. You can check out running version of [Playground](https://play.permify.co).
Playground works with [webassembly](https://webassembly.org). You can find the source code of playground in [/pkg/development/wasm](/pkg/development/wasm)

## How to run playground locally
First, you need to install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/). Then, you will need to build the `play.wasm` file. You can do it by running the following command in the root directory:

```bash
make wasm-build
```

Then, you can run the playground by running the following command in the playground directory:

```bash
yarn start
```
or the following command in the root directory:

```bash
make serve-playground
```

## Available Scripts

In the playground directory, you can run:
Expand Down

0 comments on commit 2d04044

Please sign in to comment.