Skip to content

Commit

Permalink
Merge pull request #906 from docat-org/chore/update-frontend
Browse files Browse the repository at this point in the history
Update frontend
  • Loading branch information
fliiiix authored Oct 14, 2024
2 parents cefa04d + 3611595 commit 50543bc
Show file tree
Hide file tree
Showing 4 changed files with 2,669 additions and 2,809 deletions.
14 changes: 14 additions & 0 deletions web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default [
{
files: [
"./src/**/*.js",
"./src/**/*.jsx",
"./src/**/*.ts",
"./src/**/*.tsx"
],
extends: [
"react-app",
"react-app/jest"
]
}
];
41 changes: 18 additions & 23 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,42 @@
"name": "docat-web",
"version": "0.1.0",
"private": true,
"type": "module",
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.10.6",
"@mui/icons-material": "^5.15.7",
"@mui/material": "^5.15.7",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@types/jest": "^29.5.11",
"@types/lodash": "^4.14.202",
"@types/node": "^20.11.14",
"@types/node": "^22.7.5",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/parser": "^5.54.1",
"@typescript-eslint/parser": "^8.8.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"eslint": "^8.56.0",
"eslint": "^9.12.0",
"eslint-config-react-app": "^7.0.1",
"fuse.js": "^6.6.2",
"jsdom": "^22.1.0",
"fuse.js": "^7.0.0",
"jsdom": "^25.0.1",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^8.0.3",
"react-markdown": "^9.0.1",
"react-router": "^6.21.1",
"react-router-dom": "^6.21.1",
"semver": "^7.5.4",
"typescript": "*",
"vite": "^4.5.1",
"vite-plugin-svgr": "^3.3.0",
"vitest": "^0.34.6",
"web-vitals": "^3.5.0"
"vite": "^5.4.8",
"vite-plugin-svgr": "^4.2.0",
"vitest": "^2.1.2",
"web-vitals": "^4.2.3"
},
"scripts": {
"start": "VITE_DOCAT_VERSION=$(git describe --tags --always) vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest --watch=false",
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"lint": "eslint"
},
"browserslist": {
"production": [
Expand All @@ -57,13 +52,13 @@
]
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^37.0.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.5.0",
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react": "^7.32.1",
"prettier": "^3.2.4"
}
Expand Down
28 changes: 12 additions & 16 deletions web/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { type ReportHandler } from 'web-vitals'
import { ReportCallback } from "web-vitals";

const reportWebVitals = (onPerfEntry?: ReportHandler): void => {
if (onPerfEntry == null || !(onPerfEntry instanceof Function)) {
return
const reportWebVitals = (onPerfEntry?: ReportCallback) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import("web-vitals").then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {
onCLS(onPerfEntry);
onINP(onPerfEntry);
onFCP(onPerfEntry);
onLCP(onPerfEntry);
onTTFB(onPerfEntry);
});
}
};

void import('web-vitals').then(
({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry)
getFID(onPerfEntry)
getFCP(onPerfEntry)
getLCP(onPerfEntry)
getTTFB(onPerfEntry)
}
)
}

export default reportWebVitals
export default reportWebVitals;
Loading

0 comments on commit 50543bc

Please sign in to comment.