diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..82a9a73 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +.eslintrc.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 987866d..ac9efb0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,6 +5,7 @@ module.exports = { 'plugin:jest/recommended', 'plugin:prettier/recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:import/recommended' ], plugins: ['react', '@typescript-eslint', 'jest', 'prettier'], env: { @@ -54,18 +55,6 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/no-explicit-any': 0, 'linebreak-style': 'off', - 'jsx-a11y/label-has-associated-control': [ - 'error', - { - labelComponents: [], - labelAttributes: [], - controlComponents: [], - assert: 'either', - depth: 25, - }, - ], - 'jsx-a11y/control-has-associated-label': 0, - 'jsx-a11y/anchor-is-valid': 0, 'prettier/prettier': [ 'error', { diff --git a/__tests__/Alert.test.tsx b/__tests__/Alert.test.tsx deleted file mode 100644 index 61127d7..0000000 --- a/__tests__/Alert.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Alert test suite', () => {}); diff --git a/__tests__/Avatar.test.tsx b/__tests__/Avatar.test.tsx deleted file mode 100644 index 7a1cf6b..0000000 --- a/__tests__/Avatar.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Avatar test suite', () => {}); diff --git a/__tests__/Box.test.tsx b/__tests__/Box.test.tsx deleted file mode 100644 index 1f96ffe..0000000 --- a/__tests__/Box.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Box test suite', () => {}); diff --git a/__tests__/Button.test.tsx b/__tests__/Button.test.tsx deleted file mode 100644 index 745c3aa..0000000 --- a/__tests__/Button.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Button test suite', () => {}); diff --git a/__tests__/CheckBox.test.tsx b/__tests__/CheckBox.test.tsx deleted file mode 100644 index b81b312..0000000 --- a/__tests__/CheckBox.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('CheckBox test suite', () => {}); diff --git a/__tests__/Input.test.tsx b/__tests__/Input.test.tsx deleted file mode 100644 index 5184a98..0000000 --- a/__tests__/Input.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Input test suite', () => {}); diff --git a/__tests__/Link.test.tsx b/__tests__/Link.test.tsx deleted file mode 100644 index f2f13b9..0000000 --- a/__tests__/Link.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Link test suite', () => {}); diff --git a/__tests__/Menu.test.tsx b/__tests__/Menu.test.tsx deleted file mode 100644 index 046dcc2..0000000 --- a/__tests__/Menu.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Modal test suite', () => {}); diff --git a/__tests__/Modal.test.tsx b/__tests__/Modal.test.tsx deleted file mode 100644 index 046dcc2..0000000 --- a/__tests__/Modal.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Modal test suite', () => {}); diff --git a/__tests__/Search.test.tsx b/__tests__/Search.test.tsx deleted file mode 100644 index b6e7a24..0000000 --- a/__tests__/Search.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Search test suite', () => {}); diff --git a/__tests__/Spinner.test.tsx b/__tests__/Spinner.test.tsx deleted file mode 100644 index 260af1a..0000000 --- a/__tests__/Spinner.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Spinner test suite', () => {}); diff --git a/__tests__/Text.test.tsx b/__tests__/Text.test.tsx deleted file mode 100644 index ed4b53c..0000000 --- a/__tests__/Text.test.tsx +++ /dev/null @@ -1 +0,0 @@ -describe('Text test suite', () => {}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..46a45a0 --- /dev/null +++ b/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + Astrobuild + + + +
+ + + diff --git a/package.json b/package.json index 2a2502f..df5c2aa 100644 --- a/package.json +++ b/package.json @@ -3,40 +3,43 @@ "version": "0.1.0", "private": true, "dependencies": { - "@apollo/client": "^3.3.14", - "@testing-library/jest-dom": "^5.11.4", - "@testing-library/react": "^11.1.0", - "@testing-library/user-event": "^12.1.10", - "@types/jest": "^26.0.15", + "@apollo/client": "^3.7.10", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^14.0.0", + "@testing-library/user-event": "^14.4.3", + "@types/jest": "^29.5.0", "@types/jwt-decode": "^3.1.0", - "@types/node": "^12.0.0", - "@types/react": "^17.0.3", - "@types/react-dom": "^17.0.3", - "@types/react-router-dom": "^5.1.7", - "@types/styled-components": "^5.1.9", - "formik": "^2.2.6", - "graphql": "^15.5.0", + "@types/node": "^18.15.7", + "@types/react": "^18.0.29", + "@types/react-dom": "^18.0.11", + "@types/react-router-dom": "^5.3.3", + "@types/styled-components": "^5.1.26", + "formik": "^2.2.9", + "graphql": "^16.6.0", "jwt-decode": "^3.1.2", - "react": "^17.0.2", - "react-dom": "^17.0.2", + "localforage": "^1.10.0", + "match-sorter": "^6.3.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react-elastic-carousel": "^0.11.5", "react-flow-renderer": "^9.6.0", - "react-router-dom": "^5.2.0", - "react-scripts": "4.0.3", - "react-to-print": "^2.12.6", - "styled-components": "^5.2.3", + "react-router-dom": "^6.9.0", + "react-to-print": "^2.14.12", + "sort-by": "^1.2.0", + "styled-components": "^5.3.9", "subscriptions-transport-ws": "^0.9.19", - "typescript": "^4.1.2", - "web-vitals": "^1.0.1", - "yup": "^0.32.9" + "typescript": "^5.0.2", + "vite-plugin-svgr": "^2.4.0", + "web-vitals": "^3.3.0", + "yup": "^1.0.2" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", + "start": "vite", + "build": "vite build", "generate-main": "graphql-codegen --config codegen-main.yml", - "generate-support": "graphql-codegen --config codegen-support.yml" + "generate-support": "graphql-codegen --config codegen-support.yml", + "lint": "yarn run eslint src --ext .ts,.tsx", + "fix": "yarn lint --fix" }, "browserslist": { "production": [ @@ -51,21 +54,23 @@ ] }, "devDependencies": { - "@graphql-codegen/cli": "^1.21.3", - "@graphql-codegen/introspection": "^1.18.2", - "@graphql-codegen/typescript": "^1.22.0", - "@graphql-codegen/typescript-operations": "^1.17.16", - "@typescript-eslint/eslint-plugin": "^4.21.0", - "@typescript-eslint/parser": "^4.21.0", - "eslint-config-airbnb": "18.2.1", - "eslint-config-airbnb-typescript": "^12.3.1", - "eslint-config-prettier": "^8.1.0", - "eslint-plugin-import": "2.22.1", - "eslint-plugin-jest": "^24.3.4", - "eslint-plugin-jsx-a11y": "6.4.1", - "eslint-plugin-prettier": "^3.3.1", - "eslint-plugin-react": "7.21.5", - "eslint-plugin-react-hooks": "1.7.0", - "prettier": "^2.2.1" + "@graphql-codegen/cli": "^3.2.2", + "@graphql-codegen/introspection": "^3.0.1", + "@graphql-codegen/typescript": "^3.0.2", + "@graphql-codegen/typescript-operations": "^3.0.2", + "@typescript-eslint/eslint-plugin": "^5.56.0", + "@typescript-eslint/parser": "^5.56.0", + "@vitejs/plugin-react": "^3.1.0", + "eslint-config-airbnb": "19.0.4", + "eslint-config-airbnb-typescript": "^17.0.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-jest": "^27.2.1", + "eslint-plugin-jsx-a11y": "6.7.1", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-react": "7.32.2", + "eslint-plugin-react-hooks": "4.6.0", + "prettier": "^2.8.7", + "vite": "^4.2.1" } } diff --git a/public/index.html b/public/index.html deleted file mode 100644 index f60baa8..0000000 --- a/public/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - Astrobuild - - - -
- - - diff --git a/src/App.tsx b/src/App.tsx index 1fcfc89..365cc2a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,10 @@ import jwtDecode from 'jwt-decode'; import { useEffect } from 'react'; -import { Redirect, Switch } from 'react-router-dom'; +import { Routes, Navigate } from 'react-router-dom'; import { useLazyQuery, useReactiveVar } from '@apollo/client'; import { ProtectedRoute, - AuthRoute, + PublicRoute, Navbar, Sidebar, Spinner, @@ -90,111 +90,111 @@ const App = () => { )} - - + + {role !== 'admin' ? ( - + ) : ( - + )} - + - + - + - + - + - + - + - +