Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 7a79e68

Browse files
committed
Merge commit 'dfbc71ce2ae07547a8544cce14a1a23fac99e071'
2 parents 1a27e6a + dfbc71c commit 7a79e68

File tree

6 files changed

+74
-1214
lines changed

6 files changed

+74
-1214
lines changed

Diff for: CHANGELOG.md

-1,210
Large diffs are not rendered by default.

Diff for: packages/react-dev-utils/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-dev-utils",
3-
"version": "5.0.0",
3+
"version": "5.0.1",
44
"description": "Webpack utilities used by Create React App",
55
"repository": "facebookincubator/create-react-app",
66
"license": "MIT",
@@ -40,7 +40,7 @@
4040
"babel-code-frame": "6.26.0",
4141
"chalk": "1.1.3",
4242
"cross-spawn": "5.1.0",
43-
"detect-port-alt": "1.1.5",
43+
"detect-port-alt": "1.1.6",
4444
"escape-string-regexp": "1.0.5",
4545
"filesize": "3.5.11",
4646
"global-modules": "1.0.0",

Diff for: packages/react-scripts/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"promise": "8.0.1",
4343
"raf": "3.4.0",
4444
"source-map-loader": "^0.2.1",
45-
"react-dev-utils": "^5.0.0",
45+
"react-dev-utils": "^5.0.1",
46+
"resolve": "1.6.0",
4647
"style-loader": "0.19.0",
4748
"sw-precache-webpack-plugin": "0.11.4",
4849
"ts-jest": "22.0.1",

Diff for: packages/react-scripts/scripts/test.js

+55-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ process.on('unhandledRejection', err => {
2424
require('../config/env');
2525

2626
const jest = require('jest');
27-
const argv = process.argv.slice(2);
27+
let argv = process.argv.slice(2);
2828

2929
// Watch unless on CI or in coverage mode
3030
if (!process.env.CI && argv.indexOf('--coverage') < 0) {
@@ -46,5 +46,59 @@ argv.push(
4646
)
4747
)
4848
);
49+
50+
// This is a very dirty workaround for https://github.com/facebook/jest/issues/5913.
51+
// We're trying to resolve the environment ourselves because Jest does it incorrectly.
52+
// TODO: remove this (and the `resolve` dependency) as soon as it's fixed in Jest.
53+
const resolve = require('resolve');
54+
function resolveJestDefaultEnvironment(name) {
55+
const jestDir = path.dirname(
56+
resolve.sync('jest', {
57+
basedir: __dirname,
58+
})
59+
);
60+
const jestCLIDir = path.dirname(
61+
resolve.sync('jest-cli', {
62+
basedir: jestDir,
63+
})
64+
);
65+
const jestConfigDir = path.dirname(
66+
resolve.sync('jest-config', {
67+
basedir: jestCLIDir,
68+
})
69+
);
70+
return resolve.sync(name, {
71+
basedir: jestConfigDir,
72+
});
73+
}
74+
let cleanArgv = [];
75+
let env = 'node';
76+
let next;
77+
do {
78+
next = argv.shift();
79+
if (next === '--env') {
80+
env = argv.shift();
81+
} else if (next.indexOf('--env=') === 0) {
82+
env = next.substring('--env='.length);
83+
} else {
84+
cleanArgv.push(next);
85+
}
86+
} while (argv.length > 0);
87+
argv = cleanArgv;
88+
let resolvedEnv;
89+
try {
90+
resolvedEnv = resolveJestDefaultEnvironment(`jest-environment-${env}`);
91+
} catch (e) {
92+
// ignore
93+
}
94+
if (!resolvedEnv) {
95+
try {
96+
resolvedEnv = resolveJestDefaultEnvironment(env);
97+
} catch (e) {
98+
// ignore
99+
}
100+
}
101+
const testEnvironment = resolvedEnv || env;
102+
argv.push('--env', testEnvironment);
49103
// @remove-on-eject-end
50104
jest.run(argv);

Diff for: packages/react-scripts/scripts/utils/createJestConfig.js

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
5858
'jsx',
5959
'json',
6060
'node',
61+
'mjs',
6162
],
6263
globals: {
6364
'ts-jest': {

Diff for: packages/react-scripts/template/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -2176,7 +2176,21 @@ GitHub Pages doesn’t support routers that use the HTML5 `pushState` history AP
21762176
* You could switch from using HTML5 history API to routing with hashes. If you use React Router, you can switch to `hashHistory` for this effect, but the URL will be longer and more verbose (for example, `http://user.github.io/todomvc/#/todos/42?_k=yknaj`). [Read more](https://reacttraining.com/react-router/web/api/Router) about different history implementations in React Router.
21772177
* Alternatively, you can use a trick to teach GitHub Pages to handle 404 by redirecting to your `index.html` page with a special redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages).
21782178

2179+
<<<<<<< HEAD
21792180
### Heroku
2181+
=======
2182+
#### Troubleshooting
2183+
2184+
##### "/dev/tty: No such a device or address"
2185+
2186+
If, when deploying, you get `/dev/tty: No such a device or address` or a similar error, try the follwing:
2187+
2188+
1. Create a new [Personal Access Token](https://github.com/settings/tokens)
2189+
2. `git remote set-url origin https://<user>:<token>@github.com/<user>/<repo>` .
2190+
3. Try `npm run deploy again`
2191+
2192+
### [Heroku](https://www.heroku.com/)
2193+
>>>>>>> dfbc71ce2ae07547a8544cce14a1a23fac99e071
21802194

21812195
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).<br>
21822196
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).

0 commit comments

Comments
 (0)