From 0154a152dd6d3606c9131f3186a9175ee5853185 Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Sat, 28 Sep 2024 10:55:35 -0700 Subject: Use api endpoint for backend --- client/.env | 1 - client/.env.development | 1 + client/.env.production | 1 + client/.env.test | 1 + client/README.md | 30 ------------------------------ client/package.json | 12 ++---------- client/tsconfig.json | 3 +-- client/vite.config.ts | 13 ------------- client/vitest.config.ts | 11 +++++++++++ 9 files changed, 17 insertions(+), 56 deletions(-) delete mode 100644 client/.env create mode 100644 client/.env.development create mode 100644 client/.env.production create mode 100644 client/.env.test delete mode 100644 client/README.md delete mode 100644 client/vite.config.ts create mode 100644 client/vitest.config.ts (limited to 'client') diff --git a/client/.env b/client/.env deleted file mode 100644 index 2f560b8..0000000 --- a/client/.env +++ /dev/null @@ -1 +0,0 @@ -VITE_BASE_URL=http://192.168.1.18:8080/ diff --git a/client/.env.development b/client/.env.development new file mode 100644 index 0000000..be2cee9 --- /dev/null +++ b/client/.env.development @@ -0,0 +1 @@ +VITE_BASE_URL=http://192.168.1.18:8080/api/ diff --git a/client/.env.production b/client/.env.production new file mode 100644 index 0000000..7e27439 --- /dev/null +++ b/client/.env.production @@ -0,0 +1 @@ +VITE_BASE_URL=https://localhost:8080/api/ diff --git a/client/.env.test b/client/.env.test new file mode 100644 index 0000000..be2cee9 --- /dev/null +++ b/client/.env.test @@ -0,0 +1 @@ +VITE_BASE_URL=http://192.168.1.18:8080/api/ diff --git a/client/README.md b/client/README.md deleted file mode 100644 index 0d6babe..0000000 --- a/client/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: - -- Configure the top-level `parserOptions` property like this: - -```js -export default { - // other rules... - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - project: ['./tsconfig.json', './tsconfig.node.json'], - tsconfigRootDir: __dirname, - }, -} -``` - -- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` -- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` -- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list diff --git a/client/package.json b/client/package.json index 0990aa3..eda5a5b 100644 --- a/client/package.json +++ b/client/package.json @@ -13,14 +13,11 @@ "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", - "@fontsource/roboto": "^5.0.14", "@mui/icons-material": "^5.16.7", - "@mui/lab": "^5.0.0-alpha.165", "@mui/material": "^5.16.7", "@mui/x-date-pickers": "^7.14.0", "@reduxjs/toolkit": "^2.2.1", "material-react-table": "^2.13.1", - "prettier": "^3.2.5", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.50.1", @@ -28,23 +25,18 @@ "react-router-dom": "^6.22.0" }, "devDependencies": { - "@hookform/devtools": "^4.3.1", "@testing-library/jest-dom": "^6.5.0", "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", - "@types/bun": "^1.1.0", - "@types/react": "^18.2.55", - "@types/react-dom": "^18.2.19", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", - "@vitejs/plugin-react": "^4.2.1", "eslint": "^8.56.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", "jsdom": "^25.0.0", "msw": "^2.2.1", - "typescript": "^5.2.2", - "vite": "^5.4.2", + "typescript": "^5.6.2", + "vite": "^5.4.8", "vitest": "^2.1.1" } } diff --git a/client/tsconfig.json b/client/tsconfig.json index 4c214ba..0b04524 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -7,7 +7,6 @@ "moduleDetection": "force", "jsx": "react-jsx", "allowJs": true, - "types": ["vite/client"], // Bundler mode "moduleResolution": "bundler", @@ -25,5 +24,5 @@ "noUnusedParameters": true, "noPropertyAccessFromIndexSignature": true }, - "include": ["vite-env.d.ts", "vite.config.ts"] + "include": ["vite-env.d.ts", "vitest.config.ts"] } diff --git a/client/vite.config.ts b/client/vite.config.ts deleted file mode 100644 index 2942029..0000000 --- a/client/vite.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import { defineConfig } from 'vite'; -import react from '@vitejs/plugin-react'; - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], - test: { - globals: true, - environment: 'jsdom', - setupFiles: './src/setup.ts', - }, -}); diff --git a/client/vitest.config.ts b/client/vitest.config.ts new file mode 100644 index 0000000..2de257c --- /dev/null +++ b/client/vitest.config.ts @@ -0,0 +1,11 @@ +/// +import { defineConfig } from 'vitest/config'; + +// https://vitejs.dev/config/ +export default defineConfig({ + test: { + globals: true, + environment: 'jsdom', + setupFiles: './src/setup.ts', + }, +}); -- cgit v1.2.3