Skip to content

Commit 345d228

Browse files
committed
🍺 create-react-app create-react-redux-app
1 parent 6d395be commit 345d228

File tree

12 files changed

+5537
-0
lines changed

12 files changed

+5537
-0
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/build
11+
12+
# misc
13+
.DS_Store
14+
.env
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Create react redux app
2+
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
3+
4+
## Folder Structure
5+
6+
After creation, your project should look like this:
7+
8+
```
9+
my-app/
10+
README.md
11+
node_modules/
12+
package.json
13+
public/
14+
index.html
15+
favicon.ico
16+
src/
17+
App.css
18+
App.js
19+
App.test.js
20+
index.css
21+
index.js
22+
logo.svg
23+
```
24+
25+
For the project to build, **these files must exist with exact filenames**:
26+
27+
* `public/index.html` is the page template;
28+
* `src/index.js` is the JavaScript entry point.
29+
30+
You can delete or rename the other files.
31+
32+
You may create subdirectories inside `src`. For faster rebuilds, only files inside `src` are processed by Webpack.<br>
33+
You need to **put any JS and CSS files inside `src`**, or Webpack won’t see them.
34+
35+
Only files inside `public` can be used from `public/index.html`.<br>
36+
Read instructions below for using assets from JavaScript and HTML.
37+
38+
You can, however, create more top-level directories.<br>
39+
They will not be included in the production build so you can use them for things like documentation.
40+
41+
## Available Scripts
42+
43+
In the project directory, you can run:
44+
45+
### `npm start`
46+
47+
Runs the app in the development mode.<br>
48+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
49+
50+
The page will reload if you make edits.<br>
51+
You will also see any lint errors in the console.
52+
53+
### `npm test`
54+
55+
Launches the test runner in the interactive watch mode.<br>
56+
See the section about [running tests](#running-tests) for more information.
57+
58+
### `npm run build`
59+
60+
Builds the app for production to the `build` folder.<br>
61+
It correctly bundles React in production mode and optimizes the build for the best performance.
62+
63+
The build is minified and the filenames include the hashes.<br>
64+
Your app is ready to be deployed!
65+
66+
See the section about [deployment](#deployment) for more information.
67+
68+
### `npm run eject`
69+
70+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
71+
72+
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.
73+
74+
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.
75+
76+
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.

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "create-react-redux-app",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"react": "^15.5.4",
7+
"react-dom": "^15.5.4"
8+
},
9+
"devDependencies": {
10+
"react-scripts": "0.9.5"
11+
},
12+
"scripts": {
13+
"start": "react-scripts start",
14+
"build": "react-scripts build",
15+
"test": "react-scripts test --env=jsdom",
16+
"eject": "react-scripts eject"
17+
}
18+
}

public/favicon.ico

24.3 KB
Binary file not shown.

public/index.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
7+
<!--
8+
Notice the use of %PUBLIC_URL% in the tag above.
9+
It will be replaced with the URL of the `public` folder during the build.
10+
Only files inside the `public` folder can be referenced from the HTML.
11+
12+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
13+
work correctly both with client-side routing and a non-root public URL.
14+
Learn how to configure a non-root public URL by running `npm run build`.
15+
-->
16+
<title>React App</title>
17+
</head>
18+
<body>
19+
<div id="root"></div>
20+
<!--
21+
This HTML file is a template.
22+
If you open it directly in the browser, you will see an empty page.
23+
24+
You can add webfonts, meta tags, or analytics to this file.
25+
The build step will place the bundled scripts into the <body> tag.
26+
27+
To begin the development, run `npm start`.
28+
To create a production bundle, use `npm run build`.
29+
-->
30+
</body>
31+
</html>

src/App.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
animation: App-logo-spin infinite 20s linear;
7+
height: 80px;
8+
}
9+
10+
.App-header {
11+
background-color: #222;
12+
height: 150px;
13+
padding: 20px;
14+
color: white;
15+
}
16+
17+
.App-intro {
18+
font-size: large;
19+
}
20+
21+
@keyframes App-logo-spin {
22+
from { transform: rotate(0deg); }
23+
to { transform: rotate(360deg); }
24+
}

src/App.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, { Component } from 'react';
2+
import logo from './logo.svg';
3+
import './App.css';
4+
5+
class App extends Component {
6+
render() {
7+
return (
8+
<div className="App">
9+
<div className="App-header">
10+
<img src={logo} className="App-logo" alt="logo" />
11+
<h2>Welcome to React</h2>
12+
</div>
13+
<p className="App-intro">
14+
To get started, edit <code>src/App.js</code> and save to reload.
15+
</p>
16+
</div>
17+
);
18+
}
19+
}
20+
21+
export default App;

src/App.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
4+
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div');
7+
ReactDOM.render(<App />, div);
8+
});

src/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: sans-serif;
5+
}

src/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
4+
import './index.css';
5+
6+
ReactDOM.render(
7+
<App />,
8+
document.getElementById('root')
9+
);

0 commit comments

Comments
 (0)