Skip to content

Commit

Permalink
Merge branch 'master' into checkYarnRegistry
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
timsnadden committed Dec 7, 2018
2 parents 0454543 + fbdf156 commit fb0b775
Show file tree
Hide file tree
Showing 48 changed files with 1,010 additions and 1,208 deletions.
File renamed without changes.
24 changes: 14 additions & 10 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

(write your answer here)


<!--
If you answered "Yes":
Please note that your issue will be fixed much faster if you spend about
half an hour preparing it, including the exact reproduction steps and a demo.
If you're in a hurry or don't feel confident, it's fine to report bugs with
less details, but this makes it less likely they'll get fixed soon.
Expand All @@ -37,14 +38,14 @@
Then you need to decide which package manager you prefer to use.
We support both npm (https://npmjs.com) and yarn (http://yarnpkg.com/).
However, **they can't be used together in one project** so you need to pick one.
If you decided to use npm, run this in your project directory:
npm install -g npm@latest
npm install
This should fix your project.
If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install).
Then run in your project directory:
Expand All @@ -62,19 +63,20 @@

(Write your answer here.)


### Which terms did you search for in User Guide?

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

(paste the output of the command here)


### Steps to Reproduce

<!--
Expand Down Expand Up @@ -154,13 +157,14 @@

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


<!--
What happens if you skip this step?
We will try to help you, but in many cases it is impossible because crucial
information is missing. In that case we'll tag an issue as having a low priority,
and eventually close it if there is no clear direction.
We still appreciate the report though, as eventually somebody else might
create a reproducible example for it.
Expand Down
16 changes: 3 additions & 13 deletions .github/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@

# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 5
setLockReason: false

issues:
# Comment to post when locking a stale Issue.
lockComment: >
The conversation for this issue has been locked because the issue is
closed. If you have a question or comment, please open a new issue.

pulls:
# Comment to post when locking a stale Pull Request.
lockComment: >
The conversation for this pull request has been locked because the pull
request is closed. If you would like to contribute please open a new pull
request.
# Do not comment when locking
setLockReason: false
lockComment: false
11 changes: 5 additions & 6 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,22 @@ issues:
# Comment to post when marking Issues as stale.
markComment: >
This issue has been automatically marked as stale because it has not had any
recent activity. It will be closed in 7 days if no further activity occurs.
recent activity. It will be closed in 5 days if no further activity occurs.
# Comment to post when closing a stale Issue.
closeComment: >
This issue has been automatically closed because it has not had any recent
activity. The conversation will be locked in 7 days unless the issue is
reopened.
activity. If you have a question or comment, please open a new issue.
pulls:
# Comment to post when marking Pull Request as stale.
markComment: >
This pull request has been automatically marked as stale because it has not
had any recent activity. It will be closed in 7 days if no further activity
had any recent activity. It will be closed in 5 days if no further activity
occurs.
# Comment to post when closing a stale Pull Request.
closeComment: >
This pull request has been automatically closed because it has not had any
recent activity. The conversation will be locked in 7 days unless the pull
request is reopened. Thank you for your contribution.
recent activity. If you have a question or comment, please open a new
issue. Thank you for your contribution!
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ language: node_js
node_js:
- 8
- 10
- node
cache:
yarn: true
directories:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Create React App [![Build Status](https://travis-ci.org/facebook/create-react-app.svg?branch=master)](https://travis-ci.org/facebook/create-react-app)
# 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)

Create React apps with no build configuration.

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

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

### `npm run build` or `yarn build`

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

- **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.

- **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.
- **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.

- **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.

Expand All @@ -148,12 +148,12 @@ Your environment will have everything you need to build a modern single-page Rea
- A fast interactive unit test runner with built-in support for coverage reporting.
- A live development server that warns about common mistakes.
- A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
- 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_)
- 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_)
- Hassle-free updates for the above tools with a single dependency.

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

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.
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.

## Popular Alternatives

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

Here’s a few common cases where you might want to try something else:
Here are 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).

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

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

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

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

## Acknowledgements

