From 91f54afb4086b30e1a9244390658dd6f711b855e Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Thu, 24 Jan 2019 22:01:55 -0700 Subject: [PATCH 01/48] 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 02/48] 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 03/48] 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 04/48] 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 05/48] 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 06/48] 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 07/48] 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 08/48] 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 09/48] 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 @@ />