-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit baced76
Showing
30 changed files
with
740 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "tic-tac-toe", | ||
"workspaceFolder": "/workspaces/tic-tac-toe/", | ||
"dockerComposeFile": ["../docker/docker-compose.development.yaml"], | ||
"service": "app", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["biomejs.biome", "editorconfig.editorconfig", "esbenp.prettier-vscode", "oven.bun-vscode"] | ||
} | ||
} | ||
} |
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,18 @@ | ||
# deliverable | ||
**/build/ | ||
**/dist/ | ||
**/out/ | ||
|
||
# dependency | ||
**/node_modules/ | ||
|
||
# env file | ||
**/.env* | ||
!**/.env.example | ||
|
||
# log | ||
**/*.tsbuildinfo | ||
|
||
# misc | ||
**/.DS_Store | ||
**/*.pem |
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,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,35 @@ | ||
name: app test | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: setup bun | ||
uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: 1.1.36 | ||
|
||
- name: get bun cache directory | ||
id: get-bun-cache-directory | ||
run: echo "STORE_PATH=$(bun pm cache)" >> $GITHUB_OUTPUT | ||
|
||
- name: cache bun dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.get-bun-cache-directory.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-bun-dependencies-${{ hashFiles('**/bun.lockb') }} | ||
restore-keys: ${{ runner.os }}-bun-dependencies- | ||
|
||
- name: install dependencies | ||
run: bun install --frozen-lockfile | ||
|
||
- name: check | ||
run: bun run check | ||
|
||
- name: test | ||
run: bun run test |
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,20 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# deliverable | ||
build/ | ||
dist/ | ||
out/ | ||
|
||
# dependency | ||
node_modules/ | ||
|
||
# env file | ||
.env* | ||
!.env.example | ||
|
||
# log | ||
*.tsbuildinfo | ||
|
||
# misc | ||
.DS_Store | ||
*.pem |
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 @@ | ||
bun = "1.1.36" |
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,30 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"files.encoding": "utf8", | ||
"files.eol": "\n", | ||
"[css]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
} |
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 @@ | ||
# MIT License | ||
|
||
Copyright © 2024 neo-wakuwaku-club | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,68 @@ | ||
<!-- markdownlint-disable MD024 --> | ||
|
||
# Tic Tac Toe 🎮 | ||
|
||
Tic Tac Toe (三目並べ) は、TypeScript と React のチュートリアルのために用意された二人対戦のボードゲームです。 | ||
|
||
## Setup with Dev Containers 📦 | ||
|
||
Tic Tac Toe の開発環境を Dev Containers で簡単に立ち上げることができます。 | ||
|
||
### Attention | ||
|
||
- 事前に [Docker](https://docs.docker.com/get-docker) と [Visual Studio Code](https://code.visualstudio.com) をインストールしておく必要があります。 | ||
|
||
### 1. clone git repository | ||
|
||
```bash | ||
git clone "https://github.com/neo-wakuwaku-club/tic-tac-toe" && cd "./tic-tac-toe" | ||
``` | ||
|
||
### 2. launch container | ||
|
||
VSCodeの拡張機能 [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) を使用してコンテナを起動してください。 | ||
|
||
### 3. install dependencies | ||
|
||
```bash | ||
bun install | ||
``` | ||
|
||
### 4. start development server | ||
|
||
```bash | ||
bun run dev | ||
``` | ||
|
||
## Setup locally 🖥️ | ||
|
||
Tic Tac Toe の開発環境をローカルで立ち上げる場合は以下の手順に従ってください。 | ||
|
||
### Attention | ||
|
||
- 事前に [proto](https://moonrepo.dev/docs/proto/install) をインストールしておく必要があります。 | ||
- [Optional] 事前に [`.devcontainer/devcontainer.json`](./.devcontainer/devcontainer.json#L8C7-L8C112) に記載されている拡張機能をインストールしておくことを推奨します。 | ||
|
||
### 1. clone git repository | ||
|
||
```bash | ||
git clone "https://github.com/neo-wakuwaku-club/tic-tac-toe" && cd "./tic-tac-toe" | ||
``` | ||
|
||
### 2. install package manager | ||
|
||
```bash | ||
proto use | ||
``` | ||
|
||
### 3. install dependencies | ||
|
||
```bash | ||
bun install | ||
``` | ||
|
||
### 4. start development server | ||
|
||
```bash | ||
bun run dev | ||
``` |
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,91 @@ | ||
{ | ||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json", | ||
"files": { | ||
"ignore": ["dist/", "generated/", "node_modules/"], | ||
"include": ["**/*.*js*", "**/*.*ts*"] | ||
}, | ||
"vcs": { | ||
"enabled": true, | ||
"clientKind": "git", | ||
"useIgnoreFile": true | ||
}, | ||
"linter": { | ||
"rules": { | ||
"a11y": { | ||
"useButtonType": "off" | ||
}, | ||
"complexity": { | ||
"noExcessiveCognitiveComplexity": "error", | ||
"noForEach": "off", | ||
"useLiteralKeys": "off", | ||
"useSimplifiedLogicExpression": "error" | ||
}, | ||
"correctness": { | ||
"noUndeclaredVariables": "error", | ||
"noUnusedImports": "error", | ||
"noUnusedPrivateClassMembers": "error", | ||
"useHookAtTopLevel": "error" | ||
}, | ||
"style": { | ||
"noDefaultExport": "error", | ||
"noNamespace": "error", | ||
"noNonNullAssertion": "off", | ||
"useForOf": "error" | ||
}, | ||
"suspicious": { | ||
"noArrayIndexKey": "off", | ||
"noConsoleLog": "off", | ||
"useAwait": "error" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineEnding": "lf", | ||
"lineWidth": 120 | ||
}, | ||
"javascript": { | ||
"parser": { | ||
"unsafeParameterDecoratorsEnabled": true | ||
}, | ||
"formatter": { | ||
"quoteStyle": "single", | ||
"jsxQuoteStyle": "single", | ||
"trailingCommas": "all", | ||
"arrowParentheses": "asNeeded", | ||
"bracketSpacing": true | ||
}, | ||
"globals": ["chrome"] | ||
}, | ||
"json": { | ||
"parser": { | ||
"allowComments": true | ||
} | ||
}, | ||
"css": { | ||
"parser": { | ||
"cssModules": true | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2 | ||
}, | ||
"linter": { | ||
"enabled": true | ||
} | ||
}, | ||
"overrides": [ | ||
{ | ||
"include": ["./*.ts", "./app/**/*.*ts*"], | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"noDefaultExport": "off" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Binary file not shown.
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,2 @@ | ||
[install] | ||
exact = true |
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,19 @@ | ||
# hadolint ignore=DL3007 | ||
FROM ubuntu:latest | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# hadolint ignore=DL3008 | ||
RUN apt-get update \ | ||
&& apt-get --no-install-recommends -y install ca-certificates curl git gnupg2 unzip xz-utils \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists | ||
|
||
RUN curl -fsSL https://moonrepo.dev/install/proto.sh | bash -s -- --yes \ | ||
&& echo "export PATH=$PATH:/root/.proto/bin:/root/.proto/shims" >> ~/.bashrc \ | ||
&& source ~/.bashrc | ||
|
||
WORKDIR /workspaces/tic-tac-toe/ | ||
|
||
COPY ./ ./ | ||
RUN /root/.proto/bin/proto use && /root/.proto/shims/bun install --frozen-lockfile |
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,12 @@ | ||
name: tic-tac-toe | ||
services: | ||
app: | ||
container_name: tic-tac-toe-app | ||
build: | ||
context: ../ | ||
dockerfile: ./docker/Dockerfile.development | ||
volumes: | ||
- type: bind | ||
source: ../ | ||
target: /workspaces/tic-tac-toe/ | ||
tty: true |
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,7 @@ | ||
pre-commit: | ||
parallel: true | ||
commands: | ||
check-fix: | ||
glob: "*.*{js,ts,json}*" | ||
run: bun biome check --write {staged_files} | ||
stage_fixed: true |
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,34 @@ | ||
{ | ||
"name": "tic-tac-toe", | ||
"version": "0.1.0", | ||
"repository": "https://github.com/neo-wakuwaku-club/tic-tac-toe.git", | ||
"license": "MIT", | ||
"private": true, | ||
"type": "module", | ||
"packageManager": "bun@1.1.36", | ||
"scripts": { | ||
"prepare": "lefthook install", | ||
"dev": "vite", | ||
"build": "tsc -b && vite build", | ||
"preview": "vite preview", | ||
"check": "biome check .", | ||
"check:fix": "biome check --write .", | ||
"test": "bun test" | ||
}, | ||
"dependencies": { | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.9.4", | ||
"@tsconfig/strictest": "2.0.5", | ||
"@tsconfig/vite-react": "3.0.2", | ||
"@types/bun": "1.1.13", | ||
"@types/react": "18.3.12", | ||
"@types/react-dom": "18.3.1", | ||
"@vitejs/plugin-react-swc": "3.7.1", | ||
"lefthook": "1.8.4", | ||
"typescript": "5.7.2", | ||
"vite": "6.0.1" | ||
} | ||
} |
Oops, something went wrong.