diff --git a/package.json b/package.json index 85f7f7f9afa..7be99b82886 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,7 @@ "bin", "config", "scripts", - "src", - "index.html" + "template" ], "bin": { "start-react-app": "./bin/start-react-app.js", diff --git a/scripts/init.js b/scripts/init.js index aa7e8577279..8c8366dc8ec 100644 --- a/scripts/init.js +++ b/scripts/init.js @@ -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...'); diff --git a/template/README.md b/template/README.md new file mode 100644 index 00000000000..bd4d6cb23f6 --- /dev/null +++ b/template/README.md @@ -0,0 +1,29 @@ +## Getting Started + +Inside that directory, you will find some helpful scripts! + +### `npm start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+You will also see any lint errors in the console. + +### `npm run build` + +Builds the app for production to the `build` folder.
+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.
+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. diff --git a/index.html b/template/index.html similarity index 100% rename from index.html rename to template/index.html diff --git a/src/App.css b/template/src/App.css similarity index 100% rename from src/App.css rename to template/src/App.css diff --git a/src/App.js b/template/src/App.js similarity index 100% rename from src/App.js rename to template/src/App.js diff --git a/src/index.css b/template/src/index.css similarity index 100% rename from src/index.css rename to template/src/index.css diff --git a/src/index.js b/template/src/index.js similarity index 100% rename from src/index.js rename to template/src/index.js diff --git a/src/logo.svg b/template/src/logo.svg similarity index 98% rename from src/logo.svg rename to template/src/logo.svg index 5592ebec6d6..467e1dc026c 100644 --- a/src/logo.svg +++ b/template/src/logo.svg @@ -1,35 +1,35 @@ - - - - - - - - - - - + + + + + + + + + + +