diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f114cff3..1f4a956f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,14 +1,29 @@ { - "service": "chat-game", - "dockerComposeFile": [ - "../.docker/docker-compose.dev.yml" - ], - "workspaceFolder": "app", - "build": { - "dockerfile": "../.docker/Dockerfile.dev", - "context": "../" - }, + "name": "Chat Game", + "service": "app", + "image": "mcr.microsoft.com/devcontainers/typescript-node:20", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [3000], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "yarn install", + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "dbaeumer.vscode-eslint" + ] + } + }, + "portsAttributes": { "3000": { "label": "Application", diff --git a/.docker/Dockerfile.dev b/.docker/Dockerfile.dev deleted file mode 100644 index 4cd2102e..00000000 --- a/.docker/Dockerfile.dev +++ /dev/null @@ -1,16 +0,0 @@ -ARG NODE=node:20-alpine - -FROM $NODE - -WORKDIR /app - -COPY package.json . -COPY yarn.lock . - -RUN yarn install - -COPY . . - -EXPOSE 3000 - -CMD ["yarn", "run", "dev"] diff --git a/.docker/docker-compose.dev.yml b/.docker/docker-compose.dev.yml deleted file mode 100644 index aa019012..00000000 --- a/.docker/docker-compose.dev.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3.8' - -services: - chat-game-dev: - build: - context: ../ - dockerfile: .docker/Dockerfile.dev - ports: - - '3000:3000' diff --git a/.husky/commit-msg b/.husky/commit-msg index c160a771..409d8224 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,3 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" +. "$(dirname -- "$0")/common.sh" npx --no -- commitlint --edit ${1} diff --git a/.husky/common.sh b/.husky/common.sh new file mode 100644 index 00000000..cff69011 --- /dev/null +++ b/.husky/common.sh @@ -0,0 +1,8 @@ +command_exists () { + command -v "$1" >/dev/null 2>&1 +} + +# Workaround for Windows 10, Git Bash, and Yarn +if command_exists winpty && test -t 1; then + exec < /dev/tty +fi \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index d24fdfc6..f2a30e6a 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,3 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" +. "$(dirname -- "$0")/common.sh" -npx lint-staged +npx lint-staged \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..3a1d500e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,47 @@ +{ + "eslint.experimental.useFlatConfig": true, + + "prettier.enable": false, + "editor.formatOnSave": false, + + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off" }, + { "rule": "format/*", "severity": "off" }, + { "rule": "*-indent", "severity": "off" }, + { "rule": "*-spacing", "severity": "off" }, + { "rule": "*-spaces", "severity": "off" }, + { "rule": "*-order", "severity": "off" }, + { "rule": "*-dangle", "severity": "off" }, + { "rule": "*-newline", "severity": "off" }, + { "rule": "*quotes", "severity": "off" }, + { "rule": "*semi", "severity": "off" } + ], + + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml", + "xml", + "gql", + "graphql", + "astro", + "css", + "less", + "scss", + "pcss", + "postcss" + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 0e16d437..57abf756 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,11 @@ Let's build a similar world together! ⭐️ Become a Stargazer ⭐️ ## 🕹️ How to develop -Clone this repo and use standard commands: +You can develop in isolated container with prepared options: + +[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/hmbanan666/chat-game) + +Make a fork. Or clone this repo and use standard commands: ```shell git clone https://github.com/hmbanan666/chat-game diff --git a/src/lib/components/Profile.svelte b/src/lib/components/Profile.svelte index 9446569b..6f9d9878 100644 --- a/src/lib/components/Profile.svelte +++ b/src/lib/components/Profile.svelte @@ -12,7 +12,7 @@ const isSignedIn = !!$page.data.profile const handleSignOut = () => { - void fetch('/auth/profile', { + void fetch('/en/auth/profile', { method: 'DELETE', headers: { 'content-type': 'application/json', @@ -35,8 +35,8 @@ {#if menuOpened}