diff --git a/.dockerignore b/.dockerignore index 0827c99..ba422bd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,16 +1,26 @@ -# Developement -.git -.prettierrc -.gitignore -README.md - # Node node_modules npm-debug.log -# Build -build - # Docker Dockerfile -.dockerignore \ No newline at end of file +.dockerignore + +# Git +.git +.github +.gitignore + +# Builds +dist + +# Dev configs +.prettierrc +.prettierignore +jsconfig.json + +# Markdown files +*.md + +# Release scripts +release \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 02465c1..d788ca0 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,12 +1,23 @@ { - "useTabs": true, - "tabWidth": 4, "arrowParens": "always", + "bracketSpacing": true, + "bracketSameLine": false, "endOfLine": "lf", "jsxSingleQuote": true, + "overrides": [ + { + "files": "*.scss", + "options": { + "singleQuote": false + } + } + ], + "printWidth": 500, + "proseWrap": "always", + "useTabs": true, "semi": true, - "trailingComma": "all", "singleAttributePerLine": true, "singleQuote": true, - "printWidth": 500 + "tabWidth": 4, + "trailingComma": "all" } diff --git a/Dockerfile b/Dockerfile index 4ce878c..8ddb179 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,30 @@ # Build stage -FROM node:lts-alpine as build +FROM node:lts-alpine AS base -WORKDIR /usr/src/app +WORKDIR /app COPY package*.json ./ -RUN npm ci + +# Production dependencies +FROM base AS prod-deps +RUN npm ci --omit=dev + +# Build +FROM base AS build COPY . . +RUN npm ci RUN npm run build # Final stage -FROM node:lts-alpine as final +FROM node:lts-alpine AS final + +WORKDIR /app + +COPY --from=prod-deps /app/node_modules /app/node_modules +COPY --from=build /app/dist /app/dist + EXPOSE 3000 -WORKDIR /usr/src/app - -COPY --from=build /usr/src/app/build . - -RUN npm i -g serve - -CMD serve \ No newline at end of file +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index cc931bf..437d780 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Minesweeper is a game where the player has to clear a minefield without detonati docker run --name minesweeper -dp 3000:3000 minesweeper ``` -# 👩‍❤️‍👨 Credits +# 👷‍♂️ Credits -- [KeunotorCagoule](https://www.github.com/KeunotorCagoule) - [UnEpicier](https://www.github.com/UnEpicier) +- [KeunotorCagoule](https://www.github.com/KeunotorCagoule) diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..f141dd6 --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,38 @@ +import js from '@eslint/js'; +import { Linter } from 'eslint'; +import react from 'eslint-plugin-react'; +import globals from 'globals'; + +const config: Linter.Config[] = [ + js.configs.recommended, + react.configs.flat.recommended, + { + plugins: { + react: react, + }, + + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + }, + + ecmaVersion: 'latest', + sourceType: 'module', + }, + + rules: { + 'react/prop-types': 'off', + 'react/display-name': 'off', + 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], + }, + + settings: { + react: { + version: 'detect', + }, + }, + }, +]; + +export default config; diff --git a/public/index.html b/index.html similarity index 71% rename from public/index.html rename to index.html index 1b9c251..d936d2e 100644 --- a/public/index.html +++ b/index.html @@ -1,15 +1,15 @@ - +
- + + +{gameState.endType === 'win' ? lang.config.win : lang.config.loose}
+{endType === 'win' ? config.win : config.loose}