forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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) ...
- Loading branch information
Showing
22 changed files
with
465 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,150 @@ | ||
## 1.0.16 (October 31, 2017) 🎃 | ||
|
||
#### :bug: Bug Fix | ||
|
||
* `react-scripts` | ||
|
||
* [#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)) | ||
|
||
* `react-dev-utils` | ||
|
||
* [#3368](https://github.com/facebookincubator/create-react-app/pull/3368) Fix a crash in development mode in older browsers. ([@felthy](https://github.com/felthy)) | ||
|
||
#### Committers: 2 | ||
|
||
- Dan Abramov ([gaearon](https://github.com/gaearon)) | ||
- Piotr ([piotr-cz](https://github.com/piotr-cz)) | ||
|
||
### Migrating from 1.0.15 to 1.0.16 | ||
|
||
Inside any created project that has not been ejected, run: | ||
|
||
``` | ||
npm install --save --save-exact [email protected] | ||
``` | ||
|
||
or | ||
|
||
``` | ||
yarn add --exact [email protected] | ||
``` | ||
|
||
## 1.0.15 (October 30, 2017) | ||
|
||
#### :bug: Bug Fix | ||
|
||
* `react-scripts` | ||
|
||
* [#3287](https://github.com/facebookincubator/create-react-app/pull/3287) Fix favicon sizes value in the project manifest. ([@ryansully](https://github.com/ryansully)) | ||
|
||
* `react-dev-utils`, `react-scripts` | ||
|
||
* [#3230](https://github.com/facebookincubator/create-react-app/pull/3230) Fix watching for changes in `src/node_modules`. ([@xjlim](https://github.com/xjlim)) | ||
|
||
#### :nail_care: Enhancement | ||
|
||
* `react-scripts` | ||
|
||
* [#3239](https://github.com/facebookincubator/create-react-app/pull/3239) Allow importing `.mjs` files. ([@Timer](https://github.com/Timer)) | ||
* [#3340](https://github.com/facebookincubator/create-react-app/pull/3340) Polyfill `requestAnimationFrame` in test environment. ([@gaearon](https://github.com/gaearon)) | ||
|
||
* `babel-preset-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` | ||
|
||
* [#3342](https://github.com/facebookincubator/create-react-app/pull/3342) Bump dependencies. ([@gaearon](https://github.com/gaearon)) | ||
|
||
* `react-dev-utils`, `react-error-overlay` | ||
|
||
* [#3100](https://github.com/facebookincubator/create-react-app/pull/3100) Add click-to-open support for build errors. ([@tharakawj](https://github.com/tharakawj)) | ||
|
||
* `create-react-app` | ||
|
||
* [#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)) | ||
|
||
#### :memo: Documentation | ||
|
||
* User Guide | ||
|
||
* [#2957](https://github.com/facebookincubator/create-react-app/pull/2957) Use `npm-run-all` to build Sass and JS. ([@shime](https://github.com/shime)) | ||
* [#3108](https://github.com/facebookincubator/create-react-app/pull/3108) Update the Service Worker opt-out documentation. ([@captDaylight](https://github.com/captDaylight)) | ||
* [#3286](https://github.com/facebookincubator/create-react-app/pull/3286) Add documentation for Enzyme 3 integration. ([@ryansully](https://github.com/ryansully)) | ||
* [#3328](https://github.com/facebookincubator/create-react-app/pull/3328) Recommend react-snap as an alternative to react-snapshot. ([@aaronshaf](https://github.com/aaronshaf)) | ||
* [#3279](https://github.com/facebookincubator/create-react-app/pull/3279) Add jest coverage configuration docs. ([@mattphillips](https://github.com/mattphillips)) | ||
* [#3303](https://github.com/facebookincubator/create-react-app/pull/3303) Update link to Jest Expect docs. ([@jbranchaud](https://github.com/jbranchaud)) | ||
* [#3289](https://github.com/facebookincubator/create-react-app/pull/3289) Fix dead link to Jest "expect" docs. ([@alexkrolick](https://github.com/alexkrolick)) | ||
* [#3265](https://github.com/facebookincubator/create-react-app/pull/3265) Add external links to deployment services. ([@aericson](https://github.com/aericson)) | ||
* [#3075](https://github.com/facebookincubator/create-react-app/pull/3075) Minor docs change to highlight dev proxy behaviour. ([@davidjb](https://github.com/davidjb)) | ||
* [#3185](https://github.com/facebookincubator/create-react-app/pull/3185) Correct manual proxy documentation. ([@robertpanzer](https://github.com/robertpanzer)) | ||
|
||
* README | ||
|
||
* [#3227](https://github.com/facebookincubator/create-react-app/pull/3227) Fix package management link in README for issue #3218. ([@nishina555](https://github.com/nishina555)) | ||
* [#3211](https://github.com/facebookincubator/create-react-app/pull/3211) Improve grammar in README. ([@Mohamed3on](https://github.com/Mohamed3on)) | ||
|
||
#### :house: Internal | ||
|
||
* Other | ||
|
||
* [#3345](https://github.com/facebookincubator/create-react-app/pull/3345) Stop using `npm link` in tests. ([@Timer](https://github.com/Timer)) | ||
|
||
* `react-error-overlay` | ||
|
||
* [#3122](https://github.com/facebookincubator/create-react-app/pull/3122) Fix for add .gitattributes file #3080. ([@ijajmulani](https://github.com/ijajmulani)) | ||
* [#3267](https://github.com/facebookincubator/create-react-app/pull/3267) Use production React version for bundled overlay. ([@Timer](https://github.com/Timer)) | ||
* [#3264](https://github.com/facebookincubator/create-react-app/pull/3264) Add warning when using `react-error-overlay` in production. ([@Timer](https://github.com/Timer)) | ||
* [#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)) | ||
* [#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)) | ||
|
||
* `react-scripts` | ||
|
||
* [#3150](https://github.com/facebookincubator/create-react-app/pull/3150) Remove an useless negation in `registerServiceWorker.js`. ([@dunglas](https://github.com/dunglas)) | ||
* [#3158](https://github.com/facebookincubator/create-react-app/pull/3158) Remove `output.path` from dev webpack config. ([@nikolas](https://github.com/nikolas)) | ||
* [#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)) | ||
* [#3146](https://github.com/facebookincubator/create-react-app/pull/3146) Fix `reason-react` support. ([@lpalmes](https://github.com/lpalmes)) | ||
* [#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)) | ||
* [#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)) | ||
* [#2914](https://github.com/facebookincubator/create-react-app/pull/2914) `<!doctype html>` -> `<!DOCTYPE html>`. ([@Hurtak](https://github.com/Hurtak)) | ||
|
||
#### Committers: 24 | ||
|
||
- Aaron Shafovaloff ([aaronshaf](https://github.com/aaronshaf)) | ||
- Alex ([alexkrolick](https://github.com/alexkrolick)) | ||
- André Ericson ([aericson](https://github.com/aericson)) | ||
- Dan Abramov ([gaearon](https://github.com/gaearon)) | ||
- David Beitey ([davidjb](https://github.com/davidjb)) | ||
- Hrvoje Šimić ([shime](https://github.com/shime)) | ||
- IJAJ MULANI ([ijajmulani](https://github.com/ijajmulani)) | ||
- Joe Haddad ([Timer](https://github.com/Timer)) | ||
- Joe Lim ([xjlim](https://github.com/xjlim)) | ||
- Jonny Buchanan ([insin](https://github.com/insin)) | ||
- Josh Branchaud ([jbranchaud](https://github.com/jbranchaud)) | ||
- Joshua Wiens ([d3viant0ne](https://github.com/d3viant0ne)) | ||
- Kévin Dunglas ([dunglas](https://github.com/dunglas)) | ||
- Lorenzo Palmes ([lpalmes](https://github.com/lpalmes)) | ||
- Matt Phillips ([mattphillips](https://github.com/mattphillips)) | ||
- Mohamed Oun ([Mohamed3on](https://github.com/Mohamed3on)) | ||
- Nik Nyby ([nikolas](https://github.com/nikolas)) | ||
- Petr Huřťák ([Hurtak](https://github.com/Hurtak)) | ||
- Robert Panzer ([robertpanzer](https://github.com/robertpanzer)) | ||
- Ryan Sullivan ([ryansully](https://github.com/ryansully)) | ||
- Satya van Heummen ([satyavh](https://github.com/satyavh)) | ||
- Tharaka Wijebandara ([tharakawj](https://github.com/tharakawj)) | ||
- Toshiharu Nishina ([nishina555](https://github.com/nishina555)) | ||
- [captDaylight](https://github.com/captDaylight) | ||
|
||
### Migrating from 1.0.14 to 1.0.15 | ||
|
||
Inside any created project that has not been ejected, run: | ||
|
||
``` | ||
npm install --save --save-exact [email protected] | ||
``` | ||
|
||
or | ||
|
||
``` | ||
yarn add --exact [email protected] | ||
``` | ||
|
||
## 1.0.14 (September 26, 2017) | ||
|
||
#### :bug: Bug Fix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ http://help.appveyor.com/discussions/questions/1310-delete-cache | |
|
||
---- | ||
Just testing if this works. | ||
lalala. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,8 +158,13 @@ function createApp(name, verbose, version, template) { | |
path.join(root, 'package.json'), | ||
JSON.stringify(packageJson, null, 2) | ||
); | ||
|
||
const useYarn = shouldUseYarn(); | ||
const originalDirectory = process.cwd(); | ||
process.chdir(root); | ||
if (!useYarn && !checkThatNpmCanReadCwd()) { | ||
process.exit(1); | ||
} | ||
|
||
if (!semver.satisfies(process.version, '>=6.0.0')) { | ||
console.log( | ||
|
@@ -172,7 +177,6 @@ function createApp(name, verbose, version, template) { | |
version = '[email protected]'; | ||
} | ||
|
||
const useYarn = shouldUseYarn(); | ||
if (!useYarn) { | ||
const npmInfo = checkNpmVersion(); | ||
if (!npmInfo.hasMinNpm) { | ||
|
@@ -200,7 +204,7 @@ function shouldUseYarn() { | |
} | ||
} | ||
|
||
function install(useYarn, dependencies, verbose, isOnline) { | ||
function install(root, useYarn, dependencies, verbose, isOnline) { | ||
return new Promise((resolve, reject) => { | ||
let command; | ||
let args; | ||
|
@@ -212,6 +216,14 @@ function install(useYarn, dependencies, verbose, isOnline) { | |
} | ||
[].push.apply(args, dependencies); | ||
|
||
// Explicitly set cwd() to work around issues like | ||
// https://github.com/facebookincubator/create-react-app/issues/3326. | ||
// Unfortunately we can only do this for Yarn because npm support for | ||
// equivalent --prefix flag doesn't help with this issue. | ||
// This is why for npm, we run checkThatNpmCanReadCwd() early instead. | ||
args.push('--cwd'); | ||
args.push(root); | ||
|
||
if (!isOnline) { | ||
console.log(chalk.yellow('You appear to be offline.')); | ||
console.log(chalk.yellow('Falling back to the local Yarn cache.')); | ||
|
@@ -275,7 +287,7 @@ function run( | |
); | ||
console.log(); | ||
|
||
return install(useYarn, allDependencies, verbose, isOnline).then( | ||
return install(root, useYarn, allDependencies, verbose, isOnline).then( | ||
() => packageName | ||
); | ||
}) | ||
|
@@ -606,6 +618,67 @@ function isSafeToCreateProjectIn(root, name) { | |
return false; | ||
} | ||
|
||
function checkThatNpmCanReadCwd() { | ||
const cwd = process.cwd(); | ||
let childOutput = null; | ||
try { | ||
// Note: intentionally using spawn over exec since | ||
// the problem doesn't reproduce otherwise. | ||
// `npm config list` is the only reliable way I could find | ||
// to reproduce the wrong path. Just printing process.cwd() | ||
// in a Node process was not enough. | ||
childOutput = spawn.sync('npm', ['config', 'list']).output.join(''); | ||
} catch (err) { | ||
// Something went wrong spawning node. | ||
// Not great, but it means we can't do this check. | ||
// We might fail later on, but let's continue. | ||
return true; | ||
} | ||
if (typeof childOutput !== 'string') { | ||
return true; | ||
} | ||
const lines = childOutput.split('\n'); | ||
// `npm config list` output includes the following line: | ||
// "; cwd = C:\path\to\current\dir" (unquoted) | ||
// I couldn't find an easier way to get it. | ||
const prefix = '; cwd = '; | ||
const line = lines.find(line => line.indexOf(prefix) === 0); | ||
if (typeof line !== 'string') { | ||
// Fail gracefully. They could remove it. | ||
return true; | ||
} | ||
const npmCWD = line.substring(prefix.length); | ||
if (npmCWD === cwd) { | ||
return true; | ||
} | ||
console.error( | ||
chalk.red( | ||
`Could not start an npm process in the right directory.\n\n` + | ||
`The current directory is: ${chalk.bold(cwd)}\n` + | ||
`However, a newly started npm process runs in: ${chalk.bold( | ||
npmCWD | ||
)}\n\n` + | ||
`This is probably caused by a misconfigured system terminal shell.` | ||
) | ||
); | ||
if (process.platform === 'win32') { | ||
console.error( | ||
chalk.red(`On Windows, this can usually be fixed by running:\n\n`) + | ||
` ${chalk.cyan( | ||
'reg' | ||
)} delete "HKCU\\Software\\Microsoft\\Command Processor" /v AutoRun /f\n` + | ||
` ${chalk.cyan( | ||
'reg' | ||
)} delete "HKLM\\Software\\Microsoft\\Command Processor" /v AutoRun /f\n\n` + | ||
chalk.red(`Try to run the above two lines in the terminal.\n`) + | ||
chalk.red( | ||
`To learn more about this problem, read: https://blogs.msdn.microsoft.com/oldnewthing/20071121-00/?p=24433/` | ||
) | ||
); | ||
} | ||
return false; | ||
} | ||
|
||
function checkIfOnline(useYarn) { | ||
if (!useYarn) { | ||
// Don't ping the Yarn registry. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "create-react-app", | ||
"version": "1.4.1", | ||
"version": "1.4.3", | ||
"keywords": [ | ||
"react" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.js text eol=lf |
Oops, something went wrong.