This repository has been archived by the owner on Sep 21, 2024. It is now read-only.
forked from pixelaw/web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from pixelaw/refactor/add-formatter
[ Refactor ] Format and Lint / Fix Typings
- Loading branch information
Showing
89 changed files
with
11,353 additions
and
14,738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:tailwindcss/recommended', | ||
'plugin:import/typescript', | ||
'prettier', | ||
'plugin:import/warnings', | ||
], | ||
}, | ||
} | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh', 'tailwindcss', '@typescript-eslint'], | ||
rules: { | ||
'react/react-in-jsx-scope': 'off', | ||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
'react/self-closing-comp': [ | ||
'error', | ||
{ | ||
component: true, | ||
html: true, | ||
}, | ||
], | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'warn', | ||
{ | ||
prefer: 'type-imports', | ||
fixStyle: 'inline-type-imports', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,60 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
buildImage: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Depot CLI | ||
uses: depot/setup-action@v1 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=sha | ||
- uses: depot/build-push-action@v1 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/amd64,linux/arm64/v8 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Create GitHub Release | ||
env: | ||
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
run: | | ||
TAG=${{ github.ref }} | ||
VERSION=${TAG#refs/tags/} | ||
gh release create $VERSION -t $VERSION -n "Release notes for $VERSION" | ||
buildImage: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Depot CLI | ||
uses: depot/setup-action@v1 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=sha | ||
- uses: depot/build-push-action@v1 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/amd64,linux/arm64/v8 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Create GitHub Release | ||
env: | ||
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
run: | | ||
TAG=${{ github.ref }} | ||
VERSION=${TAG#refs/tags/} | ||
gh release create $VERSION -t $VERSION -n "Release notes for $VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: ci-front | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lint-n-format: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: 8 | ||
run_install: false | ||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: lint | ||
run: pnpm lint | ||
- name: format | ||
run: pnpm format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
trailingComma: 'all', | ||
tabWidth: 4, | ||
semi: true, | ||
singleQuote: true, | ||
jsxSingleQuote: true, | ||
printWidth: 100, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"bradlc.vscode-tailwindcss", | ||
"oderwat.indent-rainbow", | ||
"YoavBls.pretty-ts-errors" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"id":"r77bmfc7vx"} | ||
{ "id": "r77bmfc7vx" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
services: | ||
pixelaw-core: | ||
image: ghcr.io/pixelaw/core:0.3.20 | ||
platform: linux/x86_64 | ||
container_name: pixelaw-core | ||
environment: | ||
- DISABLE_FEE=true | ||
- DISABLE_VALIDATE=true | ||
- RUST_LOG=info,hyper=off | ||
# - WORLD_ADDRESS=0xfc685b398bc4692ab3a4acd380859e71f97d2c319f188854d3a01948ba276a | ||
- WORLD_ADDRESS=0xfc685b398bc4692ab3a4acd380859e71f97d2c319f188854d3a01948ba276a | ||
- INVOKE_MAX_STEPS=4000000 | ||
ports: | ||
- "127.0.0.1:5050:5050" | ||
- "127.0.0.1:3000:3000" | ||
- "127.0.0.1:8080:8080" | ||
- "127.0.0.1:9090:9090" | ||
restart: unless-stopped | ||
networks: | ||
- pixelaw | ||
volumes: | ||
- storage:/keiko/storage | ||
- log:/keiko/log | ||
pixelaw-core: | ||
image: ghcr.io/pixelaw/core:0.3.20 | ||
platform: linux/x86_64 | ||
container_name: pixelaw-core | ||
environment: | ||
- DISABLE_FEE=true | ||
- DISABLE_VALIDATE=true | ||
- RUST_LOG=info,hyper=off | ||
# - WORLD_ADDRESS=0xfc685b398bc4692ab3a4acd380859e71f97d2c319f188854d3a01948ba276a | ||
- WORLD_ADDRESS=0xfc685b398bc4692ab3a4acd380859e71f97d2c319f188854d3a01948ba276a | ||
- INVOKE_MAX_STEPS=4000000 | ||
ports: | ||
- '127.0.0.1:5050:5050' | ||
- '127.0.0.1:3000:3000' | ||
- '127.0.0.1:8080:8080' | ||
- '127.0.0.1:9090:9090' | ||
restart: unless-stopped | ||
networks: | ||
- pixelaw | ||
volumes: | ||
- storage:/keiko/storage | ||
- log:/keiko/log | ||
# - ./.core/storage:/keiko/storage | ||
# - ./.core/log:/keiko/log | ||
networks: | ||
pixelaw: | ||
driver: bridge | ||
pixelaw: | ||
driver: bridge | ||
volumes: | ||
storage: | ||
log: | ||
storage: | ||
log: |
Oops, something went wrong.