Skip to content

Commit 14d38f0

Browse files
committed
feat: grpc playground
1 parent 81b8de8 commit 14d38f0

30 files changed

+1905
-174
lines changed

biome.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
4+
"files": { "ignoreUnknown": false, "ignore": [] },
5+
"formatter": {
6+
"enabled": true,
7+
"useEditorconfig": true,
8+
"formatWithErrors": false,
9+
"indentStyle": "space",
10+
"indentWidth": 4,
11+
"lineEnding": "lf",
12+
"lineWidth": 80,
13+
"attributePosition": "auto",
14+
"bracketSpacing": true,
15+
"ignore": [
16+
"**/*/target",
17+
"**/*/dist",
18+
"packages/torii-client/wasm",
19+
"packages/torii-client/pkg",
20+
"packages/torii-wasm/pkg/",
21+
"packages/utils-wasm/pkg/",
22+
"packages/create-burner/coverage",
23+
"packages/core/coverage",
24+
"worlds/dojo-starter",
25+
"**/*-lock.yaml",
26+
"**/package-lock.json",
27+
"**/dev-dist",
28+
"**/CHANGELOG.md"
29+
]
30+
},
31+
"organizeImports": { "enabled": true },
32+
"linter": { "enabled": true, "rules": { "recommended": true } },
33+
"javascript": {
34+
"formatter": {
35+
"jsxQuoteStyle": "double",
36+
"quoteProperties": "asNeeded",
37+
"trailingCommas": "es5",
38+
"semicolons": "always",
39+
"arrowParentheses": "always",
40+
"bracketSameLine": false,
41+
"quoteStyle": "double",
42+
"attributePosition": "auto",
43+
"bracketSpacing": true
44+
}
45+
}
46+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13+
14+
- Configure the top-level `parserOptions` property like this:
15+
16+
```js
17+
export default tseslint.config({
18+
languageOptions: {
19+
// other options...
20+
parserOptions: {
21+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
22+
tsconfigRootDir: import.meta.dirname,
23+
},
24+
},
25+
});
26+
```
27+
28+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31+
32+
```js
33+
// eslint.config.js
34+
import react from "eslint-plugin-react";
35+
36+
export default tseslint.config({
37+
// Set the react version
38+
settings: { react: { version: "18.3" } },
39+
plugins: {
40+
// Add the react plugin
41+
react,
42+
},
43+
rules: {
44+
// other rules...
45+
// Enable its recommended rules
46+
...react.configs.recommended.rules,
47+
...react.configs["jsx-runtime"].rules,
48+
},
49+
});
50+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createDojoConfig } from "@dojoengine/core";
2+
3+
import manifest from "../../worlds/dojo-starter/manifest_dev.json";
4+
5+
export const dojoConfig = createDojoConfig({
6+
manifest,
7+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import tseslint from "typescript-eslint";
6+
7+
export default tseslint.config(
8+
{ ignores: ["dist"] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ["**/*.{ts,tsx}"],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
"react-hooks": reactHooks,
18+
"react-refresh": reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
"react-refresh/only-export-components": [
23+
"warn",
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
}
28+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Torii gRPC Playground</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "example-vite-grpc-playground",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@dojoengine/core": "workspace:*",
14+
"@dojoengine/sdk": "workspace:*",
15+
"monaco-editor": "^0.52.2",
16+
"path": "^0.12.7",
17+
"react": "^18.3.1",
18+
"react-dom": "^18.3.1",
19+
"ses": "^1.11.0"
20+
},
21+
"devDependencies": {
22+
"@eslint/js": "^9.17.0",
23+
"@tailwindcss/vite": "^4.0.1",
24+
"@types/react": "^18.3.18",
25+
"@types/react-dom": "^18.3.5",
26+
"@vitejs/plugin-react": "^4.3.4",
27+
"eslint": "^9.17.0",
28+
"eslint-plugin-react-hooks": "^5.0.0",
29+
"eslint-plugin-react-refresh": "^0.4.16",
30+
"globals": "^15.14.0",
31+
"tailwindcss": "^4.0.1",
32+
"typescript": "~5.6.3",
33+
"typescript-eslint": "^8.18.2",
34+
"vite": "^6.0.5",
35+
"vite-plugin-monaco-editor-esm": "^2.0.2",
36+
"vite-plugin-wasm": "^3.4.1"
37+
}
38+
}
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)