Skip to content

Add README to generated project. #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.