Skip to content

Commit

Permalink
Merge branch 'master' into serve-app-under
Browse files Browse the repository at this point in the history
* 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
kellyrmilligan committed Oct 31, 2017
2 parents 57dce7d + dc95d18 commit 1515ab4
Show file tree
Hide file tree
Showing 22 changed files with 465 additions and 102 deletions.
147 changes: 147 additions & 0 deletions CHANGELOG.md
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
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ More detailed information are in the dedicated [README](/packages/react-scripts/
* 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.
* 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.
6. Make sure to include “Migrating from ...” instructions for the previous release. Often you can copy and paste them.
7. After merging the changelog update, create a GitHub Release with the same text. See previous Releases for inspiration.
8. **Do not run `npm publish`. Instead, run `npm run publish`.**
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.
7. **Do not run `npm publish`. Instead, run `npm run publish`.**
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.
9. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.

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

Expand Down
1 change: 1 addition & 0 deletions appveyor.cleanup-cache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ http://help.appveyor.com/discussions/questions/1310-delete-cache

----
Just testing if this works.
lalala.
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ image: Visual Studio 2017

environment:
matrix:
- nodejs_version: 7
- nodejs_version: 8
test_suite: "simple"
- nodejs_version: 7
- nodejs_version: 8
test_suite: "installs"
- nodejs_version: 7
- nodejs_version: 8
test_suite: "kitchensink"
- nodejs_version: 6
test_suite: "simple"
Expand Down
10 changes: 5 additions & 5 deletions packages/babel-preset-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-react-app",
"version": "3.0.3",
"version": "3.1.0",
"description": "Babel preset used by Create React App",
"repository": "facebookincubator/create-react-app",
"license": "MIT",
Expand All @@ -11,17 +11,17 @@
"index.js"
],
"dependencies": {
"babel-plugin-dynamic-import-node": "1.0.2",
"babel-plugin-dynamic-import-node": "1.1.0",
"babel-plugin-syntax-dynamic-import": "6.18.0",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-object-rest-spread": "6.23.0",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"babel-plugin-transform-react-constant-elements": "6.23.0",
"babel-plugin-transform-react-jsx": "6.24.1",
"babel-plugin-transform-react-jsx-self": "6.22.0",
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-plugin-transform-regenerator": "6.24.1",
"babel-plugin-transform-regenerator": "6.26.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-env": "1.5.2",
"babel-preset-env": "1.6.1",
"babel-preset-react": "6.24.1"
},
"peerDependencies": {
Expand Down
79 changes: 76 additions & 3 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -172,7 +177,6 @@ function createApp(name, verbose, version, template) {
version = '[email protected]';
}

const useYarn = shouldUseYarn();
if (!useYarn) {
const npmInfo = checkNpmVersion();
if (!npmInfo.hasMinNpm) {
Expand Down Expand Up @@ -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;
Expand All @@ -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.'));
Expand Down Expand Up @@ -275,7 +287,7 @@ function run(
);
console.log();

return install(useYarn, allDependencies, verbose, isOnline).then(
return install(root, useYarn, allDependencies, verbose, isOnline).then(
() => packageName
);
})
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-app/package.json
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"
],
Expand Down
12 changes: 6 additions & 6 deletions packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-dev-utils",
"version": "4.1.0",
"version": "4.2.1",
"description": "Webpack utilities used by Create React App",
"repository": "facebookincubator/create-react-app",
"license": "MIT",
Expand Down Expand Up @@ -35,19 +35,19 @@
"webpackHotDevClient.js"
],
"dependencies": {
"address": "1.0.2",
"babel-code-frame": "6.22.0",
"address": "1.0.3",
"babel-code-frame": "6.26.0",
"chalk": "1.1.3",
"cross-spawn": "5.1.0",
"detect-port-alt": "1.1.3",
"escape-string-regexp": "1.0.5",
"filesize": "3.5.10",
"filesize": "3.5.11",
"global-modules": "1.0.0",
"gzip-size": "3.0.0",
"inquirer": "3.2.1",
"inquirer": "3.3.0",
"is-root": "1.0.0",
"opn": "5.1.0",
"react-error-overlay": "^2.0.2",
"react-error-overlay": "^3.0.0",
"recursive-readdir": "2.2.1",
"shell-quote": "1.6.1",
"sockjs-client": "1.1.4",
Expand Down
3 changes: 2 additions & 1 deletion packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ var ErrorOverlay = require('react-error-overlay');
ErrorOverlay.setEditorHandler(function editorHandler(errorLocation) {
// Keep this sync with errorOverlayMiddleware.js
fetch(
`${launchEditorEndpoint}?fileName=` +
launchEditorEndpoint +
'?fileName=' +
window.encodeURIComponent(errorLocation.fileName) +
'&lineNumber=' +
window.encodeURIComponent(errorLocation.lineNumber || 1)
Expand Down
1 change: 1 addition & 0 deletions packages/react-error-overlay/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.js text eol=lf
Loading

0 comments on commit 1515ab4

Please sign in to comment.