Skip to content

Commit c3d887d

Browse files
committed
# Conflicts: # README.md # packages/react-scripts/config/webpack.config.prod.js # packages/react-scripts/package.json # packages/react-scripts/template/src/App.css # packages/react-scripts/template/src/App.js
2 parents 03ae721 + dfbc71c commit c3d887d

File tree

218 files changed

+4329
-3110
lines changed

Some content is hidden

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

218 files changed

+4329
-3110
lines changed

.travis.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2+
dist: trusty
23
language: node_js
34
node_js:
4-
- 6
55
- 8
6+
- 9
67
cache:
78
directories:
89
- node_modules
@@ -13,18 +14,15 @@ script:
1314
- 'if [ $TEST_SUITE = "simple" ]; then tasks/e2e-simple.sh; fi'
1415
- 'if [ $TEST_SUITE = "installs" ]; then tasks/e2e-installs.sh; fi'
1516
- 'if [ $TEST_SUITE = "kitchensink" ]; then tasks/e2e-kitchensink.sh; fi'
17+
- 'if [ $TEST_SUITE = "old-node" ]; then tasks/e2e-old-node.sh; fi'
1618
env:
17-
global:
18-
- USE_YARN=no
1919
matrix:
2020
- TEST_SUITE=simple
2121
- TEST_SUITE=installs
2222
- TEST_SUITE=kitchensink
2323
matrix:
2424
include:
2525
- node_js: 0.10
26-
env: TEST_SUITE=simple
27-
# There's a weird Yarn/Lerna bug related to prerelease versions.
28-
# TODO: reenable after we ship 1.0.
29-
# - node_js: 6
30-
# env: USE_YARN=yes TEST_SUITE=simple
26+
env: TEST_SUITE=old-node
27+
- node_js: 6
28+
env: TEST_SUITE=kitchensink

.yarnrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--install.no-lockfile true
2+
--install.check-files true
3+
--add.no-lockfile true

CHANGELOG.md

+692-1
Large diffs are not rendered by default.

CODE_OF_CONDUCT.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.facebook.com/pages/876921332402685/open-source-code-of-conduct) so that you can understand what actions will and will not be tolerated.

CONTRIBUTING.md

+23-10
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,40 @@ All functionality must be retained (and configuration given to the user) if they
7575

7676
1. Clone the repo with `git clone https://github.com/facebookincubator/create-react-app`
7777

78-
2. Run `npm install` in the root `create-react-app` folder.
78+
2. Run `yarn` in the root `create-react-app` folder.
7979

80-
Once it is done, you can modify any file locally and run `npm start`, `npm test` or `npm run build` just like in a generated project.
80+
Once it is done, you can modify any file locally and run `yarn start`, `yarn test` or `yarn build` just like in a generated project.
8181

8282
If you want to try out the end-to-end flow with the global CLI, you can do this too:
8383

8484
```
85-
npm run create-react-app my-app
85+
yarn create-react-app my-app
8686
cd my-app
8787
```
8888

