Skip to content

Commit 1515ab4

Browse files
Merge branch 'master' into serve-app-under
* master: (32 commits) Publish Reorder publishing instructions Changelog for 1.0.16 (facebook#3376) Update favicon description (facebook#3374) Changelog for 1.0.15 (facebook#3357) Replace template literal; fixes facebook#3367 (facebook#3368) [email protected] Publish Add preflight CWD check for npm (facebook#3355) Stop using `npm link` in tests (facebook#3345) Fix for add .gitattributes file facebook#3080 (facebook#3122) Mention that start_url needs to be "." for client side routing start using npm-run-all to build scss and js (facebook#2957) Updating the Service Worker opt-out documentation (facebook#3108) Remove an useless negation in registerServiceWorker.js (facebook#3150) Remove output.path from dev webpack config (facebook#3158) Add `.mjs` support (facebook#3239) Add documentation for Enzyme 3 integration (facebook#3286) Make uglify work in Safari 10.0 - fixes facebook#3280 (facebook#3281) Fix favicon sizes value in manifest (facebook#3287) ...
2 parents 57dce7d + dc95d18 commit 1515ab4

22 files changed

+465
-102
lines changed

CHANGELOG.md

+147
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,150 @@
1+
## 1.0.16 (October 31, 2017) 🎃
2+
3+
#### :bug: Bug Fix
4+
5+
* `react-scripts`
6+
7+
* [#3374](https://github.com/facebookincubator/create-react-app/pull/3374) Set correct image type and sizes in `manifest.json`. ([@piotr-cz](https://github.com/piotr-cz))
8+
9+
* `react-dev-utils`
10+
11+
* [#3368](https://github.com/facebookincubator/create-react-app/pull/3368) Fix a crash in development mode in older browsers. ([@felthy](https://github.com/felthy))
12+
13+
#### Committers: 2
14+
15+
- Dan Abramov ([gaearon](https://github.com/gaearon))
16+
- Piotr ([piotr-cz](https://github.com/piotr-cz))
17+
18+
### Migrating from 1.0.15 to 1.0.16
19+
20+
Inside any created project that has not been ejected, run:
21+
22+
```
23+
npm install --save --save-exact [email protected]
24+
```
25+
26+
or
27+
28+
```
29+
yarn add --exact [email protected]
30+
```
31+
32+
## 1.0.15 (October 30, 2017)
33+
34+
#### :bug: Bug Fix
35+
36+
* `react-scripts`
37+
38+
* [#3287](https://github.com/facebookincubator/create-react-app/pull/3287) Fix favicon sizes value in the project manifest. ([@ryansully](https://github.com/ryansully))
39+
40+
* `react-dev-utils`, `react-scripts`
41+
42+
* [#3230](https://github.com/facebookincubator/create-react-app/pull/3230) Fix watching for changes in `src/node_modules`. ([@xjlim](https://github.com/xjlim))
43+
44+
#### :nail_care: Enhancement
45+
46+
* `react-scripts`
47+
48+
* [#3239](https://github.com/facebookincubator/create-react-app/pull/3239) Allow importing `.mjs` files. ([@Timer](https://github.com/Timer))
49+
* [#3340](https://github.com/facebookincubator/create-react-app/pull/3340) Polyfill `requestAnimationFrame` in test environment. ([@gaearon](https://github.com/gaearon))
50+
51+
* `babel-preset-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts`
52+
53+
* [#3342](https://github.com/facebookincubator/create-react-app/pull/3342) Bump dependencies. ([@gaearon](https://github.com/gaearon))
54+
55+
* `react-dev-utils`, `react-error-overlay`
56+
57+
* [#3100](https://github.com/facebookincubator/create-react-app/pull/3100) Add click-to-open support for build errors. ([@tharakawj](https://github.com/tharakawj))
58+
59+
* `create-react-app`
60+
61+
* [#3355](https://github.com/facebookincubator/create-react-app/pull/3355) Add preflight CWD check for npm to detect bad Windows setups. ([@gaearon](https://github.com/gaearon))
62+
63+
#### :memo: Documentation
64+
65+
* User Guide
66+
67+
* [#2957](https://github.com/facebookincubator/create-react-app/pull/2957) Use `npm-run-all` to build Sass and JS. ([@shime](https://github.com/shime))
68+
* [#3108](https://github.com/facebookincubator/create-react-app/pull/3108) Update the Service Worker opt-out documentation. ([@captDaylight](https://github.com/captDaylight))
69+
* [#3286](https://github.com/facebookincubator/create-react-app/pull/3286) Add documentation for Enzyme 3 integration. ([@ryansully](https://github.com/ryansully))
70+
* [#3328](https://github.com/facebookincubator/create-react-app/pull/3328) Recommend react-snap as an alternative to react-snapshot. ([@aaronshaf](https://github.com/aaronshaf))
71+
* [#3279](https://github.com/facebookincubator/create-react-app/pull/3279) Add jest coverage configuration docs. ([@mattphillips](https://github.com/mattphillips))
72+
* [#3303](https://github.com/facebookincubator/create-react-app/pull/3303) Update link to Jest Expect docs. ([@jbranchaud](https://github.com/jbranchaud))
73+
* [#3289](https://github.com/facebookincubator/create-react-app/pull/3289) Fix dead link to Jest "expect" docs. ([@alexkrolick](https://github.com/alexkrolick))
74+
* [#3265](https://github.com/facebookincubator/create-react-app/pull/3265) Add external links to deployment services. ([@aericson](https://github.com/aericson))
75+
* [#3075](https://github.com/facebookincubator/create-react-app/pull/3075) Minor docs change to highlight dev proxy behaviour. ([@davidjb](https://github.com/davidjb))
76+
* [#3185](https://github.com/facebookincubator/create-react-app/pull/3185) Correct manual proxy documentation. ([@robertpanzer](https://github.com/robertpanzer))
77+
78+
* README
79+
80+
* [#3227](https://github.com/facebookincubator/create-react-app/pull/3227) Fix package management link in README for issue #3218. ([@nishina555](https://github.com/nishina555))
81+
* [#3211](https://github.com/facebookincubator/create-react-app/pull/3211) Improve grammar in README. ([@Mohamed3on](https://github.com/Mohamed3on))
82+
83+
#### :house: Internal
84+
85+
* Other
86+
87+
* [#3345](https://github.com/facebookincubator/create-react-app/pull/3345) Stop using `npm link` in tests. ([@Timer](https://github.com/Timer))
88+
89+
* `react-error-overlay`
90+
91+
* [#3122](https://github.com/facebookincubator/create-react-app/pull/3122) Fix for add .gitattributes file #3080. ([@ijajmulani](https://github.com/ijajmulani))
92+
* [#3267](https://github.com/facebookincubator/create-react-app/pull/3267) Use production React version for bundled overlay. ([@Timer](https://github.com/Timer))
93+
* [#3264](https://github.com/facebookincubator/create-react-app/pull/3264) Add warning when using `react-error-overlay` in production. ([@Timer](https://github.com/Timer))
94+
* [#3263](https://github.com/facebookincubator/create-react-app/pull/3263) `react-error-overlay` has no dependencies now (it's bundled). ([@Timer](https://github.com/Timer))
95+
* [#3142](https://github.com/facebookincubator/create-react-app/pull/3142) Make error overlay run in the context of the iframe. ([@tharakawj](https://github.com/tharakawj))
96+
97+
* `react-scripts`
98+
99+
* [#3150](https://github.com/facebookincubator/create-react-app/pull/3150) Remove an useless negation in `registerServiceWorker.js`. ([@dunglas](https://github.com/dunglas))
100+
* [#3158](https://github.com/facebookincubator/create-react-app/pull/3158) Remove `output.path` from dev webpack config. ([@nikolas](https://github.com/nikolas))
101+
* [#3281](https://github.com/facebookincubator/create-react-app/pull/3281) Add a workaround for Uglify incompatiblity with Safari 10.0 in the future. ([@satyavh](https://github.com/satyavh))
102+
* [#3146](https://github.com/facebookincubator/create-react-app/pull/3146) Fix `reason-react` support. ([@lpalmes](https://github.com/lpalmes))
103+
* [#3236](https://github.com/facebookincubator/create-react-app/pull/3236) Update `style-loader` and disable inclusion of its HMR code in builds. ([@insin](https://github.com/insin))
104+
* [#3246](https://github.com/facebookincubator/create-react-app/pull/3246) Update `url-loader` to 0.6.2 for mime ReDoS vulnerability. ([@d3viant0ne](https://github.com/d3viant0ne))
105+
* [#2914](https://github.com/facebookincubator/create-react-app/pull/2914) `<!doctype html>` -> `<!DOCTYPE html>`. ([@Hurtak](https://github.com/Hurtak))
106+
107+
#### Committers: 24
108+
109+
- Aaron Shafovaloff ([aaronshaf](https://github.com/aaronshaf))
110+
- Alex ([alexkrolick](https://github.com/alexkrolick))
111+
- André Ericson ([aericson](https://github.com/aericson))
112+
- Dan Abramov ([gaearon](https://github.com/gaearon))
113+
- David Beitey ([davidjb](https://github.com/davidjb))
114+
- Hrvoje Šimić ([shime](https://github.com/shime))
115+
- IJAJ MULANI ([ijajmulani](https://github.com/ijajmulani))
116+
- Joe Haddad ([Timer](https://github.com/Timer))
117+
- Joe Lim ([xjlim](https://github.com/xjlim))
118+
- Jonny Buchanan ([insin](https://github.com/insin))
119+
- Josh Branchaud ([jbranchaud](https://github.com/jbranchaud))
120+
- Joshua Wiens ([d3viant0ne](https://github.com/d3viant0ne))
121+
- Kévin Dunglas ([dunglas](https://github.com/dunglas))
122+
- Lorenzo Palmes ([lpalmes](https://github.com/lpalmes))
123+
- Matt Phillips ([mattphillips](https://github.com/mattphillips))
124+
- Mohamed Oun ([Mohamed3on](https://github.com/Mohamed3on))
125+
- Nik Nyby ([nikolas](https://github.com/nikolas))
126+
- Petr Huřťák ([Hurtak](https://github.com/Hurtak))
127+
- Robert Panzer ([robertpanzer](https://github.com/robertpanzer))
128+
- Ryan Sullivan ([ryansully](https://github.com/ryansully))
129+
- Satya van Heummen ([satyavh](https://github.com/satyavh))
130+
- Tharaka Wijebandara ([tharakawj](https://github.com/tharakawj))
131+
- Toshiharu Nishina ([nishina555](https://github.com/nishina555))
132+
- [captDaylight](https://github.com/captDaylight)
133+
134+
### Migrating from 1.0.14 to 1.0.15
135+
136+
Inside any created project that has not been ejected, run:
137+
138+
```
139+
npm install --save --save-exact [email protected]
140+
```
141+
142+
or
143+
144+
```
145+
yarn add --exact [email protected]
146+
```
147+
1148
## 1.0.14 (September 26, 2017)
2149

3150
#### :bug: Bug Fix

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ More detailed information are in the dedicated [README](/packages/react-scripts/
108108
* 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.
109109
* 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.
110110
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.
111+
7. **Do not run `npm publish`. Instead, run `npm run publish`.**
112+
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.
113+
9. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.
114114

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

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

+3-3
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"

packages/babel-preset-react-app/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-preset-react-app",
3-
"version": "3.0.3",
3+
"version": "3.1.0",
44
"description": "Babel preset used by Create React App",
55
"repository": "facebookincubator/create-react-app",
66
"license": "MIT",
@@ -11,17 +11,17 @@
1111
"index.js"
1212
],
1313
"dependencies": {
14-
"babel-plugin-dynamic-import-node": "1.0.2",
14+
"babel-plugin-dynamic-import-node": "1.1.0",
1515
"babel-plugin-syntax-dynamic-import": "6.18.0",
1616
"babel-plugin-transform-class-properties": "6.24.1",
17-
"babel-plugin-transform-object-rest-spread": "6.23.0",
17+
"babel-plugin-transform-object-rest-spread": "6.26.0",
1818
"babel-plugin-transform-react-constant-elements": "6.23.0",
1919
"babel-plugin-transform-react-jsx": "6.24.1",
2020
"babel-plugin-transform-react-jsx-self": "6.22.0",
2121
"babel-plugin-transform-react-jsx-source": "6.22.0",
22-
"babel-plugin-transform-regenerator": "6.24.1",
22+
"babel-plugin-transform-regenerator": "6.26.0",
2323
"babel-plugin-transform-runtime": "6.23.0",
24-
"babel-preset-env": "1.5.2",
24+
"babel-preset-env": "1.6.1",
2525
"babel-preset-react": "6.24.1"
2626
},
2727
"peerDependencies": {

packages/create-react-app/createReactApp.js

+76-3
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,13 @@ function createApp(name, verbose, version, template) {
158158
path.join(root, 'package.json'),
159159
JSON.stringify(packageJson, null, 2)
160160
);
161+
162+
const useYarn = shouldUseYarn();
161163
const originalDirectory = process.cwd();
162164
process.chdir(root);
165+
if (!useYarn && !checkThatNpmCanReadCwd()) {
166+
process.exit(1);
167+
}
163168

164169
if (!semver.satisfies(process.version, '>=6.0.0')) {
165170
console.log(
@@ -172,7 +177,6 @@ function createApp(name, verbose, version, template) {
172177
version = '[email protected]';
173178
}
174179

175-
const useYarn = shouldUseYarn();
176180
if (!useYarn) {
177181
const npmInfo = checkNpmVersion();
178182
if (!npmInfo.hasMinNpm) {
@@ -200,7 +204,7 @@ function shouldUseYarn() {
200204
}
201205
}
202206

203-
function install(useYarn, dependencies, verbose, isOnline) {
207+
function install(root, useYarn, dependencies, verbose, isOnline) {
204208
return new Promise((resolve, reject) => {
205209
let command;
206210
let args;
@@ -212,6 +216,14 @@ function install(useYarn, dependencies, verbose, isOnline) {
212216
}
213217
[].push.apply(args, dependencies);
214218

219+
// Explicitly set cwd() to work around issues like
220+
// https://github.com/facebookincubator/create-react-app/issues/3326.
221+
// Unfortunately we can only do this for Yarn because npm support for
222+
// equivalent --prefix flag doesn't help with this issue.
223+
// This is why for npm, we run checkThatNpmCanReadCwd() early instead.
224+
args.push('--cwd');
225+
args.push(root);
226+
215227
if (!isOnline) {
216228
console.log(chalk.yellow('You appear to be offline.'));
217229
console.log(chalk.yellow('Falling back to the local Yarn cache.'));
@@ -275,7 +287,7 @@ function run(
275287
);
276288
console.log();
277289

278-
return install(useYarn, allDependencies, verbose, isOnline).then(
290+
return install(root, useYarn, allDependencies, verbose, isOnline).then(
279291
() => packageName
280292
);
281293
})
@@ -606,6 +618,67 @@ function isSafeToCreateProjectIn(root, name) {
606618
return false;
607619
}
608620

621+
function checkThatNpmCanReadCwd() {
622+
const cwd = process.cwd();
623+
let childOutput = null;
624+
try {
625+
// Note: intentionally using spawn over exec since
626+
// the problem doesn't reproduce otherwise.
627+
// `npm config list` is the only reliable way I could find
628+
// to reproduce the wrong path. Just printing process.cwd()
629+
// in a Node process was not enough.
630+
childOutput = spawn.sync('npm', ['config', 'list']).output.join('');
631+
} catch (err) {
632+
// Something went wrong spawning node.
633+
// Not great, but it means we can't do this check.
634+
// We might fail later on, but let's continue.
635+
return true;
636+
}
637+
if (typeof childOutput !== 'string') {
638+
return true;
639+
}
640+
const lines = childOutput.split('\n');
641+
// `npm config list` output includes the following line:
642+
// "; cwd = C:\path\to\current\dir" (unquoted)
643+
// I couldn't find an easier way to get it.
644+
const prefix = '; cwd = ';
645+
const line = lines.find(line => line.indexOf(prefix) === 0);
646+
if (typeof line !== 'string') {
647+
// Fail gracefully. They could remove it.
648+
return true;
649+
}
650+
const npmCWD = line.substring(prefix.length);
651+
if (npmCWD === cwd) {
652+
return true;
653+
}
654+
console.error(
655+
chalk.red(
656+
`Could not start an npm process in the right directory.\n\n` +
657+
`The current directory is: ${chalk.bold(cwd)}\n` +
658+
`However, a newly started npm process runs in: ${chalk.bold(
659+
npmCWD
660+
)}\n\n` +
661+
`This is probably caused by a misconfigured system terminal shell.`
662+
)
663+
);
664+
if (process.platform === 'win32') {
665+
console.error(
666+
chalk.red(`On Windows, this can usually be fixed by running:\n\n`) +
667+
` ${chalk.cyan(
668+
'reg'
669+
)} delete "HKCU\\Software\\Microsoft\\Command Processor" /v AutoRun /f\n` +
670+
` ${chalk.cyan(
671+
'reg'
672+
)} delete "HKLM\\Software\\Microsoft\\Command Processor" /v AutoRun /f\n\n` +
673+
chalk.red(`Try to run the above two lines in the terminal.\n`) +
674+
chalk.red(
675+
`To learn more about this problem, read: https://blogs.msdn.microsoft.com/oldnewthing/20071121-00/?p=24433/`
676+
)
677+
);
678+
}
679+
return false;
680+
}
681+
609682
function checkIfOnline(useYarn) {
610683
if (!useYarn) {
611684
// Don't ping the Yarn registry.

packages/create-react-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-react-app",
3-
"version": "1.4.1",
3+
"version": "1.4.3",
44
"keywords": [
55
"react"
66
],

packages/react-dev-utils/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-dev-utils",
3-
"version": "4.1.0",
3+
"version": "4.2.1",
44
"description": "Webpack utilities used by Create React App",
55
"repository": "facebookincubator/create-react-app",
66
"license": "MIT",
@@ -35,19 +35,19 @@
3535
"webpackHotDevClient.js"
3636
],
3737
"dependencies": {
38-
"address": "1.0.2",
39-
"babel-code-frame": "6.22.0",
38+
"address": "1.0.3",
39+
"babel-code-frame": "6.26.0",
4040
"chalk": "1.1.3",
4141
"cross-spawn": "5.1.0",
4242
"detect-port-alt": "1.1.3",
4343
"escape-string-regexp": "1.0.5",
44-
"filesize": "3.5.10",
44+
"filesize": "3.5.11",
4545
"global-modules": "1.0.0",
4646
"gzip-size": "3.0.0",
47-
"inquirer": "3.2.1",
47+
"inquirer": "3.3.0",
4848
"is-root": "1.0.0",
4949
"opn": "5.1.0",
50-
"react-error-overlay": "^2.0.2",
50+
"react-error-overlay": "^3.0.0",
5151
"recursive-readdir": "2.2.1",
5252
"shell-quote": "1.6.1",
5353
"sockjs-client": "1.1.4",

packages/react-dev-utils/webpackHotDevClient.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ var ErrorOverlay = require('react-error-overlay');
2626
ErrorOverlay.setEditorHandler(function editorHandler(errorLocation) {
2727
// Keep this sync with errorOverlayMiddleware.js
2828
fetch(
29-
`${launchEditorEndpoint}?fileName=` +
29+
launchEditorEndpoint +
30+
'?fileName=' +
3031
window.encodeURIComponent(errorLocation.fileName) +
3132
'&lineNumber=' +
3233
window.encodeURIComponent(errorLocation.lineNumber || 1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.js text eol=lf

0 commit comments

Comments
 (0)