-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakeReactApp.sh
95 lines (76 loc) · 1.89 KB
/
MakeReactApp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
ProjectName=$1
echo Checking if project directory exists...
if [ ! -d "$ProjectName" ]; then
echo Could not find the project directory... Making directory
mkdir $ProjectName
echo Switching context to project directory...
cd $ProjectName
else
echo Switching to project directory...
cd $ProjectName
fi
echo Initilizing NPM
npm init -y
echo Making Source Directory
mkdir src
echo Creating babelrc file
cat >.babelrc <<EOL
{
"plugins": ["react-hot-loader/babel", ["transform-runtime", {
"polyfill": false,
"regenerator": true
}]],
"presets": ["env", "react"]
}
EOL
echo Creating Template index.html
cat >src/index.html <<EOL
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ReactApp</title>
</head>
<body>
<section id="index"></section>
</body>
</html>
EOL
echo Creating Template index.js
cat >src/index.js <<EOL
console.log('I will be made into an awesome React app someday!');
EOL
echo Installing Webpack and Dev Dependencies
npm i webpack webpack-cli -D
echo Installing React and Babel
npm i react react-dom -S
npm i babel-core babel-loader babel-preset-env babel-preset-react -D
echo Installing Webpack Plugin
npm i html-webpack-plugin -D
npm i webpack-dev-server -D
echo Installing Storybook
npm i -g @storybook/cli
getstorybook
echo Adding Internationalization Support
yarn add react-intl
echo Adding Material UI
yarn add material-ui@next
yarn add @material-ui/icons
echo Adding redux
yarn add react-redux
yarn add redux-devtools -D
yarn add immutable
yarn add redux-immutable
yarn add reselect
echo Adding LoDash
yarn add lodash
echo Adding Sagas
yarn add redux-saga
yarn add react-hot-loader
yarn add babel-runtime
yarn add babel-plugin-transform-runtime -D
echo Adding WhatWg
yarn add whatwg-fetch