Skip to content

Commit a6edb52

Browse files
eanplattergaearon
authored andcommitted
Add README to generated project. (#33)
* Add README to generated project * add logo.svg * syntax cleanup
1 parent 9df1c2f commit a6edb52

File tree

9 files changed

+76
-40
lines changed

9 files changed

+76
-40
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"bin",
1919
"config",
2020
"scripts",
21-
"src",
22-
"index.html"
21+
"template"
2322
],
2423
"bin": {
2524
"start-react-app": "./bin/start-react-app.js",

scripts/init.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,21 @@ module.exports = function(hostPath, appName, verbose) {
4040
return fs.writeFileSync(dest, fs.readFileSync(src));
4141
}
4242
fs.mkdirSync(path.join(hostPath, 'src'));
43-
fs.readdirSync(path.join(selfPath, 'src')).forEach(function(filename) {
43+
fs.readdirSync(path.join(selfPath, 'template/src')).forEach(function(filename) {
4444
copySync(
45-
path.join(selfPath, 'src', filename),
45+
path.join(selfPath, 'template/src', filename),
4646
path.join(hostPath, 'src', filename)
4747
);
4848
});
49-
copySync(path.join(selfPath, 'index.html'), path.join(hostPath, 'index.html'));
49+
fs.readdirSync(path.join(selfPath, 'template')).forEach(function(filename) {
50+
if (fs.lstatSync(path.join(selfPath, 'template', filename)).isDirectory()) {
51+
return
52+
}
53+
copySync(
54+
path.join(selfPath, 'template', filename),
55+
path.join(hostPath, filename)
56+
);
57+
});
5058

5159
// Run another npm install for react and react-dom
5260
console.log('Installing react and react-dom from npm...');

template/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Getting Started
2+
3+
Inside that directory, you will find some helpful scripts!
4+
5+
### `npm start`
6+
7+
Runs the app in the development mode.<br>
8+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
9+
10+
The page will reload if you make edits.<br>
11+
You will also see any lint errors in the console.
12+
13+
### `npm run build`
14+
15+
Builds the app for production to the `build` folder.<br>
16+
It correctly bundles React in production mode and optimizes the build for the best performance.
17+
18+
The build is minified and the filenames include the hashes.<br>
19+
Your app is ready to be deployed!
20+
21+
### `npm run eject`
22+
23+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
24+
25+
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.
26+
27+
Instead, it will copy all the configuration files and the transient 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.
28+
29+
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 35 additions & 35 deletions
Loading

0 commit comments

Comments
 (0)