Skip to content

Commit b8a2b98

Browse files
author
Kevin Lacker
authored
Merge pull request #26 from lacker/master
update misc docs + copy
2 parents a73ebe8 + c760693 commit b8a2b98

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ npm install -g create-react-app
1919

2020
**You’ll need to have Node >= 4 on your machine**. We recommend to use Node >= 6 and npm >= 3 for faster installation speed and better disk usage. You can use [n](https://github.com/creationix/nvm#usage) to easily switch the Node versions between different projects.
2121

22-
**This tool doesn’t assume a Node backend**. The Node installation is only required for the build tools that rely on it locally, such as Webpack and Babel. The output folder includes an `index.html` and a minified `.js` bundle so you can host them anywhere you like.
22+
**This tool doesn’t assume a Node backend**. The Node installation is only required for the build tools that rely on it locally, such as Webpack and Babel. The output folder includes an `index.html`, a minified `.js` bundle, and bundled images and css, so you can host them anywhere you like.
2323

2424
## Why Use This?
2525

26-
**If you’re getting started** with React, use this tool to automate the build of your app. You can get an app running with React, JSX, and ES6 in minutes. You don’t have to learn the configuration format of Babel, Webpack, and ESLint, or manage their versions. There is no configuration file, and this tool is the only build dependency in your `package.json`.
26+
**If you’re getting started** with React, use `create-react-app` to automate the build of your app. There is no configuration file, and `react-scripts` is the only extra build dependency in your `package.json`. Your environment will have everything you need to build a modern React app:
27+
28+
* React, JSX, and ES6 support
29+
* Language extras beyond ES6 like the object spread operator
30+
* A dev server that lints for common errors
31+
* Import css and image files directly from JavaScript
32+
* Autoprefixed CSS, so you don't need `-webkit` or other prefixes
33+
* A `build` script to bundle js, css, and images for production, with sourcemaps
2734

2835
**The feature set is intentionally limited**. It doesn’t support advanced features such as server rendering or CSS modules. Currently, it doesn’t support testing either. The tool is also **non-configurable** because it is hard to provide a cohesive experience and easy updates across a set of tools when the user can tweak anything.
2936

@@ -84,7 +91,7 @@ Currently it is a thin layer on top of many amazing community projects, such as:
8491

8592
All of them are transient dependencies of the provided npm package.
8693

87-
## Contibuting
94+
## Contributing
8895

8996
Clone the repo and run `npm install` in the root and the `global-cli` folder.
9097

global-cli/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var argv = require('minimist')(process.argv.slice(2));
5555
var commands = argv._;
5656
if (commands.length === 0) {
5757
console.error(
58-
'Usage: create-react-app <project-name> [--verbose]'
58+
'Usage: create-react-app <project-directory> [--verbose]'
5959
);
6060
process.exit(1);
6161
}
@@ -69,7 +69,7 @@ createApp(commands[0], argv.verbose, argv['scripts-version']);
6969

7070
function createApp(name, verbose, version) {
7171
if (fs.existsSync(name)) {
72-
console.log('Directory `' + name + '` already exists. Aborting.');
72+
console.log('The directory `' + name + '` already exists. Aborting.');
7373
process.exit(1);
7474
}
7575

@@ -91,9 +91,8 @@ function createApp(name, verbose, version) {
9191
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson));
9292
process.chdir(root);
9393

94-
console.log('Installing react-scripts package from npm...');
95-
console.log('This might take a while! ⌛');
96-
console.log();
94+
console.log('Installing packages. This might take a couple minutes. ⌛');
95+
console.log('Installing react-scripts from npm...');
9796

9897
run(root, appName, version, verbose);
9998
}

scripts/init.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ module.exports = function(hostPath, appName, verbose) {
4949
copySync(path.join(selfPath, 'index.html'), path.join(hostPath, 'index.html'));
5050

5151
// Run another npm install for react and react-dom
52+
console.log('Installing react and react-dom from npm...');
5253
// TODO: having to do two npm installs is bad, can we avoid it?
5354
var args = [
5455
'install',
@@ -61,15 +62,23 @@ module.exports = function(hostPath, appName, verbose) {
6162
return;
6263
}
6364

65+
// Make sure to display the right way to cd
66+
var cdpath;
67+
if (path.join(process.cwd(), appName) == hostPath) {
68+
cdpath = appName;
69+
} else {
70+
cdpath = hostPath;
71+
}
72+
6473
console.log('Success! Created ' + appName + ' at ' + hostPath + '.');
6574
console.log();
6675
console.log('Inside that directory, you can run several commands:');
6776
console.log(' * npm start: Starts the development server.');
68-
console.log(' * npm run build: Builds the app for production.');
77+
console.log(' * npm run build: Bundles the app into static files for production.');
6978
console.log(' * npm run eject: Removes this tool. If you do this, you can’t go back!');
7079
console.log();
7180
console.log('We suggest that you begin by typing:');
72-
console.log(' cd', appName);
81+
console.log(' cd', cdpath);
7382
console.log(' npm start');
7483
console.log();
7584
console.log('Happy hacking!');

scripts/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ new WebpackDevServer(webpack(config), {
3838
if (err) {
3939
return console.log(err);
4040
}
41-
console.log('Listening at http://localhost:3000/');
41+
console.log('Running development server at http://localhost:3000/');
4242

4343
opn('http://localhost:3000/');
4444
});

0 commit comments

Comments
 (0)