Skip to content
This repository was archived by the owner on Nov 29, 2017. It is now read-only.

Commit 0a4a4a1

Browse files
committed
Pull new version: 0.9.5
1 parent 6ea1a9d commit 0a4a4a1

File tree

79 files changed

+1021
-231
lines changed

Some content is hidden

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

79 files changed

+1021
-231
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# react-scripts
22

3+
<<<<<<< Updated upstream
4+
This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
5+
=======
36
This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).
7+
>>>>>>> Stashed changes
48
Please refer to its documentation:
59

610
* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.

.babelrc renamed to babelrc

File renamed without changes.

bin/react-scripts.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
#!/usr/bin/env node
2+
/**
3+
* Copyright (c) 2015-present, Facebook, Inc.
4+
* All rights reserved.
5+
*
6+
* This source code is licensed under the BSD-style license found in the
7+
* LICENSE file in the root directory of this source tree. An additional grant
8+
* of patent rights can be found in the PATENTS file in the same directory.
9+
*/
10+
11+
'use strict';
12+
213
var spawn = require('cross-spawn');
314
var script = process.argv[2];
415
var args = process.argv.slice(3);
@@ -14,13 +25,13 @@ case 'test':
1425
{stdio: 'inherit'}
1526
);
1627
if (result.signal) {
17-
if (result.signal == 'SIGKILL') {
28+
if (result.signal === 'SIGKILL') {
1829
console.log(
1930
'The build failed because the process exited too early. ' +
2031
'This probably means the system ran out of memory or someone called ' +
2132
'`kill -9` on the process.'
2233
);
23-
} else if (result.signal == 'SIGTERM') {
34+
} else if (result.signal === 'SIGTERM') {
2435
console.log(
2536
'The build failed because the process exited too early. ' +
2637
'Someone might have called `kill` or `killall`, or the system could ' +
@@ -34,5 +45,6 @@ case 'test':
3445
default:
3546
console.log('Unknown script "' + script + '".');
3647
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');
3749
break;
3850
}

config/env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* of patent rights can be found in the PATENTS file in the same directory.
99
*/
1010
// @remove-on-eject-end
11+
'use strict';
1112

1213
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
1314
// injected into the application via DefinePlugin in Webpack configuration.

config/jest/babelTransform.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* of patent rights can be found in the PATENTS file in the same directory.
77
*/
88

9+
'use strict';
10+
911
const babelJest = require('babel-jest');
1012

1113
module.exports = babelJest.createTransformer({

config/jest/cssTransform.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*/
99
// @remove-on-eject-end
10+
'use strict';
1011

1112
// This is a custom Jest transformer turning style imports into empty objects.
1213
// http://facebook.github.io/jest/docs/tutorial-webpack.html
@@ -15,7 +16,7 @@ module.exports = {
1516
process() {
1617
return 'module.exports = {};';
1718
},
18-
getCacheKey(fileData, filename) {
19+
getCacheKey() {
1920
// The output is always the same.
2021
return 'cssTransform';
2122
},

config/jest/fileTransform.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*/
99
// @remove-on-eject-end
10+
'use strict';
1011

1112
const path = require('path');
1213

config/paths.js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* of patent rights can be found in the PATENTS file in the same directory.
99
*/
1010
// @remove-on-eject-end
11+
'use strict';
1112

1213
var path = require('path');
1314
var fs = require('fs');
@@ -83,19 +84,19 @@ module.exports = {
8384
yarnLockFile: resolveApp('yarn.lock'),
8485
testsSetup: resolveApp('src/setupTests.js'),
8586
appNodeModules: resolveApp('node_modules'),
86-
ownNodeModules: resolveApp('node_modules'),
8787
nodePaths: nodePaths,
8888
publicUrl: getPublicUrl(resolveApp('package.json')),
8989
servedPath: getServedPath(resolveApp('package.json'))
9090
};
9191

9292
// @remove-on-eject-begin
9393
function resolveOwn(relativePath) {
94-
return path.resolve(__dirname, relativePath);
94+
return path.resolve(__dirname, '..', relativePath);
9595
}
9696

9797
// config before eject: we're in ./node_modules/react-scripts/config/
9898
module.exports = {
99+
appPath: resolveApp('.'),
99100
appBuild: resolveApp('build'),
100101
appPublic: resolveApp('public'),
101102
appHtml: resolveApp('public/index.html'),
@@ -105,29 +106,37 @@ module.exports = {
105106
yarnLockFile: resolveApp('yarn.lock'),
106107
testsSetup: resolveApp('src/setupTests.js'),
107108
appNodeModules: resolveApp('node_modules'),
108-
// this is empty with npm3 but node resolution searches higher anyway:
109-
ownNodeModules: resolveOwn('../node_modules'),
110109
nodePaths: nodePaths,
111110
publicUrl: getPublicUrl(resolveApp('package.json')),
112-
servedPath: getServedPath(resolveApp('package.json'))
111+
servedPath: getServedPath(resolveApp('package.json')),
112+
// These properties only exist before ejecting:
113+
ownPath: resolveOwn('.'),
114+
ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
113115
};
114116

117+
var ownPackageJson = require('../package.json');
118+
var reactScriptsPath = resolveApp(`node_modules/${ownPackageJson.name}`);
119+
var reactScriptsLinked = fs.existsSync(reactScriptsPath) && fs.lstatSync(reactScriptsPath).isSymbolicLink();
120+
115121
// config before publish: we're in ./packages/react-scripts/config/
116-
if (__dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1) {
122+
if (!reactScriptsLinked && __dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1) {
117123
module.exports = {
118-
appBuild: resolveOwn('../../../build'),
119-
appPublic: resolveOwn('../template/public'),
120-
appHtml: resolveOwn('../template/public/index.html'),
121-
appIndexJs: resolveOwn('../template/src/index.js'),
122-
appPackageJson: resolveOwn('../package.json'),
123-
appSrc: resolveOwn('../template/src'),
124-
yarnLockFile: resolveOwn('../template/yarn.lock'),
125-
testsSetup: resolveOwn('../template/src/setupTests.js'),
126-
appNodeModules: resolveOwn('../node_modules'),
127-
ownNodeModules: resolveOwn('../node_modules'),
124+
appPath: resolveApp('.'),
125+
appBuild: resolveOwn('../../build'),
126+
appPublic: resolveOwn('template/public'),
127+
appHtml: resolveOwn('template/public/index.html'),
128+
appIndexJs: resolveOwn('template/src/index.js'),
129+
appPackageJson: resolveOwn('package.json'),
130+
appSrc: resolveOwn('template/src'),
131+
yarnLockFile: resolveOwn('template/yarn.lock'),
132+
testsSetup: resolveOwn('template/src/setupTests.js'),
133+
appNodeModules: resolveOwn('node_modules'),
128134
nodePaths: nodePaths,
129-
publicUrl: getPublicUrl(resolveOwn('../package.json')),
130-
servedPath: getServedPath(resolveOwn('../package.json'))
135+
publicUrl: getPublicUrl(resolveOwn('package.json')),
136+
servedPath: getServedPath(resolveOwn('package.json')),
137+
// These properties only exist before ejecting:
138+
ownPath: resolveOwn('.'),
139+
ownNodeModules: resolveOwn('node_modules'),
131140
};
132141
}
133142
// @remove-on-eject-end

config/polyfills.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* of patent rights can be found in the PATENTS file in the same directory.
99
*/
1010
// @remove-on-eject-end
11+
'use strict';
1112

1213
if (typeof Promise === 'undefined') {
1314
// Rejection tracking prevents a common issue where React gets into an

config/webpack.config.dev.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* of patent rights can be found in the PATENTS file in the same directory.
99
*/
1010
// @remove-on-eject-end
11+
'use strict';
1112

1213
var autoprefixer = require('autoprefixer');
1314
var webpack = require('webpack');
@@ -123,7 +124,13 @@ module.exports = {
123124
{
124125
exclude: [
125126
/\.html$/,
126-
/\.(js|jsx)$/,
127+
// We have to write /\.(js|jsx)(\?.*)?$/ rather than just /\.(js|jsx)$/
128+
// because you might change the hot reloading server from the custom one
129+
// to Webpack's built-in webpack-dev-server/client?/, which would not
130+
// get properly excluded by /\.(js|jsx)$/ because of the query string.
131+
// Webpack 2 fixes this, but for now we include this hack.
132+
// https://github.com/facebookincubator/create-react-app/issues/1713
133+
/\.(js|jsx)(\?.*)?$/,
127134
/\.css$/,
128135
/\.json$/,
129136
/\.svg$/
@@ -180,8 +187,8 @@ module.exports = {
180187
// @remove-on-eject-begin
181188
// Point ESLint to our predefined config.
182189
eslint: {
183-
configFile: path.join(__dirname, '../.eslintrc'),
184-
useEslintrc: false
190+
configFile: path.join(__dirname, '../eslintrc'),
191+
useEslintrc: false,
185192
},
186193
// @remove-on-eject-end
187194
// We use PostCSS for autoprefixing only.

config/webpack.config.prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
* of patent rights can be found in the PATENTS file in the same directory.
99
*/
1010
// @remove-on-eject-end
11+
'use strict';
1112

1213
var autoprefixer = require('autoprefixer');
1314
var webpack = require('webpack');
1415
var HtmlWebpackPlugin = require('html-webpack-plugin');
1516
var ExtractTextPlugin = require('extract-text-webpack-plugin');
1617
var ManifestPlugin = require('webpack-manifest-plugin');
1718
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
18-
var url = require('url');
1919
var paths = require('./paths');
2020
var getClientEnvironment = require('./env');
2121

@@ -195,7 +195,7 @@ module.exports = {
195195
eslint: {
196196
// TODO: consider separate config for production,
197197
// e.g. to enable no-console and no-debugger only in production.
198-
configFile: path.join(__dirname, '../.eslintrc'),
198+
configFile: path.join(__dirname, '../eslintrc'),
199199
useEslintrc: false
200200
},
201201
// @remove-on-eject-end

.eslintrc renamed to eslintrc

File renamed without changes.

fixtures/kitchensink/integration/env.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import { expect } from 'chai'
211
import initDOM from './initDOM'
312

fixtures/kitchensink/integration/initDOM.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
const fs = require('fs')
211
const http = require('http')
312
const jsdom = require('jsdom')
@@ -15,7 +24,7 @@ if (process.env.E2E_FILE) {
1524
const markup = fs.readFileSync(file, 'utf8')
1625
getMarkup = () => markup
1726

18-
const pathPrefix = process.env.PUBLIC_URL.replace(/^https?:\/\/[^\/]+\/?/, '')
27+
const pathPrefix = process.env.PUBLIC_URL.replace(/^https?:\/\/[^/]+\/?/, '')
1928

2029
resourceLoader = (resource, callback) => callback(
2130
null,

fixtures/kitchensink/integration/syntax.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import { expect } from 'chai'
211
import initDOM from './initDOM'
312

fixtures/kitchensink/integration/webpack.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import { expect } from 'chai'
211
import initDOM from './initDOM'
312

fixtures/kitchensink/src/App.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import React, { Component, PropTypes, createElement } from 'react';
211

312
class BuiltEmitter extends Component {

fixtures/kitchensink/src/absoluteLoad.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
export default () => [
211
{ id: 1, name: '1' },
312
{ id: 2, name: '2' },

fixtures/kitchensink/src/features/env/FileEnvVariables.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import React from 'react'
211

312
export default () => (

fixtures/kitchensink/src/features/env/FileEnvVariables.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import React from 'react';
211
import ReactDOM from 'react-dom';
312
import FileEnvVariables from './FileEnvVariables';

fixtures/kitchensink/src/features/env/NodePath.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import React, { Component, PropTypes } from 'react'
211
import load from 'absoluteLoad'
312

fixtures/kitchensink/src/features/env/NodePath.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import React from 'react';
211
import ReactDOM from 'react-dom';
312
import NodePath from './NodePath';

fixtures/kitchensink/src/features/env/PublicUrl.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
110
import React from 'react'
211

312
export default () => (

0 commit comments

Comments
 (0)