Skip to content

Commit 9083162

Browse files
committed
3.4.1
1 parent fec3eda commit 9083162

File tree

6 files changed

+78
-87
lines changed

6 files changed

+78
-87
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
3333
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
3434
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
3535
// @remove-on-eject-begin
36-
const eslint = require('eslint');
3736
const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');
3837
// @remove-on-eject-end
3938
const postcssNormalize = require('postcss-normalize');
@@ -46,6 +45,8 @@ const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
4645
// makes for a smoother build process.
4746
const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
4847

48+
const isExtendingEslintConfig = process.env.EXTEND_ESLINT === 'true';
49+
4950
const imageInlineSizeLimit = parseInt(
5051
process.env.IMAGE_INLINE_SIZE_LIMIT || '10000'
5152
);
@@ -61,7 +62,7 @@ const sassModuleRegex = /\.module\.(scss|sass)$/;
6162

6263
// This is the production and development configuration.
6364
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
64-
module.exports = function(webpackEnv) {
65+
module.exports = function (webpackEnv) {
6566
const isEnvDevelopment = webpackEnv === 'development';
6667
const isEnvProduction = webpackEnv === 'production';
6768

@@ -189,12 +190,13 @@ module.exports = function(webpackEnv) {
189190
publicPath: paths.publicUrlOrPath,
190191
// Point sourcemap entries to original disk location (format as URL on Windows)
191192
devtoolModuleFilenameTemplate: isEnvProduction
192-
? info =>
193+
? (info) =>
193194
path
194195
.relative(paths.appSrc, info.absoluteResourcePath)
195196
.replace(/\\/g, '/')
196197
: isEnvDevelopment &&
197-
(info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
198+
((info) =>
199+
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
198200
// Prevents conflicts when multiple webpack runtimes (from different apps)
199201
// are used on the same page.
200202
jsonpFunction: `webpackJsonp${appPackageJson.name}`,
@@ -277,7 +279,7 @@ module.exports = function(webpackEnv) {
277279
// https://twitter.com/wSokra/status/969679223278505985
278280
// https://github.com/facebook/create-react-app/issues/5358
279281
runtimeChunk: {
280-
name: entrypoint => `runtime-${entrypoint.name}`,
282+
name: (entrypoint) => `runtime-${entrypoint.name}`,
281283
},
282284
},
283285
resolve: {
@@ -295,8 +297,8 @@ module.exports = function(webpackEnv) {
295297
// `web` extension prefixes have been added for better support
296298
// for React Native Web.
297299
extensions: paths.moduleFileExtensions
298-
.map(ext => `.${ext}`)
299-
.filter(ext => useTypeScript || !ext.includes('ts')),
300+
.map((ext) => `.${ext}`)
301+
.filter((ext) => useTypeScript || !ext.includes('ts')),
300302
alias: {
301303
// Support React Native Web
302304
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
@@ -346,28 +348,13 @@ module.exports = function(webpackEnv) {
346348
eslintPath: require.resolve('eslint'),
347349
resolvePluginsRelativeTo: __dirname,
348350
// @remove-on-eject-begin
349-
ignore: process.env.EXTEND_ESLINT === 'true',
350-
baseConfig: (() => {
351-
// We allow overriding the config only if the env variable is set
352-
if (process.env.EXTEND_ESLINT === 'true') {
353-
const eslintCli = new eslint.CLIEngine();
354-
let eslintConfig;
355-
try {
356-
eslintConfig = eslintCli.getConfigForFile(
357-
paths.appIndexJs
358-
);
359-
} catch (e) {
360-
console.error(e);
361-
process.exit(1);
362-
}
363-
return eslintConfig;
364-
} else {
365-
return {
351+
ignore: isExtendingEslintConfig,
352+
baseConfig: isExtendingEslintConfig
353+
? undefined
354+
: {
366355
extends: [require.resolve('eslint-config-react-app')],
367-
};
368-
}
369-
})(),
370-
useEslintrc: false,
356+
},
357+
useEslintrc: isExtendingEslintConfig,
371358
// @remove-on-eject-end
372359
},
373360
loader: require.resolve('eslint-loader'),
@@ -653,7 +640,7 @@ module.exports = function(webpackEnv) {
653640
return manifest;
654641
}, seed);
655642
const entrypointFiles = entrypoints.main.filter(
656-
fileName => !fileName.endsWith('.map')
643+
(fileName) => !fileName.endsWith('.map')
657644
);
658645

659646
return {

packages/react-scripts/config/webpack.config.wptheme.js

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
3333
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
3434
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
3535
// @remove-on-eject-begin
36-
const eslint = require('eslint');
3736
const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');
3837
// @remove-on-eject-end
3938
const postcssNormalize = require('postcss-normalize');
@@ -58,6 +57,8 @@ const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
5857
// makes for a smoother build process.
5958
const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
6059

60+
const isExtendingEslintConfig = process.env.EXTEND_ESLINT === 'true';
61+
6162
const imageInlineSizeLimit = parseInt(
6263
process.env.IMAGE_INLINE_SIZE_LIMIT || '10000'
6364
);
@@ -354,28 +355,13 @@ module.exports = function (webpackEnv) {
354355
eslintPath: require.resolve('eslint'),
355356
resolvePluginsRelativeTo: __dirname,
356357
// @remove-on-eject-begin
357-
ignore: process.env.EXTEND_ESLINT === 'true',
358-
baseConfig: (() => {
359-
// We allow overriding the config only if the env variable is set
360-
if (process.env.EXTEND_ESLINT === 'true') {
361-
const eslintCli = new eslint.CLIEngine();
362-
let eslintConfig;
363-
try {
364-
eslintConfig = eslintCli.getConfigForFile(
365-
paths.appIndexJs
366-
);
367-
} catch (e) {
368-
console.error(e);
369-
process.exit(1);
370-
}
371-
return eslintConfig;
372-
} else {
373-
return {
358+
ignore: isExtendingEslintConfig,
359+
baseConfig: isExtendingEslintConfig
360+
? undefined
361+
: {
374362
extends: [require.resolve('eslint-config-react-app')],
375-
};
376-
}
377-
})(),
378-
useEslintrc: false,
363+
},
364+
useEslintrc: isExtendingEslintConfig,
379365
// @remove-on-eject-end
380366
},
381367
loader: require.resolve('eslint-loader'),

packages/react-scripts/cra-original-package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scripts",
3-
"version": "3.4.0",
3+
"version": "3.4.1",
44
"description": "Configuration and scripts for Create React App.",
55
"repository": {
66
"type": "git",
@@ -28,27 +28,27 @@
2828
},
2929
"types": "./lib/react-app.d.ts",
3030
"dependencies": {
31-
"@babel/core": "7.8.4",
31+
"@babel/core": "7.9.0",
3232
"@svgr/webpack": "4.3.3",
3333
"@typescript-eslint/eslint-plugin": "^2.10.0",
3434
"@typescript-eslint/parser": "^2.10.0",
35-
"babel-eslint": "10.0.3",
35+
"babel-eslint": "10.1.0",
3636
"babel-jest": "^24.9.0",
37-
"babel-loader": "8.0.6",
37+
"babel-loader": "8.1.0",
3838
"babel-plugin-named-asset-import": "^0.3.6",
39-
"babel-preset-react-app": "^9.1.1",
39+
"babel-preset-react-app": "^9.1.2",
4040
"camelcase": "^5.3.1",
4141
"case-sensitive-paths-webpack-plugin": "2.3.0",
4242
"css-loader": "3.4.2",
4343
"dotenv": "8.2.0",
4444
"dotenv-expand": "5.1.0",
4545
"eslint": "^6.6.0",
46-
"eslint-config-react-app": "^5.2.0",
46+
"eslint-config-react-app": "^5.2.1",
4747
"eslint-loader": "3.0.3",
4848
"eslint-plugin-flowtype": "4.6.0",
49-
"eslint-plugin-import": "2.20.0",
49+
"eslint-plugin-import": "2.20.1",
5050
"eslint-plugin-jsx-a11y": "6.2.3",
51-
"eslint-plugin-react": "7.18.0",
51+
"eslint-plugin-react": "7.19.0",
5252
"eslint-plugin-react-hooks": "^1.6.1",
5353
"file-loader": "4.3.0",
5454
"fs-extra": "^8.1.0",
@@ -60,24 +60,24 @@
6060
"jest-watch-typeahead": "0.4.2",
6161
"mini-css-extract-plugin": "0.9.0",
6262
"optimize-css-assets-webpack-plugin": "5.0.3",
63-
"pnp-webpack-plugin": "1.6.0",
63+
"pnp-webpack-plugin": "1.6.4",
6464
"postcss-flexbugs-fixes": "4.1.0",
6565
"postcss-loader": "3.0.0",
6666
"postcss-normalize": "8.0.1",
6767
"postcss-preset-env": "6.7.0",
6868
"postcss-safe-parser": "4.0.1",
6969
"react-app-polyfill": "^1.0.6",
70-
"react-dev-utils": "^10.2.0",
70+
"react-dev-utils": "^10.2.1",
7171
"resolve": "1.15.0",
7272
"resolve-url-loader": "3.1.1",
7373
"sass-loader": "8.0.2",
7474
"semver": "6.3.0",
7575
"style-loader": "0.23.1",
76-
"terser-webpack-plugin": "2.3.4",
77-
"ts-pnp": "1.1.5",
76+
"terser-webpack-plugin": "2.3.5",
77+
"ts-pnp": "1.1.6",
7878
"url-loader": "2.3.0",
79-
"webpack": "4.41.5",
80-
"webpack-dev-server": "3.10.2",
79+
"webpack": "4.42.0",
80+
"webpack-dev-server": "3.10.3",
8181
"webpack-manifest-plugin": "2.2.0",
8282
"workbox-webpack-plugin": "4.3.1"
8383
},

packages/react-scripts/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devloco/react-scripts-wptheme",
3-
"version": "3.4.0-wp.10",
3+
"version": "3.4.1-wp.1",
44
"description": "Configuration and scripts for Create React WP Theme.",
55
"repository": {
66
"type": "git",
@@ -42,27 +42,27 @@
4242
},
4343
"types": "./lib/react-app.d.ts",
4444
"dependencies": {
45-
"@babel/core": "7.8.4",
45+
"@babel/core": "7.9.0",
4646
"@svgr/webpack": "4.3.3",
4747
"@typescript-eslint/eslint-plugin": "^2.10.0",
4848
"@typescript-eslint/parser": "^2.10.0",
49-
"babel-eslint": "10.0.3",
49+
"babel-eslint": "10.1.0",
5050
"babel-jest": "^24.9.0",
51-
"babel-loader": "8.0.6",
51+
"babel-loader": "8.1.0",
5252
"babel-plugin-named-asset-import": "^0.3.6",
53-
"babel-preset-react-app": "^9.1.1",
53+
"babel-preset-react-app": "^9.1.2",
5454
"camelcase": "^5.3.1",
5555
"case-sensitive-paths-webpack-plugin": "2.3.0",
5656
"css-loader": "3.4.2",
5757
"dotenv": "8.2.0",
5858
"dotenv-expand": "5.1.0",
5959
"eslint": "^6.6.0",
60-
"eslint-config-react-app": "^5.2.0",
60+
"eslint-config-react-app": "^5.2.1",
6161
"eslint-loader": "3.0.3",
6262
"eslint-plugin-flowtype": "4.6.0",
63-
"eslint-plugin-import": "2.20.0",
63+
"eslint-plugin-import": "2.20.1",
6464
"eslint-plugin-jsx-a11y": "6.2.3",
65-
"eslint-plugin-react": "7.18.0",
65+
"eslint-plugin-react": "7.19.0",
6666
"eslint-plugin-react-hooks": "^1.6.1",
6767
"file-loader": "4.3.0",
6868
"fs-extra": "^8.1.0",
@@ -74,24 +74,24 @@
7474
"jest-watch-typeahead": "0.4.2",
7575
"mini-css-extract-plugin": "0.9.0",
7676
"optimize-css-assets-webpack-plugin": "5.0.3",
77-
"pnp-webpack-plugin": "1.6.0",
77+
"pnp-webpack-plugin": "1.6.4",
7878
"postcss-flexbugs-fixes": "4.1.0",
7979
"postcss-loader": "3.0.0",
8080
"postcss-normalize": "8.0.1",
8181
"postcss-preset-env": "6.7.0",
8282
"postcss-safe-parser": "4.0.1",
8383
"react-app-polyfill": "^1.0.6",
84-
"react-dev-utils": "^10.2.0",
84+
"react-dev-utils": "^10.2.1",
8585
"resolve": "1.15.0",
8686
"resolve-url-loader": "3.1.1",
8787
"sass-loader": "8.0.2",
8888
"semver": "6.3.0",
8989
"style-loader": "0.23.1",
90-
"terser-webpack-plugin": "2.3.4",
91-
"ts-pnp": "1.1.5",
90+
"terser-webpack-plugin": "2.3.5",
91+
"ts-pnp": "1.1.6",
9292
"url-loader": "2.3.0",
93-
"webpack": "4.41.5",
94-
"webpack-dev-server": "3.10.2",
93+
"webpack": "4.42.0",
94+
"webpack-dev-server": "3.10.3",
9595
"webpack-manifest-plugin": "2.2.0",
9696
"workbox-webpack-plugin": "4.3.1",
9797
"@devloco/create-react-wptheme-utils": "^3.4.0-wp.12"

packages/react-scripts/scripts/start.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ checkBrowsers(paths.appPath, isInteractive)
164164
process.exit();
165165
});
166166
});
167+
168+
if (isInteractive || process.env.CI !== 'true') {
169+
// Gracefully exit when stdin ends
170+
process.stdin.on('end', function() {
171+
devServer.close();
172+
process.exit();
173+
});
174+
process.stdin.resume();
175+
}
167176
})
168177
.catch(err => {
169178
if (err && err.message) {

packages/react-scripts/scripts/wpstart.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ process.env.NODE_ENV = 'development';
1515
// Makes the script crash on unhandled rejections instead of silently
1616
// ignoring them. In the future, promise rejections that are not handled will
1717
// terminate the Node.js process with a non-zero exit code.
18-
process.on('unhandledRejection', err => {
18+
process.on('unhandledRejection', (err) => {
1919
throw err;
2020
});
2121

@@ -120,7 +120,7 @@ function startWatch() {
120120
// Going into Dev mode, so delete the deploy folder.
121121
deleteDeployFolder(paths);
122122

123-
const injectWpThemeClient = function(wpThemeServer) {
123+
const injectWpThemeClient = function (wpThemeServer) {
124124
if (!wpThemeUserConfig) {
125125
return;
126126
}
@@ -167,7 +167,7 @@ function startWatch() {
167167
};
168168

169169
let doLaunchBrowser = true;
170-
const launchBrowser = function() {
170+
const launchBrowser = function () {
171171
openBrowser(appPackage.browserLaunchTo);
172172
};
173173

@@ -226,12 +226,12 @@ function startWatch() {
226226
};
227227

228228
const devSocket = {
229-
warnings: warnings => {
229+
warnings: (warnings) => {
230230
if (_wpThemeServer) {
231231
_wpThemeServer.update(warnings, 'warnings');
232232
}
233233
},
234-
errors: errors => {
234+
errors: (errors) => {
235235
if (_wpThemeServer) {
236236
_wpThemeServer.update(errors, 'errors');
237237
}
@@ -301,13 +301,22 @@ function startWatch() {
301301
doLaunchBrowser = false;
302302
});
303303

304-
['SIGINT', 'SIGTERM'].forEach(function(sig) {
305-
process.on(sig, function() {
304+
['SIGINT', 'SIGTERM'].forEach(function (sig) {
305+
process.on(sig, function () {
306306
watcher.close();
307307
process.exit();
308308
});
309309
});
310-
}).catch(err => {
310+
311+
if (isInteractive || process.env.CI !== 'true') {
312+
// Gracefully exit when stdin ends
313+
process.stdin.on('end', function () {
314+
devServer.close();
315+
process.exit();
316+
});
317+
process.stdin.resume();
318+
}
319+
}).catch((err) => {
311320
if (err && err.message) {
312321
console.log(err.message);
313322
}

0 commit comments

Comments
 (0)