I wrote a few BASH scripts to help in the Git and React World
All instructions are in the README
File 1 - Bash Aliases - to make your life easier...
Script 1 - setup-react.sh
- Asks for an app name and creates it in the current folder
- Installs react-router and react-router-dom
- Creates a file / folder structure:
configs/AppRouter.jsx
configs/PrivateRoute.jsx
components/reuse/NavBar.jsx
components/pages/Header.jsx
components/pages/Footer.jsx
pages/user/Home.jsx
pages/user/Contact.jsx
pages/user/About.jsx
- Writes the Routes for the pages and puts content into each of them
- Rewrites the App.js file to contain:
<Header />
<AppRouter />
<Footer />
- Rewrites index.js to wrap the App component in BrowserRouter
Script 2 - Git Create Branch
- Asks for branch name
- Creates a new branch
- Sets the upstream for the branch
Script 3 -- Git Deploy
- Asks for a Commit message
- Adds files
- Commits files with commit message
- Pushes files to current branch as long as the upstream is set
Script 4 - Clean Node Modules
- Digs down deep to remove node modules folders
Top comments (0)