Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Move to vite for build, runtime, tests #939

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
frontend: Eject CRA, clean up, fix tests, lint rules
  • Loading branch information
malinskibeniamin committed Dec 20, 2023
commit c0a77f75ae38a07db399733e2074eec7e0978a9a
5 changes: 3 additions & 2 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
},
"plugins": [
"@typescript-eslint",
"react"
"react",
"jest",
"jest-extended"
],
"extends": [
"react-app",
"react-app/jest",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:react-hooks/recommended"
Expand Down
53,914 changes: 22,044 additions & 31,870 deletions frontend/package-lock.json

Large diffs are not rendered by default.

220 changes: 104 additions & 116 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,118 +1,106 @@
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:9090",
"homepage": ".",
"engines": {
"node": "18"
},
"scripts": {
"start": "vite",
"start2": "REACT_APP_ENABLED_FEATURES=SINGLE_SIGN_ON,REASSIGN_PARTITIONS vite",
"build": "tsc && npm run lint && vite build",
"build-local-test": "tsc && npm run lint && REACT_APP_BUSINESS=true REACT_APP_CONSOLE_GIT_SHA=abc123 REACT_APP_CONSOLE_GIT_REF=local REACT_APP_BUILD_TIMESTAMP=32503680000 REACT_APP_DEV_HINT=true vite build",
"serve": "vite preview --port 3004",
"test": "TZ=GMT jest --coverage --watchAll=false",
"test:dev": "TZ=GMT jest --coverage --watchAll",
"eject": "react-scripts eject",
"test-interpreter-code": "ts-node --project src/utils/interpreter/tsconfig.json src/utils/interpreter/findFunction.test.ts",
"lint": "eslint \"./src/**/*.{ts,tsx}\" --cache",
"linter": "eslint",
"fetch-monaco": "node scripts/fetch-monaco.mjs",
"load-git-hooks": "cd .. && git config core.hooksPath \"./.git-hooks\"",
"prepare": "npm run fetch-monaco"
},
"dependencies": {
"@ant-design/icons": "^4.7",
"@chakra-ui/icons": "^2.1",
"@chakra-ui/react-use-disclosure": "^2.1",
"@connectrpc/connect": "^1.1.2",
"@connectrpc/connect-web": "^1.1.2",
"@heroicons/react": "^1.0.6",
"@monaco-editor/react": "^4.6",
"@primer/octicons-react": "^17",
"@redpanda-data/ui": "^3.31",
"@textea/json-viewer": "^1.24.4",
"@vitejs/plugin-react": "^4.2.0",
"antd": "^4.21",
"array-move": "^4",
"dotenv": "^16.3.1",
"framer-motion": "^7",
"js-base64": "^3.7.5",
"mobx": "^6.10",
"mobx-react": "^7.6",
"moment": "^2.29.4",
"monaco-editor": "^0.40",
"pretty-bytes": "^5.6.0",
"pretty-ms": "^7.0.1",
"react": "^18.2.0",
"react-beautiful-dnd": "^13.1.0",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.3",
"react-highlight-words": "^0.18.0",
"react-icons": "^4.10.1",
"react-markdown": "^8.0.7",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"react-syntax-highlighter": "^15.4.3",
"remark-emoji": "^3.0.2",
"remark-gfm": "^3.0.1",
"remark-prism": "^1.3.6",
"stacktrace-js": "^2.0.2",
"vite": "^5.0.2",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-env-compatible": "^1.1.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.1"
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.23.3",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@swc/helpers": "^0.5.3",
"@swc/jest": "^0.2.29",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.10",
"@types/node": "^18",
"@types/react": "^18.0.18",
"@types/react-beautiful-dnd": "^13.1",
"@types/react-dom": "^18.0.6",
"@types/react-highlight-words": "^0.16.4",
"@types/react-router-dom": "^5.3",
"@types/react-syntax-highlighter": "^15",
"@typescript-eslint/eslint-plugin": "^5.33",
"@typescript-eslint/parser": "^5.33",
"cross-env": "^7.0.3",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-resolve": "^29.7.0",
"jest-watch-typeahead": "^2.2.2",
"node-fetch": "^3.3.0",
"sass": "^1.58.3",
"tar-stream": "^2.2.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9",
"typescript": "^4.9.5"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"resolutions": {
"//": "See https://github.com/facebook/create-react-app/issues/11773 ",
"react-error-overlay": "6.0.11",
"immer": "9.0.7"
}
"name": "frontend",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:9090",
"homepage": ".",
"engines": {
"node": "18"
},
"scripts": {
"start": "vite",
"start2": "REACT_APP_ENABLED_FEATURES=SINGLE_SIGN_ON,REASSIGN_PARTITIONS vite",
"build": "tsc && npm run lint && vite build",
"build-local-test": "tsc && npm run lint && REACT_APP_BUSINESS=true REACT_APP_CONSOLE_GIT_SHA=abc123 REACT_APP_CONSOLE_GIT_REF=local REACT_APP_BUILD_TIMESTAMP=32503680000 REACT_APP_DEV_HINT=true vite build",
"serve": "vite preview --port 3004",
"test": "TZ=GMT jest --coverage --watchAll=false",
"test:dev": "TZ=GMT jest --coverage --watchAll",
"test-interpreter-code": "ts-node --project src/utils/interpreter/tsconfig.json src/utils/interpreter/findFunction.test.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

"lint": "eslint \"./src/**/*.{ts,tsx}\" --cache",
"linter": "eslint",
malinskibeniamin marked this conversation as resolved.
Show resolved Hide resolved
"fetch-monaco": "node scripts/fetch-monaco.mjs",
"load-git-hooks": "cd .. && git config core.hooksPath \"./.git-hooks\"",
"prepare": "npm run fetch-monaco"
},
"dependencies": {
"@ant-design/icons": "^4.7",
"@chakra-ui/icons": "^2.1",
"@chakra-ui/react-use-disclosure": "^2.1",
"@heroicons/react": "^1.0.6",
"@monaco-editor/react": "^4.6",
"@primer/octicons-react": "^17",
"@redpanda-data/ui": "^3.30.1",
"@textea/json-viewer": "^1.24.4",
"@vitejs/plugin-react": "^4.2.0",
"antd": "^4.21",
"array-move": "^4",
"camelcase": "^6.2.1",
"dotenv": "^16.3.1",
"eslint": "^8.3.0",
"eslint-config-react-app": "^7.0.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev deps

"framer-motion": "^7",
"js-base64": "^3.7.5",
"mobx": "^6.10",
"mobx-react": "^7.6",
"moment": "^2.29.4",
"monaco-editor": "^0.40",
"pretty-bytes": "^5.6.0",
"pretty-ms": "^7.0.1",
"react": "^18.2.0",
"react-app-polyfill": "^3.0.0",
"react-beautiful-dnd": "^13.1.0",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.3",
"react-highlight-words": "^0.18.0",
malinskibeniamin marked this conversation as resolved.
Show resolved Hide resolved
"react-icons": "^4.10.1",
"react-markdown": "^8.0.7",
"react-router-dom": "^5.2.0",
"react-syntax-highlighter": "^15.4.3",
"remark-emoji": "^3.0.2",
"remark-gfm": "^3.0.1",
"remark-prism": "^1.3.6",
"stacktrace-js": "^2.0.2",
"vite": "^5.0.2",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-env-compatible": "^1.1.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.1"
},
"devDependencies": {
"@swc/helpers": "^0.5.3",
"@swc/jest": "^0.2.29",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.10",
"@types/node": "^18",
"@types/react": "^18.0.18",
"@types/react-beautiful-dnd": "^13.1",
"@types/react-dom": "^18.0.6",
"@types/react-highlight-words": "^0.16.4",
"@types/react-router-dom": "^5.3",
"@types/react-syntax-highlighter": "^15",
"@typescript-eslint/eslint-plugin": "^5.33",
"@typescript-eslint/parser": "^5.33",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jest-extended": "^2.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-resolve": "^29.7.0",
"jest-watch-typeahead": "^2.2.2",
"node-fetch": "^3.3.0",
"sass": "^1.58.3",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe remove?

"tar-stream": "^2.2.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9",
"typescript": "^4.9.5"
},
"resolutions": {
"//": "See https://github.com/facebook/create-react-app/issues/11773 ",
"react-error-overlay": "6.0.11",
"immer": "9.0.7"
}
}
14 changes: 0 additions & 14 deletions frontend/scripts/build.js

This file was deleted.

43 changes: 0 additions & 43 deletions frontend/scripts/overrides/webpack.config.js

This file was deleted.

68 changes: 0 additions & 68 deletions frontend/scripts/serve.mjs

This file was deleted.

14 changes: 0 additions & 14 deletions frontend/scripts/start.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable testing-library/no-wait-for-multiple-assertions */
/**
* Copyright 2022 Redpanda Data, Inc.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable testing-library/no-wait-for-multiple-assertions */
/**
* Copyright 2022 Redpanda Data, Inc.
*
Expand Down
Loading