From 73e3d0ebf1f2834e1c8c41d3a25ae5e0e99e6f14 Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Fri, 4 Jan 2019 11:02:24 -0800 Subject: [PATCH 01/39] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7599943de0b..763083ccd08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## 2.1.3 (January 4, 2019) +v2.1.3 is a maintenance release to fix a [vulnerability in webpack-dev-server](https://www.npmjs.com/advisories/725). + #### :memo: Documentation - Other From 3e1dc990130c45f57c647e847682ded0ba352c7b Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 6 Jan 2019 13:13:20 -0500 Subject: [PATCH 02/39] Fix CI and upgrade dependencies (#6137) * Upgrade a bunch of dependencies * Turn off nightly Yarn --- .travis.yml | 2 +- appveyor.yml | 2 +- package.json | 2 +- packages/babel-preset-react-app/package.json | 32 ++++++++++---------- packages/react-app-polyfill/package.json | 4 +-- packages/react-dev-utils/package.json | 18 +++++------ packages/react-error-overlay/package.json | 16 +++++----- packages/react-scripts/package.json | 26 ++++++++-------- 8 files changed, 51 insertions(+), 51 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe543211f32..fd0ba53313b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: directories: - .npm before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly + - curl -o- -L https://yarnpkg.com/install.sh | bash -s - export PATH="$HOME/.yarn/bin:$PATH" install: true script: diff --git a/appveyor.yml b/appveyor.yml index 5f5143167d6..ab266ab976e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,7 +37,7 @@ platform: install: - ps: Install-Product node $env:nodejs_version $env:platform - ps: | - (New-Object Net.WebClient).DownloadFile("https://nightly.yarnpkg.com/latest.msi", "$env:temp\yarn.msi") + (New-Object Net.WebClient).DownloadFile("https://yarnpkg.com/latest.msi", "$env:temp\yarn.msi") cmd /c start /wait msiexec.exe /i $env:temp\yarn.msi /quiet /qn /norestart build: off diff --git a/package.json b/package.json index f3942e6df30..fdea26c2b93 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "compile:lockfile": "node tasks/compile-lockfile.js" }, "devDependencies": { - "eslint": "5.6.0", + "eslint": "5.12.0", "execa": "1.0.0", "fs-extra": "^7.0.0", "get-port": "^4.0.0", diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index d5448b0b163..c8050d43ddd 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -17,24 +17,24 @@ "test.js" ], "dependencies": { - "@babel/core": "7.1.6", - "@babel/plugin-proposal-class-properties": "7.1.0", - "@babel/plugin-proposal-decorators": "7.1.6", - "@babel/plugin-proposal-object-rest-spread": "7.0.0", - "@babel/plugin-syntax-dynamic-import": "7.0.0", - "@babel/plugin-transform-classes": "7.1.0", - "@babel/plugin-transform-destructuring": "7.1.3", - "@babel/plugin-transform-flow-strip-types": "7.1.6", - "@babel/plugin-transform-react-constant-elements": "7.0.0", - "@babel/plugin-transform-react-display-name": "7.0.0", - "@babel/plugin-transform-runtime": "7.1.0", - "@babel/preset-env": "7.1.6", + "@babel/core": "7.2.2", + "@babel/plugin-proposal-class-properties": "7.2.3", + "@babel/plugin-proposal-decorators": "7.2.3", + "@babel/plugin-proposal-object-rest-spread": "7.2.0", + "@babel/plugin-syntax-dynamic-import": "7.2.0", + "@babel/plugin-transform-classes": "7.2.2", + "@babel/plugin-transform-destructuring": "7.2.0", + "@babel/plugin-transform-flow-strip-types": "7.2.3", + "@babel/plugin-transform-react-constant-elements": "7.2.0", + "@babel/plugin-transform-react-display-name": "7.2.0", + "@babel/plugin-transform-runtime": "7.2.0", + "@babel/preset-env": "7.2.3", "@babel/preset-react": "7.0.0", "@babel/preset-typescript": "7.1.0", - "@babel/runtime": "7.1.5", - "babel-loader": "8.0.4", + "@babel/runtime": "7.2.0", + "babel-loader": "8.0.5", "babel-plugin-dynamic-import-node": "2.2.0", - "babel-plugin-macros": "2.4.2", - "babel-plugin-transform-react-remove-prop-types": "0.4.20" + "babel-plugin-macros": "2.4.4", + "babel-plugin-transform-react-remove-prop-types": "0.4.21" } } diff --git a/packages/react-app-polyfill/package.json b/packages/react-app-polyfill/package.json index d7d46e7e21a..456a9863de9 100644 --- a/packages/react-app-polyfill/package.json +++ b/packages/react-app-polyfill/package.json @@ -16,10 +16,10 @@ "jsdom.js" ], "dependencies": { - "core-js": "2.5.7", + "core-js": "2.6.1", "object-assign": "4.1.1", "promise": "8.0.2", - "raf": "3.4.0", + "raf": "3.4.1", "whatwg-fetch": "3.0.0" } } diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 16b1ab823be..9a1a377935e 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -46,32 +46,32 @@ "dependencies": { "@babel/code-frame": "7.0.0", "address": "1.0.3", - "browserslist": "4.1.1", - "chalk": "2.4.1", + "browserslist": "4.3.7", + "chalk": "2.4.2", "cross-spawn": "6.0.5", "detect-port-alt": "1.1.6", "escape-string-regexp": "1.0.5", "filesize": "3.6.1", "find-up": "3.0.0", - "global-modules": "1.0.0", + "global-modules": "2.0.0", "globby": "8.0.1", "gzip-size": "5.0.0", - "immer": "1.7.2", - "inquirer": "6.2.0", + "immer": "1.10.0", + "inquirer": "6.2.1", "is-root": "2.0.0", - "loader-utils": "1.1.0", + "loader-utils": "1.2.3", "opn": "5.4.0", "pkg-up": "2.0.0", "react-error-overlay": "^5.1.2", "recursive-readdir": "2.2.2", "shell-quote": "1.6.1", - "sockjs-client": "1.1.5", - "strip-ansi": "4.0.0", + "sockjs-client": "1.3.0", + "strip-ansi": "5.0.0", "text-table": "0.2.0" }, "devDependencies": { "cross-env": "^5.2.0", - "jest": "23.6.0" + "jest": "^23.6.0" }, "scripts": { "test": "cross-env FORCE_COLOR=true jest" diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index 743bb4487c7..1a3166657da 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -31,22 +31,22 @@ ], "devDependencies": { "@babel/code-frame": "7.0.0", - "@babel/core": "7.1.0", - "anser": "1.4.7", + "@babel/core": "7.2.2", + "anser": "1.4.8", "babel-core": "7.0.0-bridge.0", "babel-eslint": "9.0.0", "babel-jest": "23.6.0", - "babel-loader": "8.0.4", + "babel-loader": "8.0.5", "babel-preset-react-app": "^7.0.0", - "chalk": "^2.3.2", + "chalk": "^2.4.2", "chokidar": "^2.0.2", "cross-env": "5.2.0", - "eslint": "5.6.0", + "eslint": "5.12.0", "eslint-config-react-app": "^3.0.6", "eslint-plugin-flowtype": "2.50.1", "eslint-plugin-import": "2.14.0", - "eslint-plugin-jsx-a11y": "6.1.1", - "eslint-plugin-react": "7.11.1", + "eslint-plugin-jsx-a11y": "6.1.2", + "eslint-plugin-react": "7.12.3", "flow-bin": "^0.63.1", "html-entities": "1.2.1", "jest": "23.6.0", @@ -60,7 +60,7 @@ "rimraf": "^2.6.2", "settle-promise": "1.0.0", "source-map": "0.5.6", - "terser-webpack-plugin": "1.1.0", + "terser-webpack-plugin": "1.2.1", "webpack": "^4.8.1" }, "jest": { diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index c19236b9fc7..21471be46d4 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -24,21 +24,21 @@ }, "types": "./lib/react-app.d.ts", "dependencies": { - "@babel/core": "7.1.6", + "@babel/core": "7.2.2", "@svgr/webpack": "2.4.1", "babel-core": "7.0.0-bridge.0", "babel-eslint": "9.0.0", "babel-jest": "23.6.0", - "babel-loader": "8.0.4", + "babel-loader": "8.0.5", "babel-plugin-named-asset-import": "^0.3.0", "babel-preset-react-app": "^7.0.0", "bfj": "6.1.1", "case-sensitive-paths-webpack-plugin": "2.1.2", - "chalk": "2.4.1", + "chalk": "2.4.2", "css-loader": "1.0.0", "dotenv": "6.0.0", "dotenv-expand": "4.2.0", - "eslint": "5.6.0", + "eslint": "5.12.0", "eslint-config-react-app": "^3.0.6", "eslint-loader": "2.1.1", "eslint-plugin-flowtype": "2.50.1", @@ -47,27 +47,27 @@ "eslint-plugin-react": "7.11.1", "file-loader": "2.0.0", "fork-ts-checker-webpack-plugin-alt": "0.4.14", - "fs-extra": "7.0.0", + "fs-extra": "7.0.1", "html-webpack-plugin": "4.0.0-alpha.2", "identity-obj-proxy": "3.0.0", "jest": "23.6.0", - "jest-pnp-resolver": "1.0.1", + "jest-pnp-resolver": "1.0.2", "jest-resolve": "23.6.0", "mini-css-extract-plugin": "0.4.3", "optimize-css-assets-webpack-plugin": "5.0.1", - "pnp-webpack-plugin": "1.1.0", + "pnp-webpack-plugin": "1.2.1", "postcss-flexbugs-fixes": "4.1.0", "postcss-loader": "3.0.0", - "postcss-preset-env": "6.3.1", + "postcss-preset-env": "6.5.0", "postcss-safe-parser": "4.0.1", "react-app-polyfill": "^0.2.0", "react-dev-utils": "^7.0.1", - "resolve": "1.8.1", + "resolve": "1.9.0", "sass-loader": "7.1.0", - "style-loader": "0.23.0", - "terser-webpack-plugin": "1.1.0", - "url-loader": "1.1.1", - "webpack": "4.19.1", + "style-loader": "0.23.1", + "terser-webpack-plugin": "1.2.1", + "url-loader": "1.1.2", + "webpack": "4.28.3", "webpack-dev-server": "3.1.14", "webpack-manifest-plugin": "2.0.4", "workbox-webpack-plugin": "3.6.3" From 005ee5b9525d476d2eb2dfb5b8afcd15b65dd5d2 Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Sun, 6 Jan 2019 15:05:14 -0800 Subject: [PATCH 03/39] Bump eslint-plugin-react version and update webpack config (#6132) * Bump eslint-plugin-react version * Move eslint-plugin-react settings into eslint-config-react-app * Add react/no-typos rule --- packages/eslint-config-react-app/index.js | 7 +++++++ packages/react-scripts/config/webpack.config.js | 1 - packages/react-scripts/package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index ca232b879ec..f83ed06a104 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -46,6 +46,12 @@ module.exports = { }, }, + settings: { + react: { + version: 'detect', + }, + }, + rules: { // http://eslint.org/docs/rules/ 'array-callback-return': 'warn', @@ -205,6 +211,7 @@ module.exports = { // 'react/no-deprecated': 'warn', 'react/no-direct-mutation-state': 'warn', 'react/no-is-mounted': 'warn', + 'react/no-typos': 'error', 'react/react-in-jsx-scope': 'error', 'react/require-render-return': 'error', 'react/style-prop-object': 'warn', diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 3696597fb44..7699d2cb040 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -314,7 +314,6 @@ module.exports = function(webpackEnv) { // @remove-on-eject-begin baseConfig: { extends: [require.resolve('eslint-config-react-app')], - settings: { react: { version: '999.999.999' } }, }, ignore: false, useEslintrc: false, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 21471be46d4..0a94c39bd2d 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -44,7 +44,7 @@ "eslint-plugin-flowtype": "2.50.1", "eslint-plugin-import": "2.14.0", "eslint-plugin-jsx-a11y": "6.1.2", - "eslint-plugin-react": "7.11.1", + "eslint-plugin-react": "7.12.3", "file-loader": "2.0.0", "fork-ts-checker-webpack-plugin-alt": "0.4.14", "fs-extra": "7.0.1", From 773d10398675ecaa60f3e3d5e0cc731c3de4a918 Mon Sep 17 00:00:00 2001 From: Jason Laster Date: Sun, 6 Jan 2019 22:42:05 -0500 Subject: [PATCH 04/39] Switch to eval-source-map (#5060) Switches to eval-source-map, which is easier for webpack to recompute when a file changes and has column based mappings, which lets firefox devtools show original variable in the debugger and evaluate original expressions in the console. --- packages/react-scripts/config/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 7699d2cb040..ed85b555ea6 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -131,7 +131,7 @@ module.exports = function(webpackEnv) { ? shouldUseSourceMap ? 'source-map' : false - : isEnvDevelopment && 'cheap-module-source-map', + : isEnvDevelopment && 'eval-source-map', // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. entry: [ From ddf294159fbee9513ad1c96aaa318df977a6b97f Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Mon, 7 Jan 2019 07:53:08 -0800 Subject: [PATCH 05/39] Remove extra table cell (#6141) --- docusaurus/docs/advanced-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/advanced-configuration.md b/docusaurus/docs/advanced-configuration.md index c991fd72edb..343740b9a5a 100644 --- a/docusaurus/docs/advanced-configuration.md +++ b/docusaurus/docs/advanced-configuration.md @@ -17,4 +17,4 @@ You can adjust various development and production settings by setting environmen | CHOKIDAR_USEPOLLING | ✅ Used | 🚫 Ignored | When set to `true`, the watcher runs in polling mode, as necessary inside a VM. Use this option if `npm start` isn't detecting changes. | | GENERATE_SOURCEMAP | 🚫 Ignored | ✅ Used | When set to `false`, source maps are not generated for a production build. This solves OOM issues on some smaller machines. | | NODE_PATH | ✅ Used | ✅ Used | Same as [`NODE_PATH` in Node.js](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders), but only relative folders are allowed. Can be handy for emulating a monorepo setup by setting `NODE_PATH=src`. | -| INLINE_RUNTIME_CHUNK | 🚫 Ignored | ✅ Used | By default, Create React App will embed the runtime script into `index.html` during the production build. When set to `false`, the script will not be embedded and will be imported as usual. This is normally required when dealing with CSP. | | +| INLINE_RUNTIME_CHUNK | 🚫 Ignored | ✅ Used | By default, Create React App will embed the runtime script into `index.html` during the production build. When set to `false`, the script will not be embedded and will be imported as usual. This is normally required when dealing with CSP. | From caf0effda5f036f454b5a208030adb35138d9e4e Mon Sep 17 00:00:00 2001 From: loveky Date: Tue, 8 Jan 2019 23:36:06 +0800 Subject: [PATCH 06/39] update link for difference between proposal stages (#6149) seems the page which the old link points to has removed the related information. --- docusaurus/docs/supported-browsers-features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/supported-browsers-features.md b/docusaurus/docs/supported-browsers-features.md index f38042f2515..a8e0875c355 100644 --- a/docusaurus/docs/supported-browsers-features.md +++ b/docusaurus/docs/supported-browsers-features.md @@ -19,7 +19,7 @@ This project supports a superset of the latest JavaScript standard. In addition - [Class Fields and Static Properties](https://github.com/tc39/proposal-class-public-fields) (part of stage 3 proposal). - [JSX](https://facebook.github.io/react/docs/introducing-jsx.html), [Flow](./adding-flow) and [TypeScript](./adding-typescript). -Learn more about [different proposal stages](https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-). +Learn more about [different proposal stages](https://tc39.github.io/process-document/). While we recommend using experimental proposals with some caution, Facebook heavily uses these features in the product code, so we intend to provide [codemods](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) if any of these proposals change in the future. From 6e261f8a06809880bfc90e36f5e295598abdbc20 Mon Sep 17 00:00:00 2001 From: David Rice Date: Wed, 9 Jan 2019 13:24:03 -0600 Subject: [PATCH 07/39] Update react-dev-util globby dependency to v8.0.2 (#6162) v8.0.2 was recently released https://github.com/sindresorhus/globby/releases to fix some pathing issues with dir-glob. --- packages/react-dev-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 9a1a377935e..3e5d75eabb7 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -54,7 +54,7 @@ "filesize": "3.6.1", "find-up": "3.0.0", "global-modules": "2.0.0", - "globby": "8.0.1", + "globby": "8.0.2", "gzip-size": "5.0.0", "immer": "1.10.0", "inquirer": "6.2.1", From 2741781bc6095a43bb79cc259a416075efb915ff Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Wed, 9 Jan 2019 13:16:09 -0800 Subject: [PATCH 08/39] Add note for global install of CLI (#6157) * Add note for global install of CLI Closes #6140. --- docusaurus/docs/getting-started.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docusaurus/docs/getting-started.md b/docusaurus/docs/getting-started.md index c7d5eb50514..a77beb5c1b0 100644 --- a/docusaurus/docs/getting-started.md +++ b/docusaurus/docs/getting-started.md @@ -14,6 +14,8 @@ cd my-app npm start ``` +> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that `npx` always uses the latest version. + _([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_ Then open [http://localhost:3000/](http://localhost:3000/) to see your app. From c8a540d9a105284f311eb6c932048a9077209a01 Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Thu, 10 Jan 2019 21:17:09 -0800 Subject: [PATCH 09/39] Add react/react-dom dependencies to relative-paths test fixture (#6165) --- test/fixtures/relative-paths/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fixtures/relative-paths/package.json b/test/fixtures/relative-paths/package.json index 64d2bb6dd27..749103ac36a 100644 --- a/test/fixtures/relative-paths/package.json +++ b/test/fixtures/relative-paths/package.json @@ -1,4 +1,7 @@ { - "dependencies": {}, + "dependencies": { + "react": "latest", + "react-dom": "latest" + }, "homepage": "." } From 132ac3523f94d31d6eb27e875ea1a56c1e9e0566 Mon Sep 17 00:00:00 2001 From: Dallon Feldner Date: Fri, 11 Jan 2019 17:35:13 -0600 Subject: [PATCH 10/39] Update local-test.sh to return test exit code (#6179) The `e2e:docker` command can run tests in a Docker container, but it always returns exit code 0 even if the tests failed. This PR resolves that and returns the exit code from the test command. --- tasks/local-test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/local-test.sh b/tasks/local-test.sh index 43a74ae0ec5..75bdd2987a7 100755 --- a/tasks/local-test.sh +++ b/tasks/local-test.sh @@ -98,8 +98,15 @@ ${apply_changes} node --version npm --version set +x -${test_command} && echo -e "\n\e[1;32m✔ Job passed\e[0m" || echo -e "\n\e[1;31m✘ Job failed\e[0m" +${test_command} +result_code=\$? +if [ \$result_code == 0 ]; then + echo -e "\n\e[1;32m✔ Job passed\e[0m" +else + echo -e "\n\e[1;31m✘ Job failed\e[0m" +fi $([[ ${interactive} == 'true' ]] && echo 'bash') +exit \$result_code CMD docker run \ From 8174eed5b31cc43b34b4bc0e4f44a04acea33465 Mon Sep 17 00:00:00 2001 From: Adam Laycock Date: Fri, 11 Jan 2019 20:45:32 -0700 Subject: [PATCH 11/39] Upgrade @svgr/webpack to 4.1.0 (#5816) * Upgrade svgr to 4.0.3 * Upgrade svgr to 4.0.4 * Remove unnecessary prettier option * Update to 4.1.0 --- .../babel-plugin-named-asset-import/index.test.js | 13 ++++++------- packages/react-scripts/config/webpack.config.js | 3 +-- packages/react-scripts/package.json | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/babel-plugin-named-asset-import/index.test.js b/packages/babel-plugin-named-asset-import/index.test.js index f14139f0fd6..17b1927be16 100644 --- a/packages/babel-plugin-named-asset-import/index.test.js +++ b/packages/babel-plugin-named-asset-import/index.test.js @@ -6,7 +6,7 @@ pluginTester({ pluginOptions: { loaderMap: { svg: { - ReactComponent: '@svgr/webpack?-prettier,-svgo![path]', + ReactComponent: '@svgr/webpack?-svgo![path]', }, }, }, @@ -36,7 +36,7 @@ pluginTester({ svgReactComponentNamedImport: { code: 'import { ReactComponent as logo } from "logo.svg";', output: - 'import { ReactComponent as logo } from "@svgr/webpack?-prettier,-svgo!logo.svg";', + 'import { ReactComponent as logo } from "@svgr/webpack?-svgo!logo.svg";', }, svgMultipleImport: { code: @@ -44,7 +44,7 @@ pluginTester({ output: 'import logo from "logo.svg";\n' + 'import { logoUrl } from "logo.svg";\n' + - 'import { ReactComponent as Logo } from "@svgr/webpack?-prettier,-svgo!logo.svg";', + 'import { ReactComponent as Logo } from "@svgr/webpack?-svgo!logo.svg";', }, defaultExport: { code: 'export default logo;', @@ -81,18 +81,17 @@ pluginTester({ svgReactComponentNamedExport: { code: 'export { ReactComponent as Logo } from "logo.svg";', output: - 'export { ReactComponent as Logo } from "@svgr/webpack?-prettier,-svgo!logo.svg";', + 'export { ReactComponent as Logo } from "@svgr/webpack?-svgo!logo.svg";', }, svgReactComponentExport: { code: 'export { ReactComponent } from "logo.svg";', - output: - 'export { ReactComponent } from "@svgr/webpack?-prettier,-svgo!logo.svg";', + output: 'export { ReactComponent } from "@svgr/webpack?-svgo!logo.svg";', }, svgMultipleExport: { code: 'export { logoUrl , ReactComponent as Logo } from "logo.svg";', output: 'export { logoUrl } from "logo.svg";\n' + - 'export { ReactComponent as Logo } from "@svgr/webpack?-prettier,-svgo!logo.svg";', + 'export { ReactComponent as Logo } from "@svgr/webpack?-svgo!logo.svg";', }, }, }); diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index ed85b555ea6..a5f147ce0ef 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -377,8 +377,7 @@ module.exports = function(webpackEnv) { { loaderMap: { svg: { - ReactComponent: - '@svgr/webpack?-prettier,-svgo![path]', + ReactComponent: '@svgr/webpack?-svgo![path]', }, }, }, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 0a94c39bd2d..e98bd4dd798 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -25,7 +25,7 @@ "types": "./lib/react-app.d.ts", "dependencies": { "@babel/core": "7.2.2", - "@svgr/webpack": "2.4.1", + "@svgr/webpack": "4.1.0", "babel-core": "7.0.0-bridge.0", "babel-eslint": "9.0.0", "babel-jest": "23.6.0", From 47e9e2c7a07bfe60b52011cf71de5ca33bdeb6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Pace?= Date: Sat, 12 Jan 2019 09:55:57 -0200 Subject: [PATCH 12/39] Move chalk dependency to react-dev-utils (#6150) Related to #751 --- packages/react-dev-utils/chalk.js | 12 ++++++++++++ packages/react-dev-utils/package.json | 1 + packages/react-scripts/package.json | 1 - packages/react-scripts/scripts/build.js | 2 +- packages/react-scripts/scripts/eject.js | 2 +- packages/react-scripts/scripts/init.js | 2 +- packages/react-scripts/scripts/start.js | 2 +- .../react-scripts/scripts/utils/createJestConfig.js | 2 +- .../react-scripts/scripts/utils/verifyPackageTree.js | 2 +- .../scripts/utils/verifyTypeScriptSetup.js | 2 +- 10 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 packages/react-dev-utils/chalk.js diff --git a/packages/react-dev-utils/chalk.js b/packages/react-dev-utils/chalk.js new file mode 100644 index 00000000000..8c42148dd7b --- /dev/null +++ b/packages/react-dev-utils/chalk.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var chalk = require('chalk'); + +module.exports = chalk; diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 3e5d75eabb7..56928396549 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -12,6 +12,7 @@ }, "files": [ "browsersHelper.js", + "chalk.js", "checkRequiredFiles.js", "clearConsole.js", "crossSpawn.js", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index e98bd4dd798..a9ed5e4c835 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -34,7 +34,6 @@ "babel-preset-react-app": "^7.0.0", "bfj": "6.1.1", "case-sensitive-paths-webpack-plugin": "2.1.2", - "chalk": "2.4.2", "css-loader": "1.0.0", "dotenv": "6.0.0", "dotenv-expand": "4.2.0", diff --git a/packages/react-scripts/scripts/build.js b/packages/react-scripts/scripts/build.js index 35cbfc15073..8cd1ad77ee5 100644 --- a/packages/react-scripts/scripts/build.js +++ b/packages/react-scripts/scripts/build.js @@ -32,7 +32,7 @@ verifyTypeScriptSetup(); // @remove-on-eject-end const path = require('path'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const fs = require('fs-extra'); const webpack = require('webpack'); const bfj = require('bfj'); diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 3f850068668..a151bbd6e35 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -17,7 +17,7 @@ process.on('unhandledRejection', err => { const fs = require('fs-extra'); const path = require('path'); const execSync = require('child_process').execSync; -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const paths = require('../config/paths'); const createJestConfig = require('./utils/createJestConfig'); const inquirer = require('react-dev-utils/inquirer'); diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index 771f6dbf490..9b473ab3d95 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -16,7 +16,7 @@ process.on('unhandledRejection', err => { const fs = require('fs-extra'); const path = require('path'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const execSync = require('child_process').execSync; const spawn = require('react-dev-utils/crossSpawn'); const { defaultBrowsers } = require('react-dev-utils/browsersHelper'); diff --git a/packages/react-scripts/scripts/start.js b/packages/react-scripts/scripts/start.js index 7750c25a176..852e6b8fb44 100644 --- a/packages/react-scripts/scripts/start.js +++ b/packages/react-scripts/scripts/start.js @@ -32,7 +32,7 @@ verifyTypeScriptSetup(); // @remove-on-eject-end const fs = require('fs'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const webpack = require('webpack'); const WebpackDevServer = require('webpack-dev-server'); const clearConsole = require('react-dev-utils/clearConsole'); diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index 58c2ad48812..a5f1a1bd7b8 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -8,7 +8,7 @@ 'use strict'; const fs = require('fs'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const paths = require('../../config/paths'); module.exports = (resolve, rootDir, isEjecting) => { diff --git a/packages/react-scripts/scripts/utils/verifyPackageTree.js b/packages/react-scripts/scripts/utils/verifyPackageTree.js index 9b8a6a03486..075860eac5b 100644 --- a/packages/react-scripts/scripts/utils/verifyPackageTree.js +++ b/packages/react-scripts/scripts/utils/verifyPackageTree.js @@ -8,7 +8,7 @@ 'use strict'; -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const fs = require('fs'); const path = require('path'); diff --git a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js index d8da57a3509..58c352c4464 100644 --- a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js +++ b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js @@ -8,7 +8,7 @@ 'use strict'; -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const fs = require('fs'); const resolve = require('resolve'); const path = require('path'); From fd382772a1ab656087c1467c5fe9ab8926af1d01 Mon Sep 17 00:00:00 2001 From: Matthew Holloway Date: Tue, 15 Jan 2019 00:54:46 +1300 Subject: [PATCH 13/39] Ignore node_modules in verifyNoTypeScript (#6022) --- .../scripts/utils/verifyTypeScriptSetup.js | 2 +- .../issue-5947-not-typescript/index.test.js | 36 +++++++++++++++++++ .../issue-5947-not-typescript/package.json | 3 ++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/issue-5947-not-typescript/index.test.js create mode 100644 test/fixtures/issue-5947-not-typescript/package.json diff --git a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js index 58c352c4464..370c7176e19 100644 --- a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js +++ b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js @@ -22,7 +22,7 @@ function writeJson(fileName, object) { } function verifyNoTypeScript() { - const typescriptFiles = globby('**/*.(ts|tsx)', { cwd: paths.appSrc }); + const typescriptFiles = globby(['**/*.(ts|tsx)', '!**/node_modules'], { cwd: paths.appSrc }); if (typescriptFiles.length > 0) { console.warn( chalk.yellow( diff --git a/test/fixtures/issue-5947-not-typescript/index.test.js b/test/fixtures/issue-5947-not-typescript/index.test.js new file mode 100644 index 00000000000..c0d38261f6f --- /dev/null +++ b/test/fixtures/issue-5947-not-typescript/index.test.js @@ -0,0 +1,36 @@ +const testSetup = require('../__shared__/test-setup'); +const path = require('path'); +const fs = require('fs'); + +test('Ignores node_modules when detecting TypeScript', async () => { + // CRA build will check for TypeScript files by + // globbing for src/**/*.ts however this shouldn't + // include any node_modules directories within src. + // See https://github.com/facebook/create-react-app/issues/5947 + + const tsConfigPath = path.join(testSetup.testDirectory, 'tsconfig.json'); + const tsPackagePath = [ + testSetup.testDirectory, + 'src', + 'node_modules', + 'package', + 'index.ts', + ]; + const tsSrcPath = path.join(testSetup.testDirectory, 'src', 'index.ts'); + + // Step 1. + // See if src/node_modules/package/index.ts is treated + // as a JS project + fs.mkdirSync(path.join(...tsPackagePath.slice(0, 2))); + fs.mkdirSync(path.join(...tsPackagePath.slice(0, 3))); + fs.mkdirSync(path.join(...tsPackagePath.slice(0, 4))); + fs.writeFileSync(path.join(...tsPackagePath)); + await testSetup.scripts.build(); + expect(fs.existsSync(tsConfigPath)).toBe(false); + + // Step 2. + // Add TS and ensure tsconfig.json is generated + fs.writeFileSync(tsSrcPath); + await testSetup.scripts.build(); + expect(fs.existsSync(tsConfigPath)).toBe(true); +}); diff --git a/test/fixtures/issue-5947-not-typescript/package.json b/test/fixtures/issue-5947-not-typescript/package.json new file mode 100644 index 00000000000..18a1e415e56 --- /dev/null +++ b/test/fixtures/issue-5947-not-typescript/package.json @@ -0,0 +1,3 @@ +{ + "dependencies": {} +} From 34e5029c548f0fa08e1cd0a9865fc7c90914ff1e Mon Sep 17 00:00:00 2001 From: Dotan Simha Date: Wed, 16 Jan 2019 04:26:24 -0500 Subject: [PATCH 14/39] Add empty mock for module (#5798) --- packages/react-scripts/config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index a5f147ce0ef..25cc88ae716 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -644,6 +644,7 @@ module.exports = function(webpackEnv) { // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works. node: { + module: 'empty', dgram: 'empty', fs: 'empty', net: 'empty', From 803946fe5868523cfa5fb320d14a26da5f8d397c Mon Sep 17 00:00:00 2001 From: Steven Tan Date: Thu, 17 Jan 2019 10:39:34 +0800 Subject: [PATCH 15/39] Changes to steps for publishing GitHub User Page (#6095) * Changes to steps for publishing GitHub User Page Remove the the step for switching to gh-pages branch as it is no longer a viable option. * Changed projects to project --- docusaurus/docs/deployment.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docusaurus/docs/deployment.md b/docusaurus/docs/deployment.md index d25f18244fe..2b287488e7f 100644 --- a/docusaurus/docs/deployment.md +++ b/docusaurus/docs/deployment.md @@ -106,7 +106,8 @@ To override this, specify the `homepage` in your `package.json`, for example: This will let Create React App correctly infer the root path to use in the generated HTML file. **Note**: If you are using `react-router@^4`, you can root ``s using the `basename` prop on any ``.
-More information [here](https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string).
+More information [here](https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string).
+
For example: @@ -240,7 +241,8 @@ For more information see [Firebase Hosting](https://firebase.google.com/docs/hos ### Step 1: Add `homepage` to `package.json` -**The step below is important!**
+**The step below is important!**
+ **If you skip it, your app will not deploy correctly.** Open your `package.json` and add a `homepage` field for your project: @@ -291,11 +293,10 @@ Add the following scripts in your `package.json`: The `predeploy` script will run automatically before `deploy` is run. -If you are deploying to a GitHub user page instead of a project page you'll need to make two -additional modifications: +If you are deploying to a GitHub user page instead of a project page you'll need to make one +additional modification: -1. First, change your repository's source branch to be any branch other than **master**. -1. Additionally, tweak your `package.json` scripts to push deployments to **master**: +1. Tweak your `package.json` scripts to push deployments to **master**: ```diff "scripts": { @@ -312,7 +313,7 @@ Then run: npm run deploy ``` -### Step 4: Ensure your project’s settings use `gh-pages` +### Step 4: For a project page, ensure your project’s settings use `gh-pages` Finally, make sure **GitHub Pages** option in your GitHub project settings is set to use the `gh-pages` branch: From ed5fb1066bd9d08b6aa0a74ccb2ab8304aec7490 Mon Sep 17 00:00:00 2001 From: Ben Carp Date: Sun, 20 Jan 2019 04:13:37 +0200 Subject: [PATCH 16/39] Update updating-to-new-releases.md with note about global installs (#6190) * Update updating-to-new-releases.md Related to https://github.com/facebook/create-react-app/issues/6140 * Update updating-to-new-releases.md Linking to getting started following discussion on #6190. Adapt terminology to current installation methods. * Update updating-to-new-releases.md typo, rleative link * Update docusaurus/docs/updating-to-new-releases.md Co-Authored-By: carpben --- docusaurus/docs/updating-to-new-releases.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/updating-to-new-releases.md b/docusaurus/docs/updating-to-new-releases.md index 825832464c8..f8a2fa21850 100644 --- a/docusaurus/docs/updating-to-new-releases.md +++ b/docusaurus/docs/updating-to-new-releases.md @@ -8,9 +8,10 @@ Create React App is divided into two packages: - `create-react-app` is a global command-line utility that you use to create new projects. - `react-scripts` is a development dependency in the generated projects (including this one). -You almost never need to update `create-react-app` itself: it delegates all the setup to `react-scripts`. +When you run `npx create-react-app my-app` it automatically installs the latest version of Create React App. +> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, please visit [Getting Started](getting-started.md) to learn about current installation steps. -When you run `create-react-app`, it always creates the project with the latest version of `react-scripts` so you’ll get all the new features and improvements in newly created apps automatically. +Create React App creates the project with the latest version of `react-scripts` so you’ll get all the new features and improvements in newly created apps automatically. To update an existing project to a new version of `react-scripts`, [open the changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md), find the version you’re currently on (check `package.json` in this folder if you’re not sure), and apply the migration instructions for the newer versions. From 1c591cb7a446ec63afc012be6511b0a868bcef67 Mon Sep 17 00:00:00 2001 From: Nikita Lyzhov Date: Sun, 20 Jan 2019 22:46:50 +0200 Subject: [PATCH 17/39] Update `serve` change listening port documentation (#6229) * [docs] Change serve port flag and add example * [docs] Add --listen flag --- docusaurus/docs/deployment.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/deployment.md b/docusaurus/docs/deployment.md index 2b287488e7f..58322318124 100644 --- a/docusaurus/docs/deployment.md +++ b/docusaurus/docs/deployment.md @@ -15,7 +15,11 @@ npm install -g serve serve -s build ``` -The last command shown above will serve your static site on the port **5000**. Like many of [serve](https://github.com/zeit/serve)’s internal settings, the port can be adjusted using the `-p` or `--port` flags. +The last command shown above will serve your static site on the port **5000**. Like many of [serve](https://github.com/zeit/serve)’s internal settings, the port can be adjusted using the `-l` or `--listen` flags: + +```sh +serve -s build -l 4000 +``` Run this command to get a full list of the options available: From 3efcdbf328cff893810a9ed88a4cf4cf838484f5 Mon Sep 17 00:00:00 2001 From: James K Nelson Date: Tue, 22 Jan 2019 12:24:34 +0900 Subject: [PATCH 18/39] Fix e2e:docker test failure (#6050) * fix e2e:docker issue * fix e2e tests --- tasks/local-test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/local-test.sh b/tasks/local-test.sh index 75bdd2987a7..aad6a477076 100755 --- a/tasks/local-test.sh +++ b/tasks/local-test.sh @@ -111,6 +111,7 @@ CMD docker run \ --env CI=true \ + --env NPM_CONFIG_PREFIX=/home/node/.npm \ --env NPM_CONFIG_QUIET=true \ --tty \ --user node \ From 91f54afb4086b30e1a9244390658dd6f711b855e Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Thu, 24 Jan 2019 22:01:55 -0700 Subject: [PATCH 19/39] Update stale config to ignore additional labels --- .github/stale.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index e9387e49029..b2c3bb27cda 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -9,8 +9,14 @@ daysUntilClose: 5 # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: - - "issue: proposal" + - "contributions: claimed" + - "contributions: up for grabs!" + - "good first issue" - "issue: announcement" + - "issue: bug" + - "issue: proposal" + - "tag: bug fix" + - "tag: needs investigation" # Set to true to ignore issues in a project (defaults to false) exemptProjects: true From 714599dae652426331007f95cee5e26ea627a1b1 Mon Sep 17 00:00:00 2001 From: Adriano Costa Date: Fri, 25 Jan 2019 18:26:26 -0200 Subject: [PATCH 20/39] Prevent cursor events on app-logo svg (#6276) --- packages/react-scripts/template-typescript/src/App.css | 1 + packages/react-scripts/template/src/App.css | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/react-scripts/template-typescript/src/App.css b/packages/react-scripts/template-typescript/src/App.css index 92f956e8040..b41d297cab1 100644 --- a/packages/react-scripts/template-typescript/src/App.css +++ b/packages/react-scripts/template-typescript/src/App.css @@ -5,6 +5,7 @@ .App-logo { animation: App-logo-spin infinite 20s linear; height: 40vmin; + pointer-events: none; } .App-header { diff --git a/packages/react-scripts/template/src/App.css b/packages/react-scripts/template/src/App.css index 92f956e8040..b41d297cab1 100644 --- a/packages/react-scripts/template/src/App.css +++ b/packages/react-scripts/template/src/App.css @@ -5,6 +5,7 @@ .App-logo { animation: App-logo-spin infinite 20s linear; height: 40vmin; + pointer-events: none; } .App-header { From af339ec343eba172d81df9f26dfaabc77b62e5c2 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Fri, 1 Feb 2019 10:49:52 -0500 Subject: [PATCH 21/39] Add '--no-watch' flag for tests (#6285) --- packages/react-scripts/scripts/test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index ac07e4792af..3659e8bc151 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -54,10 +54,12 @@ function isInMercurialRepository() { } } -// Watch unless on CI, in coverage mode, or explicitly running all tests +// Watch unless on CI, in coverage mode, explicitly adding `--no-watch`, +// or explicitly running all tests if ( !process.env.CI && argv.indexOf('--coverage') === -1 && + argv.indexOf('--no-watch') === -1 && argv.indexOf('--watchAll') === -1 ) { // https://github.com/facebook/create-react-app/issues/5210 @@ -65,6 +67,11 @@ if ( argv.push(hasSourceControl ? '--watch' : '--watchAll'); } +// Jest doesn't have this option so we'll remove it +if (argv.indexOf('--no-watch') !== -1) { + argv = argv.filter(arg => arg !== '--no-watch'); +} + // @remove-on-eject-begin // This is not necessary after eject because we embed config into package.json. const createJestConfig = require('./utils/createJestConfig'); From a78be99b5e64208a303d65101da3b832fcc96a95 Mon Sep 17 00:00:00 2001 From: James George Date: Sun, 3 Feb 2019 20:37:31 +0530 Subject: [PATCH 22/39] Check for multiple project names when initializing (#6080) --- packages/create-react-app/createReactApp.js | 23 ++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/create-react-app/createReactApp.js b/packages/create-react-app/createReactApp.js index ff4beff99a2..356d886556f 100755 --- a/packages/create-react-app/createReactApp.js +++ b/packages/create-react-app/createReactApp.js @@ -143,11 +143,24 @@ if (program.info) { .then(console.log); } -if (typeof projectName === 'undefined') { - console.error('Please specify the project directory:'); - console.log( - ` ${chalk.cyan(program.name())} ${chalk.green('')}` - ); +const hasMultipleProjectNameArgs = + process.argv[3] && !process.argv[3].startsWith('-'); +if (typeof projectName === 'undefined' || hasMultipleProjectNameArgs) { + console.log(); + if (hasMultipleProjectNameArgs) { + console.error( + `You have provided more than one argument for ${chalk.green( + '' + )}.` + ); + console.log(); + console.log('Please specify only one project directory, without spaces.'); + } else { + console.error('Please specify the project directory:'); + console.log( + ` ${chalk.cyan(program.name())} ${chalk.green('')}` + ); + } console.log(); console.log('For example:'); console.log(` ${chalk.cyan(program.name())} ${chalk.green('my-react-app')}`); From dea19fdb30c2e896ed8ac75b68a612b0b92b2406 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Mon, 4 Feb 2019 02:21:05 -0500 Subject: [PATCH 23/39] Add `--no-watch` test flag to docs (#6331) --- docusaurus/docs/debugging-tests.md | 3 ++- docusaurus/docs/getting-started.md | 2 +- docusaurus/docs/running-tests.md | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docusaurus/docs/debugging-tests.md b/docusaurus/docs/debugging-tests.md index 93da201a9f6..80ca856cf33 100644 --- a/docusaurus/docs/debugging-tests.md +++ b/docusaurus/docs/debugging-tests.md @@ -54,7 +54,8 @@ Use the following [`launch.json`](https://code.visualstudio.com/docs/editor/debu "args": [ "test", "--runInBand", - "--no-cache" + "--no-cache", + "--no-watch" ], "cwd": "${workspaceRoot}", "protocol": "inspector", diff --git a/docusaurus/docs/getting-started.md b/docusaurus/docs/getting-started.md index a77beb5c1b0..6945b4e6f08 100644 --- a/docusaurus/docs/getting-started.md +++ b/docusaurus/docs/getting-started.md @@ -18,7 +18,7 @@ npm start _([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_ -Then open [http://localhost:3000/](http://localhost:3000/) to see your app. +Then open [http://localhost:3000/](http://localhost:3000/) to see your app. When you’re ready to deploy to production, create a minified bundle with `npm run build`. diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index 6daaffb73aa..851e0c3a581 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -29,12 +29,14 @@ We recommend to put the test files (or `__tests__` folders) next to the code the ## Command Line Interface -When you run `npm test`, Jest will launch in the watch mode. Every time you save a file, it will re-run the tests, just like `npm start` recompiles the code. +When you run `npm test`, Jest will launch in watch mode\*. Every time you save a file, it will re-run the tests, just like `npm start` recompiles the code. The watcher includes an interactive command-line interface with the ability to run all tests, or focus on a search pattern. It is designed this way so that you can keep it open and enjoy fast re-runs. You can learn the commands from the “Watch Usage” note that the watcher prints after every run: ![Jest watch mode](https://jestjs.io/img/blog/15-watch.gif) +> \*Although we recommend running your tests in watch mode during development, you can disable this behavior by passing in the `--no-watch` flag. In most CI environments, this is handled for you (see [On CI servers](#on-ci-servers)). + ## Version Control Integration By default, when you run `npm test`, Jest will only run the tests related to files changed since the last commit. This is an optimization designed to make your tests run fast regardless of how many tests you have. However it assumes that you don’t often commit the code that doesn’t pass the tests. @@ -372,9 +374,9 @@ CI=true npm test CI=true npm run build ``` -The test command will force Jest to run tests once instead of launching the watcher. +The test command will force Jest to run in CI-mode, and tests will only run once instead of launching the watcher. -> If you find yourself doing this often in development, please [file an issue](https://github.com/facebook/create-react-app/issues/new) to tell us about your use case because we want to make watcher the best experience and are open to changing how it works to accommodate more workflows. +For non-CI environments, you can simply pass the `--no-watch` flag to disable test-watching. The build command will check for linter warnings and fail if any are found. From bacb4407488a7730da9d9d8eb22b58b5739a14fb Mon Sep 17 00:00:00 2001 From: Charles Pritchard Date: Mon, 4 Feb 2019 23:38:52 -0800 Subject: [PATCH 24/39] Add empty mock for dns (#6292) --- packages/react-scripts/config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 25cc88ae716..942c22a2cc7 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -646,6 +646,7 @@ module.exports = function(webpackEnv) { node: { module: 'empty', dgram: 'empty', + dns: 'mock', fs: 'empty', net: 'empty', tls: 'empty', From 1648ce8106916a3ed9cff5b3e46e9c55621f24c0 Mon Sep 17 00:00:00 2001 From: gottfired Date: Tue, 5 Feb 2019 08:45:57 +0100 Subject: [PATCH 25/39] Fix order of args in tasks/cra test (#6342) --- tasks/cra.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/cra.js b/tasks/cra.js index 82343b1563a..6d873a837ec 100644 --- a/tasks/cra.js +++ b/tasks/cra.js @@ -113,7 +113,7 @@ const args = process.argv.slice(2); // Now run the CRA command const craScriptPath = path.join(packagesDir, 'create-react-app', 'index.js'); cp.execSync( - `node ${craScriptPath} --scripts-version="${scriptsPath}" ${args.join(' ')}`, + `node ${craScriptPath} ${args.join(' ')} --scripts-version="${scriptsPath}"`, { cwd: rootDir, stdio: 'inherit', From aa25c77bbcdbd65186999273964722bd15bcd94b Mon Sep 17 00:00:00 2001 From: Nathan Schneider Date: Wed, 6 Feb 2019 02:56:36 -0500 Subject: [PATCH 26/39] Fix missing article in README (#6346) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 881ba7f4ad5..75aed91b989 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ Create React App is a great fit for: - **Starting new single-page React applications.** - **Creating examples** with React for your libraries and components. -Here are few common cases where you might want to try something else: +Here are a few common cases where you might want to try something else: - If you want to **try React** without hundreds of transitive build tool dependencies, consider [using a single HTML file or an online sandbox instead](https://reactjs.org/docs/try-react.html). From 1deb811c5d91ac6d337d2fd4e4f36c7d8c352ebd Mon Sep 17 00:00:00 2001 From: Chris Self Date: Wed, 6 Feb 2019 22:40:17 -0500 Subject: [PATCH 27/39] Make manifest.json description more generic (#6355) --- packages/react-scripts/template-typescript/public/index.html | 4 ++-- packages/react-scripts/template/public/index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-scripts/template-typescript/public/index.html b/packages/react-scripts/template-typescript/public/index.html index 323182f3920..75980d58e22 100644 --- a/packages/react-scripts/template-typescript/public/index.html +++ b/packages/react-scripts/template-typescript/public/index.html @@ -9,8 +9,8 @@ />