From fe78191893b06d404300d257d6d318417d842dc7 Mon Sep 17 00:00:00 2001 From: Maksym Sadovnychyy Date: Tue, 8 Feb 2022 21:17:17 +0100 Subject: [PATCH] (refactor): update all packages to latest --- .gitignore | 2 +- LICENSE | 15 + README.md | 72 + {scr/ClientApp => clientapp}/.env | 0 clientapp/.eslintrc.json | 17 + clientapp/.vscode/launch.json | 22 + clientapp/package.json | 59 + .../public/favicon.ico | Bin .../ClientApp => clientapp}/public/index.html | 2 +- .../public/manifest.json | 4 +- clientapp/src/App.test.tsx | 22 + clientapp/src/App.tsx | 53 + clientapp/src/DynamicLayout.tsx | 29 + clientapp/src/DynamicPage.tsx | 28 + clientapp/src/functions/getKeyValue.ts | 5 + clientapp/src/functions/index.ts | 5 + clientapp/src/index.tsx | 23 + clientapp/src/layouts/basic/NavMenu/index.tsx | 41 + clientapp/src/layouts/basic/index.tsx | 21 + clientapp/src/layouts/basic/scss/style.scss | 42 + clientapp/src/layouts/index.tsx | 5 + clientapp/src/layouts/interfaces.tsx | 3 + clientapp/src/pages/Counter.tsx | 29 + clientapp/src/pages/FetchData.tsx | 79 + .../src/pages}/Home.tsx | 14 +- clientapp/src/pages/index.tsx | 9 + .../src/react-app-env.d.ts | 0 clientapp/src/registerServiceWorker.ts | 105 + clientapp/src/store/configureStore.ts | 47 + .../src/store/index.ts | 19 +- .../src/store/reducers}/Counter.ts | 40 +- clientapp/src/store/reducers/Settings.ts | 77 + .../src/store/reducers/WeatherForecasts.ts | 100 + {scr/ClientApp => clientapp}/tsconfig.json | 3 +- clientapp/yarn.lock | 8875 ++++++++ scr/ClientApp/.eslintrc.json | 10 - scr/ClientApp/.gitignore | 21 - scr/ClientApp/README.md | 2228 -- scr/ClientApp/package-lock.json | 18318 ---------------- scr/ClientApp/package.json | 58 - scr/ClientApp/src/App.test.tsx | 22 - scr/ClientApp/src/App.tsx | 16 - scr/ClientApp/src/components/Counter.tsx | 35 - scr/ClientApp/src/components/FetchData.tsx | 84 - scr/ClientApp/src/components/Layout.tsx | 16 - scr/ClientApp/src/components/NavMenu.css | 13 - scr/ClientApp/src/components/NavMenu.tsx | 42 - scr/ClientApp/src/custom.css | 14 - scr/ClientApp/src/index.tsx | 27 - scr/ClientApp/src/registerServiceWorker.ts | 105 - scr/ClientApp/src/store/WeatherForecasts.ts | 91 - scr/ClientApp/src/store/configureStore.ts | 29 - scr/Controllers/WeatherForecastController.cs | 39 - scr/Pages/Error.cshtml | 26 - scr/Pages/Error.cshtml.cs | 30 - scr/Pages/_ViewImports.cshtml | 3 - scr/Program.cs | 26 - scr/Startup.cs | 71 - scr/WeatherForecast.cs | 15 - scr/appsettings.Development.json | 9 - scr/xxxx.csproj | 49 - webapi/WeatherForecast.sln | 25 + .../Controllers/WeatherForecastController.cs | 34 + webapi/WeatherForecast/Program.cs | 41 + .../Properties/launchSettings.json | 18 +- webapi/WeatherForecast/WeatherForecast.cs | 12 + webapi/WeatherForecast/WeatherForecast.csproj | 14 + .../appsettings.Development.json | 8 + .../WeatherForecast}/appsettings.json | 3 +- 69 files changed, 9974 insertions(+), 21445 deletions(-) create mode 100644 LICENSE create mode 100644 README.md rename {scr/ClientApp => clientapp}/.env (100%) create mode 100644 clientapp/.eslintrc.json create mode 100644 clientapp/.vscode/launch.json create mode 100644 clientapp/package.json rename {scr/ClientApp => clientapp}/public/favicon.ico (100%) rename {scr/ClientApp => clientapp}/public/index.html (97%) rename {scr/ClientApp => clientapp}/public/manifest.json (79%) create mode 100644 clientapp/src/App.test.tsx create mode 100644 clientapp/src/App.tsx create mode 100644 clientapp/src/DynamicLayout.tsx create mode 100644 clientapp/src/DynamicPage.tsx create mode 100644 clientapp/src/functions/getKeyValue.ts create mode 100644 clientapp/src/functions/index.ts create mode 100644 clientapp/src/index.tsx create mode 100644 clientapp/src/layouts/basic/NavMenu/index.tsx create mode 100644 clientapp/src/layouts/basic/index.tsx create mode 100644 clientapp/src/layouts/basic/scss/style.scss create mode 100644 clientapp/src/layouts/index.tsx create mode 100644 clientapp/src/layouts/interfaces.tsx create mode 100644 clientapp/src/pages/Counter.tsx create mode 100644 clientapp/src/pages/FetchData.tsx rename {scr/ClientApp/src/components => clientapp/src/pages}/Home.tsx (91%) create mode 100644 clientapp/src/pages/index.tsx rename {scr/ClientApp => clientapp}/src/react-app-env.d.ts (100%) create mode 100644 clientapp/src/registerServiceWorker.ts create mode 100644 clientapp/src/store/configureStore.ts rename {scr/ClientApp => clientapp}/src/store/index.ts (52%) rename {scr/ClientApp/src/store => clientapp/src/store/reducers}/Counter.ts (64%) create mode 100644 clientapp/src/store/reducers/Settings.ts create mode 100644 clientapp/src/store/reducers/WeatherForecasts.ts rename {scr/ClientApp => clientapp}/tsconfig.json (82%) create mode 100644 clientapp/yarn.lock delete mode 100644 scr/ClientApp/.eslintrc.json delete mode 100644 scr/ClientApp/.gitignore delete mode 100644 scr/ClientApp/README.md delete mode 100644 scr/ClientApp/package-lock.json delete mode 100644 scr/ClientApp/package.json delete mode 100644 scr/ClientApp/src/App.test.tsx delete mode 100644 scr/ClientApp/src/App.tsx delete mode 100644 scr/ClientApp/src/components/Counter.tsx delete mode 100644 scr/ClientApp/src/components/FetchData.tsx delete mode 100644 scr/ClientApp/src/components/Layout.tsx delete mode 100644 scr/ClientApp/src/components/NavMenu.css delete mode 100644 scr/ClientApp/src/components/NavMenu.tsx delete mode 100644 scr/ClientApp/src/custom.css delete mode 100644 scr/ClientApp/src/index.tsx delete mode 100644 scr/ClientApp/src/registerServiceWorker.ts delete mode 100644 scr/ClientApp/src/store/WeatherForecasts.ts delete mode 100644 scr/ClientApp/src/store/configureStore.ts delete mode 100644 scr/Controllers/WeatherForecastController.cs delete mode 100644 scr/Pages/Error.cshtml delete mode 100644 scr/Pages/Error.cshtml.cs delete mode 100644 scr/Pages/_ViewImports.cshtml delete mode 100644 scr/Program.cs delete mode 100644 scr/Startup.cs delete mode 100644 scr/WeatherForecast.cs delete mode 100644 scr/appsettings.Development.json delete mode 100644 scr/xxxx.csproj create mode 100644 webapi/WeatherForecast.sln create mode 100644 webapi/WeatherForecast/Controllers/WeatherForecastController.cs create mode 100644 webapi/WeatherForecast/Program.cs rename {scr => webapi/WeatherForecast}/Properties/launchSettings.json (59%) create mode 100644 webapi/WeatherForecast/WeatherForecast.cs create mode 100644 webapi/WeatherForecast/WeatherForecast.csproj create mode 100644 webapi/WeatherForecast/appsettings.Development.json rename {scr => webapi/WeatherForecast}/appsettings.json (56%) diff --git a/.gitignore b/.gitignore index 8f8b43b..362d53f 100644 --- a/.gitignore +++ b/.gitignore @@ -180,7 +180,7 @@ ClientBin/ *.publishsettings orleans.codegen.cs -/node_modules +node_modules/ # RIA/Silverlight projects Generated_Code/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..542153c --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2022, MAKS-IT (Maksym Sadovnychyy) + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3350c12 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +This project template was bootstrapped with [dotnet new reactredux](https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/react-with-redux?view=aspnetcore-6.0), using the [Redux](https://redux.js.org/) and [Redux Toolkit](https://redux-toolkit.js.org/) template. + +```bash +# NET6 + Redux + TypeScript template +dotnet new reactredux +``` + +> :warning: This repo is mirrored from [MAKS-IT/reactredux](https://git.maks-it.com/MAKS-IT/reactredux) + +## Important changes + +ClientApp was splitted from `NET6` webapi `Visual Studio` project and all pakages were updated to the latest version with following procedure: + +Install `npm-check-updates` tool +```bash +npm install -g npm-check-updates +``` + +Update the package.json +```bash +ncu --upgrade +``` + +Validate changes applied to your package.json and run yarn install to install new versions +```bash +yarn install +``` + +All refactored to use functional components. Due to some compatibility issues with new `react-router` version, the package [Connected react router](https://github.com/supasate/connected-react-router) were replaced with [Redux firs history](https://github.com/salvoravida/redux-first-history). + +## Available Scripts + +In the project directory, you can run: + +### `npm start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+You will also see any lint errors in the console. + +### `npm test` + +Launches the test runner in the interactive watch mode.
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. + +### `npm run build` + +Builds the app for production to the `build` folder.
+It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+Your app is ready to be deployed! + +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. + +### `npm run eject` + +**Note: this is a one-way operation. Once you `eject`, you can’t go back!** + +If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. + +Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. + +You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. + +## Learn More + +You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). + +To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/scr/ClientApp/.env b/clientapp/.env similarity index 100% rename from scr/ClientApp/.env rename to clientapp/.env diff --git a/clientapp/.eslintrc.json b/clientapp/.eslintrc.json new file mode 100644 index 0000000..b7d5436 --- /dev/null +++ b/clientapp/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "indent": "off", + "@typescript-eslint/indent": ["error", 2], + "semi": ["error", "never"], + "@typescript-eslint/semi": "off", + "no-unexpected-multiline": "error" + } +} \ No newline at end of file diff --git a/clientapp/.vscode/launch.json b/clientapp/.vscode/launch.json new file mode 100644 index 0000000..6f4b7e2 --- /dev/null +++ b/clientapp/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}" + }, + { + "type": "pwa-msedge", + "request": "launch", + "name": "Launch Edge against localhost", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/clientapp/package.json b/clientapp/package.json new file mode 100644 index 0000000..43ffeeb --- /dev/null +++ b/clientapp/package.json @@ -0,0 +1,59 @@ +{ + "name": "react_redux_demo", + "version": "0.1.0", + "private": true, + "dependencies": { + "bootstrap": "5.1.3", + "history": "5.2.0", + "jquery": "^3.6.0", + "merge": "^2.1.1", + "popper.js": "^1.16.0", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-redux": "7.2.6", + "react-router": "6.2.1", + "react-router-dom": "6.2.1", + "reactstrap": "9.0.1", + "redux": "4.1.2", + "redux-first-history": "^5.0.8", + "redux-thunk": "2.4.1", + "svgo": "2.8.0" + }, + "devDependencies": { + "@types/history": "4.7.11", + "@types/jest": "27.4.0", + "@types/node": "17.0.18", + "@types/react": "17.0.39", + "@types/react-dom": "17.0.11", + "@types/react-redux": "7.1.22", + "@types/react-router": "5.1.18", + "@types/react-router-dom": "5.3.3", + "@types/reactstrap": "8.7.1", + "cross-env": "7.0.3", + "eslint-plugin-jsx-a11y": "^6.5.1", + "nan": "^2.15.0", + "react-scripts": "^5.0.0", + "sass": "^1.49.7", + "typescript": "4.5.5" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "cross-env CI=true react-scripts test --env=jsdom", + "eject": "react-scripts eject", + "lint": "eslint ./src/**/*.ts ./src/**/*.tsx" + }, + "eslintConfig": { + "extends": "react-app" + }, + "resolutions": { + "url-parse": ">=1.5.0", + "lodash": ">=4.17.21" + }, + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ] +} diff --git a/scr/ClientApp/public/favicon.ico b/clientapp/public/favicon.ico similarity index 100% rename from scr/ClientApp/public/favicon.ico rename to clientapp/public/favicon.ico diff --git a/scr/ClientApp/public/index.html b/clientapp/public/index.html similarity index 97% rename from scr/ClientApp/public/index.html rename to clientapp/public/index.html index 6554346..9d2e7bb 100644 --- a/scr/ClientApp/public/index.html +++ b/clientapp/public/index.html @@ -20,7 +20,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - xxxx + react_redux_demo