Skip to content

Commit 9c29160

Browse files
authored
Merge branch 'master' into build-path-variable
2 parents 7c6f313 + 5867170 commit 9c29160

File tree

132 files changed

+11079
-8965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+11079
-8965
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
packages/ @ianschmitz @iansu @mrmckeb @petetnt
2-
docusaurus/ @amyrlam @iansu
2+
docusaurus/ @ianschmitz @iansu @mrmckeb

.github/ISSUE_TEMPLATE/question.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ about: Get help with Create React App
44
labels: 'needs triage'
55
---
66

7-
If you have a general question about Create React App or about building an app with Create React App we encourage you to post on our Spectrum community instead of this issue tracker. The maintainers and other community members can provide help and answer your questions there: https://spectrum.chat/create-react-app
7+
If you have a general question about Create React App or about building an app with Create React App we encourage you to post in GitHub Discussions instead of this issue tracker. The maintainers and other community members can provide help and answer your questions there: https://github.com/facebook/create-react-app/discussions
88

99
If you're looking for general information on using React, the React docs have a list of resources: https://reactjs.org/community/support.html
1010

.github/stale.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ daysUntilClose: 5
99

1010
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
1111
exemptLabels:
12-
- "contributions: claimed"
13-
- "contributions: up for grabs!"
14-
- "good first issue"
15-
- "issue: announcement"
16-
- "issue: bug"
17-
- "issue: needs investigation"
18-
- "issue: proposal"
19-
- "tag: breaking change"
20-
- "tag: bug fix"
21-
- "tag: documentation"
22-
- "tag: enhancement"
23-
- "tag: internal"
24-
- "tag: new feature"
25-
- "tag: underlying tools"
12+
- 'contributions: claimed'
13+
- 'contributions: up for grabs!'
14+
- 'good first issue'
15+
- 'issue: announcement'
16+
- 'issue: bug'
17+
- 'issue: needs investigation'
18+
- 'issue: proposal'
19+
- 'tag: breaking change'
20+
- 'tag: bug fix'
21+
- 'tag: documentation'
22+
- 'tag: enhancement'
23+
- 'tag: internal'
24+
- 'tag: new feature'
25+
- 'tag: underlying tools'
2626

2727
# Set to true to ignore issues in a project (defaults to false)
2828
exemptProjects: true

.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"trailingComma": "es5",
2+
"arrowParens": "avoid",
33
"singleQuote": true,
44
"semi": true
55
}

CHANGELOG-3.x.md

+1,324
Large diffs are not rendered by default.

CHANGELOG.md