89-
and then run `npm start` or `npm run build`.
90-
91-
*Note: if you are using yarn, we suggest that you use `yarn install --no-lockfile` instead of the bare `yarn` or `yarn install` because we [intentionally](https://github.com/facebookincubator/create-react-app/pull/2014#issuecomment-300811661) do not ignore or add yarn.lock to our repo.*
89+
and then run `yarn start` or `yarn build`.
9290

9391
## Contributing to E2E (end to end) tests
9492

9593
**TL;DR** use the command `yarn e2e:docker` to run unit and e2e tests.
9694

9795
More detailed information are in the dedicated [README](/packages/react-scripts/fixtures/kitchensink/README.md).
9896

97+
## Tips for contributors using Windows
98+
99+
The scripts in tasks folder and other scripts in `package.json` will not work in Windows out of the box. However, using [Bash on windows](https://msdn.microsoft.com/en-us/commandline/wsl/about) makes it easier to use those scripts without any workarounds. The steps to do so are detailed below:
100+
101+
### Install Bash on Ubuntu on Windows
102+
103+
A good step by step guide can be found [here](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)
104+
105+
### Install Node.js and yarn
106+
Even if you have node and yarn installed on your windows, it would not be accessible from the bash shell. You would have to install it again. Installing via [`nvm`](https://github.com/creationix/nvm#install-script) is recommended.
107+
108+
### Line endings
109+
110+
By default git would use `CRLF` line endings which would cause the scripts to fail. You can change it for this repo only by setting `autocrlf` to false by running `git config core.autocrlf false`. You can also enable it for all your repos by using the `--global` flag if you wish to do so.
111+
99112
## Cutting a Release
100113

101114
1. Tag all merged pull requests that go into the release with the relevant milestone. Each merged PR should also be labeled with one of the [labels](https://github.com/facebookincubator/create-react-app/labels) named `tag: ...` to indicate what kind of change it is.
@@ -104,13 +117,13 @@ More detailed information are in the dedicated [README](/packages/react-scripts/
104117
4. Note that files in `packages/create-react-app` should be modified with extreme caution. Since it’s a global CLI, any version of `create-react-app` (global CLI) including very old ones should work with the latest version of `react-scripts`.
105118
5. Create a change log entry for the release:
106119
* You'll need an [access token for the GitHub API](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). Save it to this environment variable: `export GITHUB_AUTH="..."`
107-
* Run `npm run changelog`. The command will find all the labeled pull requests merged since the last release and group them by the label and affected packages, and create a change log entry with all the changes and links to PRs and their authors. Copy and paste it to `CHANGELOG.md`.
120+
* Run `yarn changelog`. The command will find all the labeled pull requests merged since the last release and group them by the label and affected packages, and create a change log entry with all the changes and links to PRs and their authors. Copy and paste it to `CHANGELOG.md`.
108121
* Add a four-space indented paragraph after each non-trivial list item, explaining what changed and why. For each breaking change also write who it affects and instructions for migrating existing code.
109122
* Maybe add some newlines here and there. Preview the result on GitHub to get a feel for it. Changelog generator output is a bit too terse for my taste, so try to make it visually pleasing and well grouped.
110123
6. Make sure to include “Migrating from ...” instructions for the previous release. Often you can copy and paste them.
111-
7. After merging the changelog update, create a GitHub Release with the same text. See previous Releases for inspiration.
112-
8. **Do not run `npm publish`. Instead, run `npm run publish`.**
113-
9. Wait for a long time, and it will get published. Don’t worry that it’s stuck. In the end the publish script will prompt for versions before publishing the packages.
124+
7. Run `npm run publish`. (It has to be `npm run publish` exactly, not just `npm publish` or `yarn publish`.)
125+
8. Wait for a long time, and it will get published. Don’t worry that it’s stuck. In the end the publish script will prompt for versions before publishing the packages.
126+
9. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.
114127

115128
Make sure to test the released version! If you want to be extra careful, you can publish a prerelease by running `npm run publish -- --tag next` instead of `npm run publish`.
116129

LICENSE

+17-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
1-
BSD License
1+
MIT License
22

3-
For create-react-app software
3+
Copyright (c) 2013-present, Facebook, Inc.
44

5-
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
611

7-
Redistribution and use in source and binary forms, with or without modification,
8-
are permitted provided that the following conditions are met:
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
914

10-
* Redistributions of source code must retain the above copyright notice, this
11-
list of conditions and the following disclaimer.
12-
13-
* Redistributions in binary form must reproduce the above copyright notice,
14-
this list of conditions and the following disclaimer in the documentation
15-
and/or other materials provided with the distribution.
16-
17-
* Neither the name Facebook nor the names of its contributors may be used to
18-
endorse or promote products derived from this software without specific
19-
prior written permission.
20-
21-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

PATENTS

-33
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ☢ custom-react-scripts ☢
2-
Latest version of original react-scripts: **1.0.11**
2+
Latest version of original react-scripts: **1.1.14**
33

44
### ⚠️ Disclaimer:
55
> This is **not** a fork of ```create-react-app```. It's just a fork of ```react-scripts``` with simple babel/webpack modifications that can toggle extra features.

appveyor.cleanup-cache.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ http://help.appveyor.com/discussions/questions/1310-delete-cache
33

44
----
55
Just testing if this works.
6+
lalala.

appveyor.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ image: Visual Studio 2017
22

33
environment:
44
matrix:
5-
- nodejs_version: 7
5+
- nodejs_version: 8
66
test_suite: "simple"
7-
- nodejs_version: 7
7+
- nodejs_version: 8
88
test_suite: "installs"
9-
- nodejs_version: 7
9+
- nodejs_version: 8
1010
test_suite: "kitchensink"
1111
- nodejs_version: 6
1212
test_suite: "simple"
@@ -28,8 +28,6 @@ platform:
2828
- x64
2929

3030
install:
31-
# TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed
32-
- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%
3331
- ps: Install-Product node $env:nodejs_version $env:platform
3432

3533
build: off
@@ -41,4 +39,4 @@ skip_commits:
4139
test_script:
4240
- node --version
4341
- npm --version
44-
- sh tasks/e2e-%test_suite%.sh
42+
- bash tasks/e2e-%test_suite%.sh

bootstrap.js

-67
This file was deleted.

lerna.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"lerna": "2.0.0",
2+
"lerna": "2.6.0",
3+
"npmClient": "yarn",
4+
"useWorkspaces": true,
35
"version": "independent",
46
"changelog": {
57
"repo": "facebookincubator/create-react-app",
@@ -12,8 +14,5 @@
1214
"tag: internal": ":house: Internal"
1315
},
1416
"cacheDir": ".changelog"
15-
},
16-
"packages": [
17-
"packages/*"
18-
]
17+
}
1918
}

package.json

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
{
22
"private": true,
3+
"workspaces": [
4+
"packages/*"
5+
],
36
"scripts": {
4-
"build": "node packages/react-scripts/scripts/build.js",
7+
"build": "cd packages/react-scripts && node scripts/build.js",
58
"changelog": "lerna-changelog",
6-
"create-react-app": "tasks/cra.sh",
9+
"create-react-app": "node tasks/cra.js",
710
"e2e": "tasks/e2e-simple.sh",
811
"e2e:docker": "tasks/local-test.sh",
9-
"postinstall": "node bootstrap.js && cd packages/react-error-overlay/ && npm run build:prod",
10-
"publish": "tasks/release.sh",
11-
"start": "node packages/react-scripts/scripts/start.js",
12-
"test": "node packages/react-scripts/scripts/test.js --env=jsdom",
12+
"postinstall": "cd packages/react-error-overlay/ && yarn build:prod",
13+
"publish": "tasks/publish.sh",
14+
"start": "cd packages/react-scripts && node scripts/start.js",
15+
"screencast": "svg-term --cast hItN7sl5yfCPTHxvFg5glhhfp --out screencast.svg --window",
16+
"test": "cd packages/react-scripts && node scripts/test.js --env=jsdom",
1317
"format": "prettier --trailing-comma es5 --single-quote --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'",
1418
"precommit": "lint-staged"
1519
},
1620
"devDependencies": {
1721
"eslint": "^4.4.1",
1822
"husky": "^0.13.2",
19-
"lerna": "^2.0.0",
23+
"lerna": "2.6.0",
2024
"lerna-changelog": "^0.6.0",
2125
"lint-staged": "^3.3.1",
22-
"prettier": "^1.5.2"
26+
"prettier": "1.6.1",
27+
"svg-term-cli": "^2.0.3"
2328
},
2429
"lint-staged": {
2530
"*.js": [

packages/babel-preset-react-app/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ If you want to use this Babel preset in a project not built with Create React Ap
1616

1717
First, [install Babel](https://babeljs.io/docs/setup/).
1818

19+
Then install babel-preset-react-app.
20+
21+
```sh
22+
npm install babel-preset-react-app --save-dev
23+
```
24+
1925
Then create a file named `.babelrc` with following contents in the root folder of your project:
2026

2127
```js

packages/babel-preset-react-app/index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97
'use strict';
108

119
const plugins = [
10+
// Necessary to include regardless of the environment because
11+
// in practice some other transforms (such as object-rest-spread)
12+
// don't work without it: https://github.com/babel/babel/issues/7215
13+
require.resolve('babel-plugin-transform-es2015-destructuring'),
1214
// class { handleClick = () => { } }
1315
require.resolve('babel-plugin-transform-class-properties'),
1416
// The following two plugins use Object.assign directly, instead of Babel's

0 commit comments

Comments
 (0)