Skip to content

Commit

Permalink
feat: migrate to Vite
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoEscaleira committed Jan 15, 2024
1 parent 063dd08 commit bd252e4
Show file tree
Hide file tree
Showing 38 changed files with 936 additions and 486 deletions.
56 changes: 56 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"prettier",
],
globals: {
document: "readonly",
window: "readonly",
__API_SERVICE__: "readonly",
__MAPBOX_TOKEN__: "readonly",
},
ignorePatterns: ["dist", ".eslintrc.cjs", "vite.config.ts", '__generated__'],
parser: "@typescript-eslint/parser",
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./tsconfig.json",
},
},
},
plugins: ["react-refresh", "jsx-a11y", "import"],
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"@typescript-eslint/no-unused-vars": "warn",
"react-hooks/exhaustive-deps": "off",
"import/no-unresolved": "error",
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["react"],
"newlines-between": "never",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
};
26 changes: 0 additions & 26 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel
Expand All @@ -36,4 +36,4 @@ yarn-error.log*
next-env.d.ts

.idea
.code
.code
17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/images/planet-earth.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Meet the Countries</title>
<meta
name="description"
content="An app to get to know more about the countries around the globe. Come and meet unknown countries by playing quizzes about them and interacting with friends"
/>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
4 changes: 0 additions & 4 deletions next.config.js

This file was deleted.

45 changes: 28 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "frontend",
"version": "0.1.0",
"version": "0.0.1",
"private": true,
"author": "Marco Escaleira <[email protected]>",
"license": "MIT",
"type": "module",
"scripts": {
"prepare": "husky install",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
"preview": "vite preview",
"compile:graphql": "graphql-codegen"
},
"dependencies": {
Expand All @@ -18,16 +18,19 @@
"@heroicons/react": "^2.1.1",
"@hookform/resolvers": "^3.3.3",
"graphql": "^16.8.1",
"localforage": "^1.10.0",
"mapbox-gl": "^3.0.1",
"next": "14.0.4",
"match-sorter": "^6.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.49.2",
"react-hook-form": "^7.49.3",
"react-map-gl": "^7.1.7",
"react-modal": "^3.16.1",
"react-router-dom": "^6.21.2",
"react-simple-maps": "^3.0.0",
"react-toastify": "^9.1.3",
"react-tooltip": "^5.25.1",
"sort-by": "^1.2.0",
"yup": "^1.3.3",
"zustand": "^4.4.7"
},
Expand All @@ -38,24 +41,32 @@
"@redux-devtools/extension": "^3.3.0",
"@types/mapbox-gl": "^2.7.19",
"@types/node": "^20.9.2",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@types/react-modal": "^3.16.3",
"@types/react-simple-maps": "^3.0.4",
"@types/react-tooltip": "^4.2.4",
"@types/yup": "^0.32.0",
"autoprefixer": "^10.0.1",
"eslint": "^8.54.0",
"eslint-config-next": "14.0.3",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"husky": "^8.0.3",
"postcss": "^8.4.31",
"postcss": "^8.4.33",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.10",
"sass": "^1.69.6",
"tailwindcss": "^3.3.5",
"typescript": "5.3.3"
"sass": "^1.69.7",
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vite-tsconfig-paths": "^4.2.3"
}
}
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
Expand Down
10 changes: 5 additions & 5 deletions src/__generated__/gql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions src/__generated__/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions src/apolloClient.js

This file was deleted.

16 changes: 0 additions & 16 deletions src/app/game/page.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions src/app/layout.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/app/not-found.tsx

This file was deleted.

Loading

0 comments on commit bd252e4

Please sign in to comment.