+248-1,194
Large diffs are not rendered by default.

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Create React App [![Build Status](https://dev.azure.com/facebook/create-react-app/_apis/build/status/facebook.create-react-app?branchName=master)](https://dev.azure.com/facebook/create-react-app/_build/latest?definitionId=1&branchName=master) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md)
22

3+
<img alt="Logo" align="right" src="https://create-react-app.dev/img/logo.svg" width="20%" />
4+
35
Create React apps with no build configuration.
46

57
- [Creating an App](#creating-an-app) – How to create a new app.
68
- [User Guide](https://facebook.github.io/create-react-app/) – How to develop apps bootstrapped with Create React App.
79

810
Create React App works on macOS, Windows, and Linux.<br>
911
If something doesn’t work, please [file an issue](https://github.com/facebook/create-react-app/issues/new).<br>
10-
If you have questions or need help, please ask in our [Spectrum](https://spectrum.chat/create-react-app) community.
12+
If you have questions or need help, please ask in [GitHub Discussions](https://github.com/facebook/create-react-app/discussions).
1113

1214
## Quick Overview
1315

@@ -17,7 +19,7 @@ cd my-app
1719
npm start
1820
```
1921

20-
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.
22+
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` or `yarn global remove create-react-app` to ensure that npx always uses the latest version.
2123

2224
_([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))_
2325

@@ -175,9 +177,9 @@ Here are a few common cases where you might want to try something else:
175177

176178
- If you need to **publish a React component**, [nwb](https://github.com/insin/nwb) can [also do this](https://github.com/insin/nwb#react-components-and-libraries), as well as [Neutrino's react-components preset](https://neutrino.js.org/packages/react-components/).
177179

178-
- If you want to do **server rendering** with React and Node.js, check out [Next.js](https://github.com/zeit/next.js/) or [Razzle](https://github.com/jaredpalmer/razzle). Create React App is agnostic of the backend, and only produces static HTML/JS/CSS bundles.
180+
- If you want to do **server rendering** with React and Node.js, check out [Next.js](https://nextjs.org/) or [Razzle](https://github.com/jaredpalmer/razzle). Create React App is agnostic of the backend, and only produces static HTML/JS/CSS bundles.
179181

180-
- If your website is **mostly static** (for example, a portfolio or a blog), consider using [Gatsby](https://www.gatsbyjs.org/) instead. Unlike Create React App, it pre-renders the website into HTML at the build time.
182+
- If your website is **mostly static** (for example, a portfolio or a blog), consider using [Gatsby](https://www.gatsbyjs.org/) or [Next.js](https://nextjs.org/). Unlike Create React App, Gatsby pre-renders the website into HTML at build time. Next.js supports both server rendering and pre-rendering.
181183

182184
- Finally, if you need **more customization**, check out [Neutrino](https://neutrino.js.org/) and its [React preset](https://neutrino.js.org/packages/react/).
183185

@@ -194,6 +196,10 @@ Check out [Expo CLI](https://github.com/expo/expo-cli).
194196

195197
We'd love to have your helping hand on `create-react-app`! See [CONTRIBUTING.md](CONTRIBUTING.md) for more information on what we're looking for and how to get started.
196198

199+
## Supporting Create React App
200+
201+
Create React App is a community maintained project and all contributors are volunteers. If you'd like to support the future development of Create React App then please consider donating to our [Open Collective](https://opencollective.com/create-react-app).
202+
197203
## Credits
198204

199205
This project exists thanks to all the people who [contribute](CONTRIBUTING.md).<br>
@@ -211,4 +217,4 @@ We are grateful to the authors of existing related projects for their ideas and
211217

212218
## License
213219

214-
Create React App is open source software [licensed as MIT](https://github.com/facebook/create-react-app/blob/master/LICENSE).
220+
Create React App is open source software [licensed as MIT](https://github.com/facebook/create-react-app/blob/master/LICENSE). The Create React App logo is licensed under a [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by/4.0/).

SECURITY.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Reporting Security Issues
2+
3+
If you believe you have found a security vulnerability in Create React App, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem.
4+
5+
Please refer to the following page for our responsible disclosure policy, reward guidelines, and those things that should not be reported:
6+
7+
https://www.facebook.com/whitehat

azure-pipelines-test-job.yml

+38-40
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
1-
#
2-
# Azure Pipelines job for building and testing create-react-app on Linux, Windows, and macOS.
3-
#
4-
5-
parameters:
6-
name: ''
7-
testScript: ''
8-
configurations:
9-
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
10-
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
11-
# WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x }
12-
# WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.x }
13-
14-
jobs:
15-
- job: ${{ parameters.name }}
16-
strategy:
17-
matrix:
18-
${{ insert }}: ${{ parameters.configurations }}
19-
pool:
20-
vmImage: $(vmImage)
21-
steps:
22-
- script: |
23-
git config --global core.autocrlf false
24-
git config --global user.name "Create React App"
25-
git config --global user.email "cra@email.com"
26-
displayName: 'Initialize Git config'
27-
28-
- checkout: self
29-
path: create-react-app
30-
31-
- task: NodeTool@0
32-
inputs:
33-
versionSpec: $(nodeVersion)
34-
displayName: 'Install Node.js'
35-
36-
- script: yarn --frozen-lockfile
37-
displayName: 'Run yarn'
38-
39-
- bash: ${{ parameters.testScript }}
40-
displayName: 'Run tests'
1+
#
2+
# Azure Pipelines job for building and testing create-react-app on Linux, Windows, and macOS.
3+
#
4+
5+
parameters:
6+
name: ''
7+
testScript: ''
8+
configurations:
9+
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
10+
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
11+
12+
jobs:
13+
- job: ${{ parameters.name }}
14+
strategy:
15+
matrix:
16+
${{ insert }}: ${{ parameters.configurations }}
17+
pool:
18+
vmImage: $(vmImage)
19+
steps:
20+
- script: |
21+
git config --global core.autocrlf false
22+
git config --global user.name "Create React App"
23+
git config --global user.email "cra@email.com"
24+
displayName: 'Initialize Git config'
25+
26+
- checkout: self
27+
path: create-react-app
28+
29+
- task: NodeTool@0
30+
inputs:
31+
versionSpec: $(nodeVersion)
32+
displayName: 'Install Node.js'
33+
34+
- script: yarn --frozen-lockfile
35+
displayName: 'Run yarn'
36+
37+
- bash: ${{ parameters.testScript }}
38+
displayName: 'Run tests'

azure-pipelines.yml

+77-79
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,77 @@
1-
#
2-
# Azure Pipelines configuration for building and testing create-react-app on Linux, Windows, and macOS.
3-
#
4-
5-
trigger:
6-
- master
7-
8-
variables:
9-
CI: true
10-
# Overrides the Yarn and NPM cache directories so they are on the same drive as the source. This helps improve build performance on Windows hosted agents.
11-
YARN_CACHE_FOLDER: $(Build.SourcesDirectory)/../yarn-cache
12-
NPM_CONFIG_CACHE: $(Build.SourcesDirectory)/../npm-cache
13-
# Sets TEMP to be on the same drive as the cloned source on Windows. This avoids test scripts that "cd" into a directory under TEMP from failing because this directory is on a different drive from the current directory.
14-
VSTS_OVERWRITE_TEMP: True
15-
# Override Verdaccio package to use. This is temporary and is needed to avoid socket timeouts on hosted Windows agent (on Azure). This also changes Verdaccio to return a 503 (service unavailable) instead of a 404 (not found) when the connection to the uplink timesout.
16-
VERDACCIO_PACKAGE: https://github.com/willsmythe/verdaccio/releases/download/create-react-app/verdaccio-4.0.0-alpha.8.tgz
17-
CRA_INTERNAL_TEST: true
18-
19-
# ******************************************************************************
20-
# Simple test suite
21-
# ******************************************************************************
22-
jobs:
23-
- template: azure-pipelines-test-job.yml
24-
parameters:
25-
name: Simple
26-
testScript: tasks/e2e-simple.sh
27-
28-
# ******************************************************************************
29-
# Installs test suite
30-
# ******************************************************************************
31-
- template: azure-pipelines-test-job.yml
32-
parameters:
33-
name: Installs
34-
testScript: tasks/e2e-installs.sh
35-
36-
# ******************************************************************************
37-
# Kitchensink test suite
38-
# ******************************************************************************
39-
- template: azure-pipelines-test-job.yml
40-
parameters:
41-
name: Kitchensink
42-
testScript: tasks/e2e-kitchensink.sh
43-
44-
# ******************************************************************************
45-
# Kitchensink Eject test suite
46-
# ******************************************************************************
47-
- template: azure-pipelines-test-job.yml
48-
parameters:
49-
name: KitchensinkEject
50-
testScript: tasks/e2e-kitchensink-eject.sh
51-
52-
# ******************************************************************************
53-
# Behavior test suite
54-
# ******************************************************************************
55-
- template: azure-pipelines-test-job.yml
56-
parameters:
57-
name: Behavior
58-
testScript: tasks/e2e-behavior.sh
59-
configurations:
60-
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
61-
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
62-
# WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x }
63-
# WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.x }
64-
MacNode10: { vmImage: 'macOS-latest', nodeVersion: 10.x }
65-
MacNode12: { vmImage: 'macOS-latest', nodeVersion: 12.x }
66-
67-
# ******************************************************************************
68-
# Old Node test suite
69-
# ******************************************************************************
70-
- job: OldNode
71-
pool:
72-
vmImage: ubuntu-latest
73-
steps:
74-
- task: NodeTool@0
75-
inputs:
76-
versionSpec: 8.x
77-
displayName: 'Install Node.js 8.x'
78-
- bash: tasks/e2e-old-node.sh
79-
displayName: 'Run tests'
1+
#
2+
# Azure Pipelines configuration for building and testing create-react-app on Linux, Windows, and macOS.
3+
#
4+
5+
trigger:
6+
- master
7+
8+
variables:
9+
CI: true
10+
# Overrides the Yarn and NPM cache directories so they are on the same drive as the source. This helps improve build performance on Windows hosted agents.
11+
YARN_CACHE_FOLDER: $(Build.SourcesDirectory)/../yarn-cache
12+
NPM_CONFIG_CACHE: $(Build.SourcesDirectory)/../npm-cache
13+
# Sets TEMP to be on the same drive as the cloned source on Windows. This avoids test scripts that "cd" into a directory under TEMP from failing because this directory is on a different drive from the current directory.
14+
VSTS_OVERWRITE_TEMP: True
15+
CRA_INTERNAL_TEST: true
16+
17+
# ******************************************************************************
18+
# Simple test suite
19+
# ******************************************************************************
20+
jobs:
21+
- template: azure-pipelines-test-job.yml
22+
parameters:
23+
name: Simple
24+
testScript: tasks/e2e-simple.sh
25+
26+
# ******************************************************************************
27+
# Installs test suite
28+
# ******************************************************************************
29+
- template: azure-pipelines-test-job.yml
30+
parameters:
31+
name: Installs
32+
testScript: tasks/e2e-installs.sh
33+
34+
# ******************************************************************************
35+
# Kitchensink test suite
36+
# ******************************************************************************
37+
- template: azure-pipelines-test-job.yml
38+
parameters:
39+
name: Kitchensink
40+
testScript: tasks/e2e-kitchensink.sh
41+
42+
# ******************************************************************************
43+
# Kitchensink Eject test suite
44+
# ******************************************************************************
45+
- template: azure-pipelines-test-job.yml
46+
parameters:
47+
name: KitchensinkEject
48+
testScript: tasks/e2e-kitchensink-eject.sh
49+
50+
# ******************************************************************************
51+
# Behavior test suite
52+
# ******************************************************************************
53+
- template: azure-pipelines-test-job.yml
54+
parameters:
55+
name: Behavior
56+
testScript: tasks/e2e-behavior.sh
57+
configurations:
58+
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
59+
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
60+
WindowsNode10: { vmImage: 'windows-2019', nodeVersion: 10.x }
61+
WindowsNode12: { vmImage: 'windows-2019', nodeVersion: 12.x }
62+
MacNode10: { vmImage: 'macOS-10.15', nodeVersion: 10.x }
63+
MacNode12: { vmImage: 'macOS-10.15', nodeVersion: 12.x }
64+
65+
# ******************************************************************************
66+
# Old Node test suite
67+
# ******************************************************************************
68+
- job: OldNode
69+
pool:
70+
vmImage: ubuntu-latest
71+
steps:
72+
- task: NodeTool@0
73+
inputs:
74+
versionSpec: 8.x
75+
displayName: 'Install Node.js 8.x'
76+
- bash: tasks/e2e-old-node.sh
77+
displayName: 'Run tests'

docusaurus/docs/adding-css-reset.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To start using it, add `@import-normalize;` anywhere in your CSS file(s). You on
1616
/* rest of app styles */
1717
```
1818

19-
> **Tip**: If you see an "_Unknown at rule @import-normalize css(unknownAtRules)_" warning in VSCode, change the `css.lint.unknownAtRules` setting to `ignore`.
19+
> **Tip**: If you see an "_Unknown at rule @import-normalize css(unknownAtRules)_" warning in VSCode, change the `css.lint.unknownAtRules` setting to `ignore`.
2020
2121
You can control which parts of [normalize.css] to use via your project's [browserslist].
2222

docusaurus/docs/adding-custom-environment-variables.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ REACT_APP_NOT_SECRET_CODE=abcdef
132132

133133
Files on the left have more priority than files on the right:
134134

135-
- `npm start`: `.env.development.local`, `.env.development`, `.env.local`, `.env`
136-
- `npm run build`: `.env.production.local`, `.env.production`, `.env.local`, `.env`
135+
- `npm start`: `.env.development.local`, `.env.local`, `.env.development`, `.env`
136+
- `npm run build`: `.env.production.local`, `.env.local`, `.env.production`, `.env`
137137
- `npm test`: `.env.test.local`, `.env.test`, `.env` (note `.env.local` is missing)
138138

139139
These variables will act as the defaults if the machine does not explicitly set them.

docusaurus/docs/adding-typescript.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ npx create-react-app my-app --template typescript
1919
yarn create react-app my-app --template typescript
2020
```
2121

22-
> 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.
22+
> 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` or `yarn global remove create-react-app` to ensure that `npx` always uses the latest version.
2323
>
2424
> Global installs of `create-react-app` are no longer supported.
2525
26-
To add [TypeScript](https://www.typescriptlang.org/) to a Create React App project, first install it:
26+
To add [TypeScript](https://www.typescriptlang.org/) to an existing Create React App project, first install it:
2727

2828
```sh
2929
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
@@ -47,7 +47,7 @@ You are not required to make a [`tsconfig.json` file](https://www.typescriptlang
4747

4848
## Troubleshooting
4949

50-
If your project is not created with TypeScript enabled, npx may be using a cached version of `create-react-app`. Remove previously installed versions with `npm uninstall -g create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)).
50+
If your project is not created with TypeScript enabled, npx may be using a cached version of `create-react-app`. Remove previously installed versions with `npm uninstall -g create-react-app` or `yarn global remove create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)).
5151

5252
If you are currently using [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript/), see [this blog post](https://vincenttunru.com/migrate-create-react-app-typescript-to-create-react-app/) for instructions on how to migrate to Create React App.
5353

0 commit comments

Comments
 (0)