Skip to content

Commit

Permalink
Add README to generated project. (#33)
Browse files Browse the repository at this point in the history
* Add README to generated project

* add logo.svg

* syntax cleanup
  • Loading branch information
eanplatter authored and gaearon committed Jul 21, 2016
1 parent 9df1c2f commit a6edb52
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 40 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"bin",
"config",
"scripts",
"src",
"index.html"
"template"
],
"bin": {
"start-react-app": "./bin/start-react-app.js",
Expand Down
14 changes: 11 additions & 3 deletions scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,21 @@ module.exports = function(hostPath, appName, verbose) {
return fs.writeFileSync(dest, fs.readFileSync(src));
}
fs.mkdirSync(path.join(hostPath, 'src'));
fs.readdirSync(path.join(selfPath, 'src')).forEach(function(filename) {
fs.readdirSync(path.join(selfPath, 'template/src')).forEach(function(filename) {
copySync(
path.join(selfPath, 'src', filename),
path.join(selfPath, 'template/src', filename),
path.join(hostPath, 'src', filename)
);
});
copySync(path.join(selfPath, 'index.html'), path.join(hostPath, 'index.html'));
fs.readdirSync(path.join(selfPath, 'template')).forEach(function(filename) {
if (fs.lstatSync(path.join(selfPath, 'template', filename)).isDirectory()) {
return
}
copySync(
path.join(selfPath, 'template', filename),
path.join(hostPath, filename)
);
});

// Run another npm install for react and react-dom
console.log('Installing react and react-dom from npm...');
Expand Down
29 changes: 29 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Getting Started

Inside that directory, you will find some helpful scripts!

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm run build`

Builds the app for production to the `build` folder.<br>
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.<br>
Your app is ready to be deployed!

### `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 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.

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.
70 changes: 35 additions & 35 deletions src/logo.svg → template/src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a6edb52

Please sign in to comment.