Skip to content

Commit

Permalink
Merge branch 'master' of github.com:facebookincubator/create-react-ap…
Browse files Browse the repository at this point in the history
…p into add-stylelint

* 'master' of github.com:facebookincubator/create-react-app:
  Fix a bad condition
  Only show first error (facebook#2125)
  Make error box messages friendlier (facebook#2123)
  Bump React in development (facebook#2122)
  disable ignoring unused vars prefixed with _ (facebook#1763)
  Adds tests for the overlay (facebook#2118)
  Omit ESLint warnings when there are ESLint errors (facebook#2120)
  Default to 0.0.0.0 (facebook#2117)
  Add `react-error-overlay` package (facebook#2111)
  Do not parse `.eslintignore` (facebook#2115)
  Prettify errors and warnings for Webpack 2 (facebook#2113)
  Bump minimal Node version to 6 (facebook#1897)
  Minor tweaks for crash overlay (facebook#2101)
  Revert "Forbid using window properties as global variables" (facebook#2099)
  Ignore the yarn cache directory (facebook#2063)
  Forbid using window properties as global variables (facebook#1840)
  Fixed documentation link for storybook in README.md (facebook#2081)
  Temporarily pin Yarn to fix CI
  Fix instructions for serving with now (facebook#2052)
  • Loading branch information
karlhorky committed May 12, 2017
2 parents 8d8b494 + 2b59654 commit 80f2116
Show file tree
Hide file tree
Showing 85 changed files with 86,594 additions and 1,255 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
language: node_js
node_js:
- 4
- 6
- 7
cache:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ Install it once globally:
npm install -g create-react-app
```

**You’ll need to have Node >= 4 on your machine**.

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

**This tool doesn’t assume a Node backend**. The Node installation is only required for Create React App itself.

Expand Down
6 changes: 0 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ environment:
test_suite: "installs"
- nodejs_version: 6
test_suite: "kitchensink"
- nodejs_version: 4
test_suite: "simple"
- nodejs_version: 4
test_suite: "installs"
- nodejs_version: 4
test_suite: "kitchensink"

cache:
- node_modules -> appveyor.cleanup-cache.txt
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"changelog": "lerna-changelog",
"create-react-app": "tasks/cra.sh",
"e2e": "tasks/e2e-simple.sh",
"postinstall": "lerna bootstrap",
"postinstall": "lerna bootstrap && cd packages/react-error-overlay/ && npm run build:prod",
"publish": "tasks/release.sh",
"start": "node packages/react-scripts/scripts/start.js",
"test": "node packages/react-scripts/scripts/test.js --env=jsdom",
Expand Down
25 changes: 12 additions & 13 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// tell people to update their global version of create-react-app.
//
// Also be careful with new language features.
// This file must work on Node 4+.
// This file must work on Node 6+.
//
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// /!\ DO NOT MODIFY THIS FILE /!\
Expand Down Expand Up @@ -398,24 +398,23 @@ function getPackageName(installPackage) {
}

function checkNpmVersion() {
let isNpm2 = false;
let hasMinNpm = false;
try {
const npmVersion = execSync('npm --version').toString();
isNpm2 = semver.lt(npmVersion, '3.0.0');
hasMinNpm = semver.gte(npmVersion, '3.0.0');
} catch (err) {
return;
}
if (!isNpm2) {
return;

if (!hasMinNpm) {
console.error(
chalk.red(
'Create React App requires npm 3 or higher. \n' +
'Please update your version of npm.'
)
);
process.exit(1);
}
console.log(chalk.yellow('It looks like you are using npm 2.'));
console.log(
chalk.yellow(
'We suggest using npm 3 or Yarn for faster install times ' +
'and less disk space usage.'
)
);
console.log();
}

function checkNodeVersion(packageName) {
Expand Down
7 changes: 5 additions & 2 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@
var chalk = require('chalk');

var currentNodeVersion = process.versions.node;
if (currentNodeVersion.split('.')[0] < 4) {
var semver = currentNodeVersion.split('.');
var major = semver[0];

if (major < 6) {
console.error(
chalk.red(
'You are running Node ' +
currentNodeVersion +
'.\n' +
'Create React App requires Node 4 or higher. \n' +
'Create React App requires Node 6 or higher. \n' +
'Please update your version of Node.'
)
);
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"repository": "facebookincubator/create-react-app",
"license": "BSD-3-Clause",
"engines": {
"node": ">=4"
"node": ">=6"
},
"bugs": {
"url": "https://github.com/facebookincubator/create-react-app/issues"
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ module.exports = {
'no-unused-vars': [
'warn',
{
vars: 'local',
varsIgnorePattern: '^_',
args: 'none',
ignoreRestSiblings: true,
},
Expand Down
Loading

0 comments on commit 80f2116

Please sign in to comment.