Skip to content

Commit 6eabcfa

Browse files
Sascha TimmeSascha Timme
authored andcommitted
Use react-scripts-version 0.9.5
1 parent 09d2bc8 commit 6eabcfa

File tree

104 files changed

+1104
-1420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1104
-1420
lines changed

.gitignore

Whitespace-only changes.

README.md

100644100755
File mode changed.

babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-app"]
3+
}

bin/react-scripts.js

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,36 @@ var script = process.argv[2];
1515
var args = process.argv.slice(3);
1616

1717
switch (script) {
18-
case 'build':
19-
case 'eject':
20-
case 'start':
21-
case 'test':
22-
var result = spawn.sync(
23-
'node',
24-
[require.resolve('../scripts/' + script)].concat(args),
25-
{ stdio: 'inherit' }
26-
);
27-
if (result.signal) {
28-
if (result.signal === 'SIGKILL') {
29-
console.log(
30-
'The build failed because the process exited too early. ' +
31-
'This probably means the system ran out of memory or someone called ' +
32-
'`kill -9` on the process.'
33-
);
34-
} else if (result.signal === 'SIGTERM') {
35-
console.log(
36-
'The build failed because the process exited too early. ' +
37-
'Someone might have called `kill` or `killall`, or the system could ' +
38-
'be shutting down.'
39-
);
40-
}
41-
process.exit(1);
18+
case 'build':
19+
case 'eject':
20+
case 'start':
21+
case 'test':
22+
var result = spawn.sync(
23+
'node',
24+
[require.resolve('../scripts/' + script)].concat(args),
25+
{stdio: 'inherit'}
26+
);
27+
if (result.signal) {
28+
if (result.signal === 'SIGKILL') {
29+
console.log(
30+
'The build failed because the process exited too early. ' +
31+
'This probably means the system ran out of memory or someone called ' +
32+
'`kill -9` on the process.'
33+
);
34+
} else if (result.signal === 'SIGTERM') {
35+
console.log(
36+
'The build failed because the process exited too early. ' +
37+
'Someone might have called `kill` or `killall`, or the system could ' +
38+
'be shutting down.'
39+
);
4240
}
43-
process.exit(result.status);
44-
break;
45-
default:
46-
console.log('Unknown script "' + script + '".');
47-
console.log('Perhaps you need to update react-scripts?');
48-
console.log(
49-
'See: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases'
50-
);
51-
break;
41+
process.exit(1);
42+
}
43+
process.exit(result.status);
44+
break;
45+
default:
46+
console.log('Unknown script "' + script + '".');
47+
console.log('Perhaps you need to update react-scripts?');
48+
console.log('See: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases');
49+
break;
5250
}

config/env.js

100644100755
Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,34 @@
1212

1313
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
1414
// injected into the application via DefinePlugin in Webpack configuration.
15-
const REACT_APP = /^REACT_APP_/i;
15+
16+
var REACT_APP = /^REACT_APP_/i;
1617

1718
function getClientEnvironment(publicUrl) {
18-
const raw = Object.keys(process.env)
19+
var raw = Object
20+
.keys(process.env)
1921
.filter(key => REACT_APP.test(key))
20-
.reduce(
21-
(env, key) => {
22-
env[key] = process.env[key];
23-
return env;
24-
},
25-
{
26-
// Useful for determining whether we’re running in production mode.
27-
// Most importantly, it switches React into the correct mode.
28-
NODE_ENV: process.env.NODE_ENV || 'development',
29-
// Useful for resolving the correct path to static assets in `public`.
30-
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
31-
// This should only be used as an escape hatch. Normally you would put
32-
// images into the `src` and `import` them in code to get their paths.
33-
PUBLIC_URL: publicUrl,
34-
}
35-
);
22+
.reduce((env, key) => {
23+
env[key] = process.env[key];
24+
return env;
25+
}, {
26+
// Useful for determining whether we’re running in production mode.
27+
// Most importantly, it switches React into the correct mode.
28+
'NODE_ENV': process.env.NODE_ENV || 'development',
29+
// Useful for resolving the correct path to static assets in `public`.
30+
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
31+
// This should only be used as an escape hatch. Normally you would put
32+
// images into the `src` and `import` them in code to get their paths.
33+
'PUBLIC_URL': publicUrl
34+
});
3635
// Stringify all values so we can feed into Webpack DefinePlugin
37-
const stringified = {
38-
'process.env': Object.keys(raw).reduce(
39-
(env, key) => {
36+
var stringified = {
37+
'process.env': Object
38+
.keys(raw)
39+
.reduce((env, key) => {
4040
env[key] = JSON.stringify(raw[key]);
4141
return env;
42-
},
43-
{}
44-
),
42+
}, {})
4543
};
4644

4745
return { raw, stringified };

config/jest/babelTransform.js

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// @remove-file-on-eject
21
/**
32
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
43
*
54
* This source code is licensed under the BSD-style license found in the
65
* LICENSE file in the root directory of this source tree. An additional grant
76
* of patent rights can be found in the PATENTS file in the same directory.
87
*/
8+
99
'use strict';
1010

1111
const babelJest = require('babel-jest');
1212

1313
module.exports = babelJest.createTransformer({
1414
presets: [require.resolve('babel-preset-react-app')],
15-
babelrc: false,
15+
babelrc: false
1616
});

config/jest/cssTransform.js

100644100755
File mode changed.

config/jest/fileTransform.js

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ const path = require('path');
1616

1717
module.exports = {
1818
process(src, filename) {
19-
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
19+
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';';
2020
},
2121
};

config/paths.js

100644100755
Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
// @remove-on-eject-end
1111
'use strict';
1212

13-
const path = require('path');
14-
const fs = require('fs');
15-
const url = require('url');
13+
var path = require('path');
14+
var fs = require('fs');
15+
var url = require('url');
1616

1717
// Make sure any symlinks in the project folder are resolved:
1818
// https://github.com/facebookincubator/create-react-app/issues/637
19-
const appDirectory = fs.realpathSync(process.cwd());
19+
var appDirectory = fs.realpathSync(process.cwd());
2020
function resolveApp(relativePath) {
2121
return path.resolve(appDirectory, relativePath);
2222
}
@@ -36,20 +36,20 @@ function resolveApp(relativePath) {
3636
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
3737
// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
3838

39-
const nodePaths = (process.env.NODE_PATH || '')
39+
var nodePaths = (process.env.NODE_PATH || '')
4040
.split(process.platform === 'win32' ? ';' : ':')
4141
.filter(Boolean)
4242
.filter(folder => !path.isAbsolute(folder))
4343
.map(resolveApp);
4444

45-
const envPublicUrl = process.env.PUBLIC_URL;
45+
var envPublicUrl = process.env.PUBLIC_URL;
4646

4747
function ensureSlash(path, needsSlash) {
48-
const hasSlash = path.endsWith('/');
48+
var hasSlash = path.endsWith('/');
4949
if (hasSlash && !needsSlash) {
5050
return path.substr(path, path.length - 1);
5151
} else if (!hasSlash && needsSlash) {
52-
return `${path}/`;
52+
return path + '/';
5353
} else {
5454
return path;
5555
}
@@ -66,9 +66,10 @@ function getPublicUrl(appPackageJson) {
6666
// We can't use a relative path in HTML because we don't want to load something
6767
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
6868
function getServedPath(appPackageJson) {
69-
const publicUrl = getPublicUrl(appPackageJson);
70-
const servedUrl = envPublicUrl ||
71-
(publicUrl ? url.parse(publicUrl).pathname : '/');
69+
var publicUrl = getPublicUrl(appPackageJson);
70+
var servedUrl = envPublicUrl || (
71+
publicUrl ? url.parse(publicUrl).pathname : '/'
72+
);
7273
return ensureSlash(servedUrl, true);
7374
}
7475

@@ -85,7 +86,7 @@ module.exports = {
8586
appNodeModules: resolveApp('node_modules'),
8687
nodePaths: nodePaths,
8788
publicUrl: getPublicUrl(resolveApp('package.json')),
88-
servedPath: getServedPath(resolveApp('package.json')),
89+
servedPath: getServedPath(resolveApp('package.json'))
8990
};
9091

9192
// @remove-on-eject-begin
@@ -113,16 +114,12 @@ module.exports = {
113114
ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
114115
};
115116

116-
const ownPackageJson = require('../package.json');
117-
const reactScriptsPath = resolveApp(`node_modules/${ownPackageJson.name}`);
118-
const reactScriptsLinked = fs.existsSync(reactScriptsPath) &&
119-
fs.lstatSync(reactScriptsPath).isSymbolicLink();
117+
var ownPackageJson = require('../package.json');
118+
var reactScriptsPath = resolveApp(`node_modules/${ownPackageJson.name}`);
119+
var reactScriptsLinked = fs.existsSync(reactScriptsPath) && fs.lstatSync(reactScriptsPath).isSymbolicLink();
120120

121121
// config before publish: we're in ./packages/react-scripts/config/
122-
if (
123-
!reactScriptsLinked &&
124-
__dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1
125-
) {
122+
if (!reactScriptsLinked && __dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1) {
126123
module.exports = {
127124
appPath: resolveApp('.'),
128125
appBuild: resolveOwn('../../build'),

config/polyfills.js

100644100755
File mode changed.

0 commit comments

Comments
 (0)