Skip to content

Commit 5411717

Browse files
committed
Merge branch 'master' into zangrafx
* master: Add WebStorm >2017 launchEditor Support (facebook#2414) docs: update `jest-enzyme` section (facebook#2392) Fix detection of parent directory in ModuleScopePlugin (facebook#2405) Added cache clear to e2e scripts (facebook#2400) Fix kill command in e2e-kitchensink.sh cleanup (facebook#2397) Revert "Catch "No tests found" during CI" (facebook#2390) Fix wrong path expansion in end-to-end test (facebook#2388) Suggest just "yarn build" (facebook#2385) Catch "No tests found" during CI (facebook#2387) Publish Add changelog for 1.0.7 (facebook#2384) Update webpack to 2.6.1 (facebook#2383) Consistently set environment variables (facebook#2382) Disable comparisons feature in uglify compression in production (facebook#2379) Removed the overriding of reduce_vars to false since webpack v2.6.0 included the fixed for Uglify bug (facebook#2351)
2 parents d0fc718 + 0da313f commit 5411717

File tree

15 files changed

+161
-21
lines changed

15 files changed

+161
-21
lines changed

CHANGELOG.md

+50
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
1+
## 1.0.7 (May 27, 2017)
2+
3+
#### :bug: Bug Fix
4+
5+
* `react-scripts`
6+
7+
* [#2382](https://github.com/facebookincubator/create-react-app/pull/2382) Consistently set environment variables. ([@gaearon](https://github.com/gaearon))
8+
* [#2379](https://github.com/facebookincubator/create-react-app/pull/2379) Temporarily disable `comparisons` feature in uglify compression. ([@davidascher](https://github.com/davidascher))
9+
10+
#### :nail_care: Enhancement
11+
12+
* `react-scripts`
13+
14+
* [#2383](https://github.com/facebookincubator/create-react-app/pull/2383) Update webpack to 2.6.1. ([@gaearon](https://github.com/gaearon))
15+
* [#2349](https://github.com/facebookincubator/create-react-app/pull/2349) Update webpack to v2.6.0. ([@ingro](https://github.com/ingro))
16+
* [#2351](https://github.com/facebookincubator/create-react-app/pull/2351) Removed the overriding of `reduce_vars` since webpack v2.6.0 included fix of Uglify. ([@Zaccc123](https://github.com/Zaccc123))
17+
18+
* `react-dev-utils`, `react-scripts`
19+
20+
* [#2361](https://github.com/facebookincubator/create-react-app/pull/2361) Print file sizes with correct build folder path. ([@fezhengjin](https://github.com/fezhengjin))
21+
22+
#### :memo: Documentation
23+
24+
* `react-scripts`
25+
26+
* [#2372](https://github.com/facebookincubator/create-react-app/pull/2372) Update README.md for `now` deployments. ([@purplecones](https://github.com/purplecones))
27+
* [#2350](https://github.com/facebookincubator/create-react-app/pull/2350) Fix broken links. ([@gaearon](https://github.com/gaearon))
28+
29+
#### Committers: 6
30+
- Dan Abramov ([gaearon](https://github.com/gaearon))
31+
- David Ascher ([davidascher](https://github.com/davidascher))
32+
- Emanuele Ingrosso ([ingro](https://github.com/ingro))
33+
- Jin Zheng ([fezhengjin](https://github.com/fezhengjin))
34+
- Mirza Joldic ([purplecones](https://github.com/purplecones))
35+
- Zac Kwan ([Zaccc123](https://github.com/Zaccc123))
36+
37+
### Migrating from 1.0.6 to 1.0.7
38+
39+
Inside any created project that has not been ejected, run:
40+
41+
```
42+
npm install --save-dev --save-exact [email protected]
43+
```
44+
45+
or
46+
47+
```
48+
yarn add --dev --exact [email protected]
49+
```
50+
151
## 1.0.6 (May 24, 2017)
252

353
#### :bug: Bug Fix

packages/react-dev-utils/ModuleScopePlugin.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ class ModuleScopePlugin {
3737
// Maybe an indexOf === 0 would be better?
3838
const relative = path.relative(appSrc, request.context.issuer);
3939
// If it's not in src/ or a subdirectory, not our request!
40-
if (relative[0] === '.') {
40+
if (
41+
relative.startsWith('../') ||
42+
relative.startsWith('..\\')
43+
) {
4144
return callback();
4245
}
4346
// Find path from src to the requested file
@@ -49,7 +52,10 @@ class ModuleScopePlugin {
4952
)
5053
);
5154
// Error if in a parent directory of src/
52-
if (requestRelative[0] === '.') {
55+
if (
56+
requestRelative.startsWith('../') ||
57+
requestRelative.startsWith('..\\')
58+
) {
5359
callback(
5460
new Error(
5561
`You attempted to import ${chalk.cyan(request.__innerRequest_request)} which falls outside of the project ${chalk.cyan('src/')} directory. ` +

packages/react-dev-utils/WebpackDevServerUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function printInstructions(appName, urls, useYarn) {
107107
console.log('Note that the development build is not optimized.');
108108
console.log(
109109
`To create a production build, use ` +
110-
`${chalk.cyan(`${useYarn ? 'yarn' : 'npm'} run build`)}.`
110+
`${chalk.cyan(`${useYarn ? 'yarn' : 'npm run'} build`)}.`
111111
);
112112
console.log();
113113
}

packages/react-dev-utils/launchEditor.js

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ function getArgumentsForLineNumber(editor, fileName, lineNumber, workspace) {
7272
['-g', fileName + ':' + lineNumber],
7373
workspace
7474
);
75+
case 'webstorm':
76+
case 'webstorm64':
77+
return addWorkspaceToArgumentsIfExists(
78+
['--line', lineNumber, fileName],
79+
workspace
80+
);
7581
}
7682

7783
// For all others, drop the lineNumber until we have

packages/react-dev-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-dev-utils",
3-
"version": "2.0.1",
3+
"version": "3.0.0",
44
"description": "Webpack utilities used by Create React App",
55
"repository": "facebookincubator/create-react-app",
66
"license": "BSD-3-Clause",

packages/react-error-overlay/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-error-overlay",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "An overlay for displaying stack frames.",
55
"main": "lib/index.js",
66
"scripts": {
@@ -34,7 +34,7 @@
3434
"anser": "1.2.5",
3535
"babel-code-frame": "6.22.0",
3636
"babel-runtime": "6.23.0",
37-
"react-dev-utils": "^2.0.1",
37+
"react-dev-utils": "^3.0.0",
3838
"settle-promise": "1.0.0",
3939
"source-map": "0.5.6"
4040
},

packages/react-scripts/config/webpack.config.prod.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,11 @@ module.exports = {
290290
new webpack.optimize.UglifyJsPlugin({
291291
compress: {
292292
warnings: false,
293-
// This feature has been reported as buggy a few times, such as:
294-
// https://github.com/mishoo/UglifyJS2/issues/1964
295-
// We'll wait with enabling it by default until it is more solid.
296-
reduce_vars: false,
293+
// Disabled because of an issue with Uglify breaking seemingly valid code:
294+
// https://github.com/facebookincubator/create-react-app/issues/2376
295+
// Pending further investigation:
296+
// https://github.com/mishoo/UglifyJS2/issues/2011
297+
comparisons: false,
297298
},
298299
output: {
299300
comments: false,

packages/react-scripts/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scripts",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "Configuration and scripts for Create React App.",
55
"repository": "facebookincubator/create-react-app",
66
"license": "BSD-3-Clause",
@@ -49,12 +49,12 @@
4949
"postcss-flexbugs-fixes": "3.0.0",
5050
"postcss-loader": "2.0.5",
5151
"promise": "7.1.1",
52-
"react-dev-utils": "^2.0.1",
53-
"react-error-overlay": "^1.0.6",
52+
"react-dev-utils": "^3.0.0",
53+
"react-error-overlay": "^1.0.7",
5454
"style-loader": "0.17.0",
5555
"sw-precache-webpack-plugin": "0.9.1",
5656
"url-loader": "0.5.8",
57-
"webpack": "2.6.0",
57+
"webpack": "2.6.1",
5858
"webpack-dev-server": "2.4.5",
5959
"webpack-manifest-plugin": "1.1.0",
6060
"whatwg-fetch": "2.0.3"

packages/react-scripts/scripts/build.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'use strict';
1212

1313
// Do this as the first thing so that any code reading it knows the right env.
14+
process.env.BABEL_ENV = 'production';
1415
process.env.NODE_ENV = 'production';
1516

1617
// Makes the script crash on unhandled rejections instead of silently

packages/react-scripts/scripts/start.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@
1010
// @remove-on-eject-end
1111
'use strict';
1212

13+
// Do this as the first thing so that any code reading it knows the right env.
14+
process.env.BABEL_ENV = 'development';
15+
process.env.NODE_ENV = 'development';
16+
1317
// Makes the script crash on unhandled rejections instead of silently
1418
// ignoring them. In the future, promise rejections that are not handled will
1519
// terminate the Node.js process with a non-zero exit code.
1620
process.on('unhandledRejection', err => {
1721
throw err;
1822
});
1923

20-
process.env.NODE_ENV = 'development';
21-
2224
// Ensure environment variables are read.
2325
require('../config/env');
2426

packages/react-scripts/scripts/test.js

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// @remove-on-eject-end
1111
'use strict';
1212

13+
// Do this as the first thing so that any code reading it knows the right env.
14+
process.env.BABEL_ENV = 'test';
1315
process.env.NODE_ENV = 'test';
1416
process.env.PUBLIC_URL = '';
1517

packages/react-scripts/template/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1171,10 +1171,10 @@ Additionally, you might find [jest-enzyme](https://github.com/blainekasten/enzym
11711171
expect(wrapper).toContainReact(welcome)
11721172
```
11731173

1174-
To setup jest-enzyme with Create React App, follow the instructions for [initializing your test environment](#initializing-test-environment) to import `jest-enzyme`. **Note that currently only version 2.x is compatible with Create React App.**
1174+
To setup jest-enzyme with Create React App, follow the instructions for [initializing your test environment](#initializing-test-environment) to import `jest-enzyme`.
11751175

11761176
```sh
1177-
npm install --save-dev jest-enzyme@2.x
1177+
npm install --save-dev jest-enzyme
11781178
```
11791179

11801180
```js

tasks/e2e-installs.sh

+24
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,30 @@ set -x
8383
cd ..
8484
root_path=$PWD
8585

86+
# Clear cache to avoid issues with incorrect packages being used
87+
if hash yarnpkg 2>/dev/null
88+
then
89+
# AppVeyor uses an old version of yarn.
90+
# Once updated to 0.24.3 or above, the workaround can be removed
91+
# and replaced with `yarnpkg cache clean`
92+
# Issues:
93+
# https://github.com/yarnpkg/yarn/issues/2591
94+
# https://github.com/appveyor/ci/issues/1576
95+
# https://github.com/facebookincubator/create-react-app/pull/2400
96+
# When removing workaround, you may run into
97+
# https://github.com/facebookincubator/create-react-app/issues/2030
98+
case "$(uname -s)" in
99+
*CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;;
100+
*) yarn=yarnpkg;;
101+
esac
102+
$yarn cache clean
103+
fi
104+
105+
if hash npm 2>/dev/null
106+
then
107+
npm cache clean
108+
fi
109+
86110
# Prevent lerna bootstrap, we only want top-level dependencies
87111
cp package.json package.json.bak
88112
grep -v "lerna bootstrap" package.json > temp && mv temp package.json

tasks/e2e-kitchensink.sh

+27-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ temp_module_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_module_path'`
2222

2323
function cleanup {
2424
echo 'Cleaning up.'
25-
ps -ef | grep 'react-scripts' | grep -v grep | awk '{print $2}' | xargs kill -s 9
25+
ps -ef | grep 'react-scripts' | grep -v grep | awk '{print $2}' | xargs kill -9
2626
cd "$root_path"
2727
# TODO: fix "Device or resource busy" and remove ``|| $CI`
2828
rm -rf "$temp_cli_path" "$temp_app_path" "$temp_module_path" || $CI
@@ -66,6 +66,30 @@ set -x
6666
cd ..
6767
root_path=$PWD
6868

69+
# Clear cache to avoid issues with incorrect packages being used
70+
if hash yarnpkg 2>/dev/null
71+
then
72+
# AppVeyor uses an old version of yarn.
73+
# Once updated to 0.24.3 or above, the workaround can be removed
74+
# and replaced with `yarnpkg cache clean`
75+
# Issues:
76+
# https://github.com/yarnpkg/yarn/issues/2591
77+
# https://github.com/appveyor/ci/issues/1576
78+
# https://github.com/facebookincubator/create-react-app/pull/2400
79+
# When removing workaround, you may run into
80+
# https://github.com/facebookincubator/create-react-app/issues/2030
81+
case "$(uname -s)" in
82+
*CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;;
83+
*) yarn=yarnpkg;;
84+
esac
85+
$yarn cache clean
86+
fi
87+
88+
if hash npm 2>/dev/null
89+
then
90+
npm cache clean
91+
fi
92+
6993
# Prevent lerna bootstrap, we only want top-level dependencies
7094
cp package.json package.json.bak
7195
grep -v "lerna bootstrap" package.json > temp && mv temp package.json
@@ -156,7 +180,7 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
156180
CI=true \
157181
NODE_PATH=src \
158182
NODE_ENV=test \
159-
npm test -- --no-cache --testPathPattern="/src/"
183+
npm test -- --no-cache --testPathPattern=src
160184

161185
# Test "development" environment
162186
tmp_server_log=`mktemp`
@@ -220,7 +244,7 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
220244
CI=true \
221245
NODE_PATH=src \
222246
NODE_ENV=test \
223-
npm test -- --no-cache --testPathPattern='/src/'
247+
npm test -- --no-cache --testPathPattern=src
224248

225249
# Test "development" environment
226250
tmp_server_log=`mktemp`

tasks/e2e-simple.sh

+24
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,30 @@ set -x
6565
cd ..
6666
root_path=$PWD
6767

68+
# Clear cache to avoid issues with incorrect packages being used
69+
if hash yarnpkg 2>/dev/null
70+
then
71+
# AppVeyor uses an old version of yarn.
72+
# Once updated to 0.24.3 or above, the workaround can be removed
73+
# and replaced with `yarnpkg cache clean`
74+
# Issues:
75+
# https://github.com/yarnpkg/yarn/issues/2591
76+
# https://github.com/appveyor/ci/issues/1576
77+
# https://github.com/facebookincubator/create-react-app/pull/2400
78+
# When removing workaround, you may run into
79+
# https://github.com/facebookincubator/create-react-app/issues/2030
80+
case "$(uname -s)" in
81+
*CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;;
82+
*) yarn=yarnpkg;;
83+
esac
84+
$yarn cache clean
85+
fi
86+
87+
if hash npm 2>/dev/null
88+
then
89+
npm cache clean
90+
fi
91+
6892
# Prevent lerna bootstrap, we only want top-level dependencies
6993
cp package.json package.json.bak
7094
grep -v "lerna bootstrap" package.json > temp && mv temp package.json

0 commit comments

Comments
 (0)