From 24d2fdf5fca589db44183943c53794a0304a89d1 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Wed, 12 Jan 2022 22:40:44 +1100 Subject: [PATCH] Reconstruct recipes-app by using create-react-app: create app from template, all content are wrong --- recipes-app/.babelrc | 3 - recipes-app/.gitignore | 85 +- recipes-app/.vscode/settings.json | 1 - recipes-app/README.md | 70 + recipes-app/dist/assets/bundle.js | 2 - recipes-app/dist/assets/bundle.js.LICENSE.txt | 32 - recipes-app/dist/index.html | 11 - recipes-app/dist/main.js | 32 - recipes-app/package-lock.json | 23889 ++++++++++++++-- recipes-app/package.json | 48 +- recipes-app/public/favicon.ico | Bin 0 -> 3870 bytes recipes-app/public/index.html | 43 + recipes-app/public/logo192.png | Bin 0 -> 5347 bytes recipes-app/public/logo512.png | Bin 0 -> 9664 bytes recipes-app/public/manifest.json | 25 + recipes-app/public/robots.txt | 3 + recipes-app/src/App.css | 38 + recipes-app/src/App.js | 25 + recipes-app/src/App.test.js | 8 + recipes-app/src/components/Ingredient.js | 9 - recipes-app/src/components/IngredientsList.js | 12 - recipes-app/src/components/Instructions.js | 12 - recipes-app/src/components/Menu.js | 17 - recipes-app/src/components/Recipe.js | 13 - recipes-app/src/data/recipes.json | 36 - recipes-app/src/index.css | 13 + recipes-app/src/index.js | 21 +- recipes-app/src/logo.svg | 1 + recipes-app/src/reportWebVitals.js | 13 + recipes-app/src/setupTests.js | 5 + recipes-app/webpack.config.js | 12 - 31 files changed, 22013 insertions(+), 2466 deletions(-) delete mode 100644 recipes-app/.babelrc delete mode 100644 recipes-app/.vscode/settings.json create mode 100644 recipes-app/README.md delete mode 100644 recipes-app/dist/assets/bundle.js delete mode 100644 recipes-app/dist/assets/bundle.js.LICENSE.txt delete mode 100644 recipes-app/dist/index.html delete mode 100644 recipes-app/dist/main.js create mode 100644 recipes-app/public/favicon.ico create mode 100644 recipes-app/public/index.html create mode 100644 recipes-app/public/logo192.png create mode 100644 recipes-app/public/logo512.png create mode 100644 recipes-app/public/manifest.json create mode 100644 recipes-app/public/robots.txt create mode 100644 recipes-app/src/App.css create mode 100644 recipes-app/src/App.js create mode 100644 recipes-app/src/App.test.js delete mode 100644 recipes-app/src/components/Ingredient.js delete mode 100644 recipes-app/src/components/IngredientsList.js delete mode 100644 recipes-app/src/components/Instructions.js delete mode 100644 recipes-app/src/components/Menu.js delete mode 100644 recipes-app/src/components/Recipe.js delete mode 100644 recipes-app/src/data/recipes.json create mode 100644 recipes-app/src/index.css create mode 100644 recipes-app/src/logo.svg create mode 100644 recipes-app/src/reportWebVitals.js create mode 100644 recipes-app/src/setupTests.js delete mode 100644 recipes-app/webpack.config.js diff --git a/recipes-app/.babelrc b/recipes-app/.babelrc deleted file mode 100644 index 456751f..0000000 --- a/recipes-app/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react"] -} \ No newline at end of file diff --git a/recipes-app/.gitignore b/recipes-app/.gitignore index 1e351b1..4d29575 100644 --- a/recipes-app/.gitignore +++ b/recipes-app/.gitignore @@ -1,72 +1,23 @@ -# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. -# Created by https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,react -# Edit at https://www.toptal.com/developers/gitignore?templates=windows,visualstudiocode,react +# dependencies +/node_modules +/.pnp +.pnp.js -### react ### -.DS_* -*.log -logs -**/*.backup.* -**/*.back.* +# testing +/coverage -node_modules -bower_components +# production +/build -*.sublime* - -psd -thumb -sketch - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history -.ionide - -# Support for Project snippet scope - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# End of https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,react - -# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/recipes-app/.vscode/settings.json b/recipes-app/.vscode/settings.json deleted file mode 100644 index fc03454..0000000 --- a/recipes-app/.vscode/settings.json +++ /dev/null @@ -1 +0,0 @@ -{"prettier.tabWidth": 2} \ No newline at end of file diff --git a/recipes-app/README.md b/recipes-app/README.md new file mode 100644 index 0000000..58beeac --- /dev/null +++ b/recipes-app/README.md @@ -0,0 +1,70 @@ +# Getting Started with Create React App + +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). + +## 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 your browser. + +The page will reload when you make changes.\ +You may 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/). + +### Code Splitting + +This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) + +### Analyzing the Bundle Size + +This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) + +### Making a Progressive Web App + +This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) + +### Advanced Configuration + +This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) + +### Deployment + +This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) + +### `npm run build` fails to minify + +This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) diff --git a/recipes-app/dist/assets/bundle.js b/recipes-app/dist/assets/bundle.js deleted file mode 100644 index c062d7a..0000000 --- a/recipes-app/dist/assets/bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see bundle.js.LICENSE.txt */ -(()=>{"use strict";var e={962:(e,t,n)=>{var r=n(294),l=n(935);function a(e){var t=e.amount,n=e.measurement,l=e.name;return r.createElement("li",null,t," ",n," ",l)}function o(){return o=Object.assign||function(e){for(var t=1;t{var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var o,u,i=l(e),s=1;s{var r=n(294),l=n(418),a=n(840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n