Skip to content

Commit fb0b775

Browse files
committed
Merge branch 'master' into checkYarnRegistry
* master: (39 commits) Added extension to .eslintrc (facebook#5988) Update links to docs in all package README files (facebook#5912) Use https for linked images in docs to fix mixed content warnings (facebook#5985) Improve error messaging in verifyPackageTree.js (facebook#5974) Add removeItem to localStorage mock in docs (facebook#5919) Add SASS_PATH instructions to Sass docs (facebook#5917) Suggest a different default for speed reasons (facebook#5959) Add pre-eject message about new features in v2 (facebook#5954) Add netlify.toml to prepare for deploy to netlify facebook#5807 (facebook#5930) Correct some comments (facebook#5927) Add note to docs about using Sass and Flow together (facebook#5823) Update PWA link in README (facebook#5907) Add placeholders to template README for bit.ly links. (facebook#5808) Disable copy to clipboard in cra --info (facebook#5905) Support setupTests.ts (facebook#5698) Remove unnecessary whitespace in template HTML Run prettier on HTML files (facebook#5839) Some Grammar fixes (facebook#5858) Fix link to page about running tests (facebook#5883) fix: make typescriptformatter support 0.5 of fork checker (facebook#5879) ...
2 parents 0454543 + fbdf156 commit fb0b775

Some content is hidden

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

48 files changed

+1010
-1208
lines changed

.eslintrc .eslintrc.json

File renamed without changes.

.github/ISSUE_TEMPLATE.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
(write your answer here)
88

9+
910
<!--
1011
If you answered "Yes":
11-
12+
1213
Please note that your issue will be fixed much faster if you spend about
1314
half an hour preparing it, including the exact reproduction steps and a demo.
14-
15+
1516
If you're in a hurry or don't feel confident, it's fine to report bugs with
1617
less details, but this makes it less likely they'll get fixed soon.
1718
@@ -37,14 +38,14 @@
3738
Then you need to decide which package manager you prefer to use.
3839
We support both npm (https://npmjs.com) and yarn (http://yarnpkg.com/).
3940
However, **they can't be used together in one project** so you need to pick one.
40-
41+
4142
If you decided to use npm, run this in your project directory:
4243
4344
npm install -g npm@latest
4445
npm install
4546
4647
This should fix your project.
47-
48+
4849
If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install).
4950
Then run in your project directory:
5051
@@ -62,19 +63,20 @@
6263

6364
(Write your answer here.)
6465

66+
6567
### Which terms did you search for in User Guide?
6668

6769
<!--
6870
There are a few common documented problems, such as watcher not detecting changes, or build failing.
6971
They are described in the Troubleshooting section of the User Guide:
7072
71-
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#troubleshooting
73+
https://facebook.github.io/create-react-app/docs/troubleshooting
7274
7375
Please scan these few sections for common problems.
7476
Additionally, you can search the User Guide itself for something you're having issues with:
75-
76-
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md
77-
77+
78+
https://facebook.github.io/create-react-app/
79+
7880
If you didn't find the solution, please share which words you searched for.
7981
This helps us improve documentation for future readers who might encounter the same problem.
8082
-->
@@ -98,6 +100,7 @@
98100

99101
(paste the output of the command here)
100102

103+
101104
### Steps to Reproduce
102105

103106
<!--
@@ -154,13 +157,14 @@
154157

155158
(Paste the link to an example project and exact instructions to reproduce the issue.)
156159

160+
157161
<!--
158162
What happens if you skip this step?
159-
163+
160164
We will try to help you, but in many cases it is impossible because crucial
161165
information is missing. In that case we'll tag an issue as having a low priority,
162166
and eventually close it if there is no clear direction.
163-
167+
164168
We still appreciate the report though, as eventually somebody else might
165169
create a reproducible example for it.
166170

.github/lock.yml

+3-13
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22

33
# Number of days of inactivity before a closed issue or pull request is locked
44
daysUntilLock: 5
5-
setLockReason: false
6-
7-
issues:
8-
# Comment to post when locking a stale Issue.
9-
lockComment: >
10-
The conversation for this issue has been locked because the issue is
11-
closed. If you have a question or comment, please open a new issue.
125

13-
pulls:
14-
# Comment to post when locking a stale Pull Request.
15-
lockComment: >
16-
The conversation for this pull request has been locked because the pull
17-
request is closed. If you would like to contribute please open a new pull
18-
request.
6+
# Do not comment when locking
7+
setLockReason: false
8+
lockComment: false

.github/stale.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,22 @@ issues:
2828
# Comment to post when marking Issues as stale.
2929
markComment: >
3030
This issue has been automatically marked as stale because it has not had any
31-
recent activity. It will be closed in 7 days if no further activity occurs.
31+
recent activity. It will be closed in 5 days if no further activity occurs.
3232
3333
# Comment to post when closing a stale Issue.
3434
closeComment: >
3535
This issue has been automatically closed because it has not had any recent
36-
activity. The conversation will be locked in 7 days unless the issue is
37-
reopened.
36+
activity. If you have a question or comment, please open a new issue.
3837
3938
pulls:
4039
# Comment to post when marking Pull Request as stale.
4140
markComment: >
4241
This pull request has been automatically marked as stale because it has not
43-
had any recent activity. It will be closed in 7 days if no further activity
42+
had any recent activity. It will be closed in 5 days if no further activity
4443
occurs.
4544
4645
# Comment to post when closing a stale Pull Request.
4746
closeComment: >
4847
This pull request has been automatically closed because it has not had any
49-
recent activity. The conversation will be locked in 7 days unless the pull
50-
request is reopened. Thank you for your contribution.
48+
recent activity. If you have a question or comment, please open a new
49+
issue. Thank you for your contribution!

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ language: node_js
44
node_js:
55
- 8
66
- 10
7+
- node
78
cache:
89
yarn: true
910
directories:

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Create React App [![Build Status](https://travis-ci.org/facebook/create-react-app.svg?branch=master)](https://travis-ci.org/facebook/create-react-app)
1+
# Create React App [![Build Status](https://travis-ci.org/facebook/create-react-app.svg?branch=master)](https://travis-ci.org/facebook/create-react-app) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/pulls)
22

33
Create React apps with no build configuration.
44

@@ -111,7 +111,7 @@ You will see the build errors and lint warnings in the console.
111111
Runs the test watcher in an interactive mode.<br>
112112
By default, runs tests related to files changed since the last commit.
113113

114-
[Read more about testing.](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#running-tests)
114+
[Read more about testing.](https://facebook.github.io/create-react-app/docs/running-tests)
115115

116116
### `npm run build` or `yarn build`
117117

@@ -134,7 +134,7 @@ Please refer to the [User Guide](https://facebook.github.io/create-react-app/doc
134134

135135
- **One Dependency:** There is just one build dependency. It uses Webpack, Babel, ESLint, and other amazing projects, but provides a cohesive curated experience on top of them.
136136

137-
- **No Configuration Required:** You don't need to configure anything. Reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.
137+
- **No Configuration Required:** You don't need to configure anything. A reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.
138138

139139
- **No Lock-In:** You can “eject” to a custom setup at any time. Run a single command, and all the configuration and build dependencies will be moved directly into your project, so you can pick up right where you left off.
140140

@@ -148,12 +148,12 @@ Your environment will have everything you need to build a modern single-page Rea
148148
- A fast interactive unit test runner with built-in support for coverage reporting.
149149
- A live development server that warns about common mistakes.
150150
- A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
151-
- An offline-first [service worker](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers) and a [web app manifest](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/), meeting all the [Progressive Web App](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app) criteria. (_Note: Using the service worker is opt-in as of `react-scripts@2.0.0` and higher_)
151+
- An offline-first [service worker](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers) and a [web app manifest](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/), meeting all the [Progressive Web App](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) criteria. (_Note: Using the service worker is opt-in as of `react-scripts@2.0.0` and higher_)
152152
- Hassle-free updates for the above tools with a single dependency.
153153

154154
Check out [this guide](https://github.com/nitishdayal/cra_closer_look) for an overview of how these tools fit together.
155155

156-
The tradeoff is that **these tools are preconfigured to work in a specific way**. If your project needs more customization, you can ["eject"](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-eject) and customize it, but then you will need to maintain this configuration.
156+
The tradeoff is that **these tools are preconfigured to work in a specific way**. If your project needs more customization, you can ["eject"](https://facebook.github.io/create-react-app/docs/available-scripts#npm-run-eject) and customize it, but then you will need to maintain this configuration.
157157

158158
## Popular Alternatives
159159

@@ -163,11 +163,11 @@ Create React App is a great fit for:
163163
- **Starting new single-page React applications.**
164164
- **Creating examples** with React for your libraries and components.
165165

166-
Here’s a few common cases where you might want to try something else:
166+
Here are few common cases where you might want to try something else:
167167

168168
- 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).
169169

170-
- If you need to **integrate React code with a server-side template framework** like Rails or Django, or if you’re **not building a single-page app**, consider using [nwb](https://github.com/insin/nwb), or [Neutrino](https://neutrino.js.org/) which are more flexible. For Rails specifically, you can use [Rails Webpacker](https://github.com/rails/webpacker).
170+
- If you need to **integrate React code with a server-side template framework** like Rails, Django or Symfony, or if you’re **not building a single-page app**, consider using [nwb](https://github.com/insin/nwb), or [Neutrino](https://neutrino.js.org/) which are more flexible. For Rails specifically, you can use [Rails Webpacker](https://github.com/rails/webpacker). For Symfony, try [Symfony's Webpack Encore](https://symfony.com/doc/current/frontend/encore/reactjs.html).
171171

172172
- 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/).
173173

@@ -188,7 +188,7 @@ We'd love to have your helping hand on `create-react-app`! See [CONTRIBUTING.md]
188188
## React Native
189189

190190
Looking for something similar, but for React Native?<br>
191-
Check out [Create React Native App](https://github.com/react-community/create-react-native-app/).
191+
Check out [Expo CLI](https://github.com/expo/expo-cli).
192192

193193
## Acknowledgements
194194

docusaurus/docs/adding-a-sass-stylesheet.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,28 @@ This will allow you to do imports like
3030
@import '~nprogress/nprogress'; // importing a css file from the nprogress node module
3131
```
3232

33-
> **Tip:** You can opt into using this feature with [CSS modules](adding-a-css-modules-stylesheet.md) too!
34-
3533
> **Note:** You must prefix imports from `node_modules` with `~` as displayed above.
3634
37-
> **Note:** If you're using Flow, add the following to your `.flowconfig` so it'll recognize the `.sass` or `.scss` imports.
35+
`node-sass` also supports the `SASS_PATH` variable.
36+
37+
To use imports relative to a path you specify, and from `node_modules` without adding the `~` prefix, you can add a [`.env` file](https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/adding-custom-environment-variables.md#adding-development-environment-variables-in-env) at the project root with the variable `SASS_PATH=node_modules:src`. To specify more directories you can add them to `SASS_PATH` separated by a `:` like `path1:path2:path3`.
38+
39+
If you set `SASS_PATH=node_modules:src`, this will allow you to do imports like
40+
```scss
41+
@import 'styles/colors'; // assuming a styles directory under src/, where _colors.scss partial file exists.
42+
@import 'nprogress/nprogress'; // importing a css file from the nprogress node module
43+
```
44+
45+
> **Tip:** You can opt into using this feature with [CSS modules](adding-a-css-modules-stylesheet.md) too!
46+
47+
> **Note:** If you're using Flow, override the [module.file_ext](https://flow.org/en/docs/config/options/#toc-module-file-ext-string) setting in your `.flowconfig` so it'll recognize `.sass` or `.scss` files. You will also need to include the `module.file_ext` default settings for `.js`, `.jsx`, `.mjs` and `.json` files.
3848
>
3949
> ```
4050
> [options]
51+
> module.file_ext=.js
52+
> module.file_ext=.jsx
53+
> module.file_ext=.mjs
54+
> module.file_ext=.json
4155
> module.file_ext=.sass
4256
> module.file_ext=.scss
4357
> ```

docusaurus/docs/developing-components-in-isolation.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,10 @@ You can also deploy your Storybook or style guide as a static app. This way, eve
2222

2323
Storybook is a development environment for React UI components. It allows you to browse a component library, view the different states of each component, and interactively develop and test components.
2424

25-
First, install the following npm package globally:
25+
Run the following command inside your app’s directory:
2626

2727
```sh
28-
npm install -g @storybook/cli
29-
```
30-
31-
Then, run the following command inside your app’s directory:
32-
33-
```sh
34-
getstorybook
28+
npx -p @storybook/cli sb init
3529
```
3630

3731
After that, follow the instructions on the screen.

docusaurus/docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The page will automatically reload if you make changes to the code. You will see
108108

109109
Runs the test watcher in an interactive mode. By default, runs tests related to files changed since the last commit.
110110

111-
[Read more about testing](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#running-tests).
111+
[Read more about testing](https://facebook.github.io/create-react-app/docs/running-tests).
112112

113113
### `npm run build` or `yarn build`
114114

docusaurus/docs/running-tests.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ When you run `npm test`, Jest will launch in the watch mode. Every time you save
3333

3434
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:
3535

36-
![Jest watch mode](http://facebook.github.io/jest/img/blog/15-watch.gif)
36+
![Jest watch mode](https://jestjs.io/img/blog/15-watch.gif)
3737

3838
## Version Control Integration
3939

@@ -239,6 +239,7 @@ For example:
239239
const localStorageMock = {
240240
getItem: jest.fn(),
241241
setItem: jest.fn(),
242+
removeItem: jest.fn(),
242243
clear: jest.fn(),
243244
};
244245
global.localStorage = localStorageMock;
@@ -263,7 +264,7 @@ Similarly, `fit()` lets you focus on a specific test without running any other t
263264
Jest has an integrated coverage reporter that works well with ES6 and requires no configuration.<br>
264265
Run `npm test -- --coverage` (note extra `--` in the middle) to include a coverage report like this:
265266
266-
![coverage report](http://i.imgur.com/5bFhnTS.png)
267+
![coverage report](https://i.imgur.com/5bFhnTS.png)
267268
268269
Note that tests run much slower with coverage so it is recommended to run it separately from your normal workflow.
269270

docusaurus/website/siteConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const siteConfig = {
2626

2727
// For no header links in the top nav bar -> headerLinks: [],
2828
headerLinks: [
29-
{ doc: 'getting-started', label: 'Getting Started' },
29+
{ doc: 'getting-started', label: 'Docs' },
3030
{ href: 'https://reactjs.org/community/support.html', label: 'Help' },
3131
{
3232
href: 'https://www.github.com/facebook/create-react-app',

netlify.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[build]
2+
base = "docusaurus/website"
3+
publish = "docusaurus/website/build"
4+
command = "yarn build"
5+
6+
7+
# A redirect rule with all the supported properties
8+
[[redirects]]
9+
from = "/"
10+
to = "/create-react-app"

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"jest": "^23.6.0",
2929
"lerna": "2.9.1",
3030
"lerna-changelog": "^0.7.0",
31-
"lint-staged": "^7.0.5",
31+
"lint-staged": "^8.0.4",
3232
"meow": "^5.0.0",
3333
"multimatch": "^2.1.0",
34-
"prettier": "1.14.3",
34+
"prettier": "1.15.2",
3535
"puppeteer": "^1.8.0",
3636
"strip-ansi": "^4.0.0",
3737
"svg-term-cli": "^2.1.1",
@@ -44,7 +44,7 @@
4444
}
4545
},
4646
"lint-staged": {
47-
"*.{js,md,css}": [
47+
"*.{js,md,css,html}": [
4848
"prettier --trailing-comma es5 --single-quote --write",
4949
"git add"
5050
],

0 commit comments

Comments
 (0)