Expand Down
20 changes: 17 additions & 3 deletions docusaurus/docs/adding-a-sass-stylesheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,28 @@ This will allow you to do imports like
@import '~nprogress/nprogress'; // importing a css file from the nprogress node module
```

> **Tip:** You can opt into using this feature with [CSS modules](adding-a-css-modules-stylesheet.md) too!
> **Note:** You must prefix imports from `node_modules` with `~` as displayed above.
> **Note:** If you're using Flow, add the following to your `.flowconfig` so it'll recognize the `.sass` or `.scss` imports.
`node-sass` also supports the `SASS_PATH` variable.

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`.

If you set `SASS_PATH=node_modules:src`, this will allow you to do imports like
```scss
@import 'styles/colors'; // assuming a styles directory under src/, where _colors.scss partial file exists.
@import 'nprogress/nprogress'; // importing a css file from the nprogress node module
```

> **Tip:** You can opt into using this feature with [CSS modules](adding-a-css-modules-stylesheet.md) too!
> **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.
>
> ```
> [options]
> module.file_ext=.js
> module.file_ext=.jsx
> module.file_ext=.mjs
> module.file_ext=.json
> module.file_ext=.sass
> module.file_ext=.scss
> ```
10 changes: 2 additions & 8 deletions docusaurus/docs/developing-components-in-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@ You can also deploy your Storybook or style guide as a static app. This way, eve

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.

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

```sh
npm install -g @storybook/cli
```

Then, run the following command inside your app’s directory:

```sh
getstorybook
npx -p @storybook/cli sb init
```

After that, follow the instructions on the screen.
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The page will automatically reload if you make changes to the code. You will see

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

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

### `npm run build` or `yarn build`

Expand Down
5 changes: 3 additions & 2 deletions docusaurus/docs/running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ When you run `npm test`, Jest will launch in the watch mode. Every time you save

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](http://facebook.github.io/jest/img/blog/15-watch.gif)
![Jest watch mode](https://jestjs.io/img/blog/15-watch.gif)

## Version Control Integration

Expand Down Expand Up @@ -239,6 +239,7 @@ For example:
const localStorageMock = {
getItem: jest.fn(),
setItem: jest.fn(),
removeItem: jest.fn(),
clear: jest.fn(),
};
global.localStorage = localStorageMock;
Expand All @@ -263,7 +264,7 @@ Similarly, `fit()` lets you focus on a specific test without running any other t
Jest has an integrated coverage reporter that works well with ES6 and requires no configuration.<br>
Run `npm test -- --coverage` (note extra `--` in the middle) to include a coverage report like this:
![coverage report](http://i.imgur.com/5bFhnTS.png)
![coverage report](https://i.imgur.com/5bFhnTS.png)
Note that tests run much slower with coverage so it is recommended to run it separately from your normal workflow.
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const siteConfig = {

// For no header links in the top nav bar -> headerLinks: [],
headerLinks: [
{ doc: 'getting-started', label: 'Getting Started' },
{ doc: 'getting-started', label: 'Docs' },
{ href: 'https://reactjs.org/community/support.html', label: 'Help' },
{
href: 'https://www.github.com/facebook/create-react-app',
Expand Down
10 changes: 10 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[build]
base = "docusaurus/website"
publish = "docusaurus/website/build"
command = "yarn build"


# A redirect rule with all the supported properties
[[redirects]]
from = "/"
to = "/create-react-app"
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"jest": "^23.6.0",
"lerna": "2.9.1",
"lerna-changelog": "^0.7.0",
"lint-staged": "^7.0.5",
"lint-staged": "^8.0.4",
"meow": "^5.0.0",
"multimatch": "^2.1.0",
"prettier": "1.14.3",
"prettier": "1.15.2",
"puppeteer": "^1.8.0",
"strip-ansi": "^4.0.0",
"svg-term-cli": "^2.1.1",
Expand All @@ -44,7 +44,7 @@
}
},
"lint-staged": {
"*.{js,md,css}": [
"*.{js,md,css,html}": [
"prettier --trailing-comma es5 --single-quote --write",
"git add"
],
Expand Down
Loading

0 comments on commit fb0b775

Please sign in to comment.