Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"packages/*"
],
"scripts": {
"build": "cd packages/react-scripts && node bin/react-scripts.js build",
"build": "cd packages/react-error-overlay/ && yarn build:prod",
"changelog": "lerna-changelog",
"create-react-app": "node tasks/cra.js",
"e2e": "tasks/e2e-simple.sh",
Expand All @@ -24,13 +24,13 @@
"@testing-library/react": "^9.3.0",
"@testing-library/user-event": "^7.1.2",
"alex": "^8.0.0",
"eslint": "^6.1.0",
"eslint": "^7.11.0",
"execa": "1.0.0",
"fs-extra": "^7.0.1",
"get-port": "^4.2.0",
"globby": "^9.1.0",
"husky": "^1.3.1",
"jest": "24.9.0",
"jest": "26.6.0",
"lerna": "3.19.0",
"lerna-changelog": "~0.8.2",
"lint-staged": "^8.0.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/react-error-overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@
"@babel/core": "7.9.0",
"anser": "1.4.9",
"babel-eslint": "10.1.0",
"babel-jest": "^24.9.0",
"babel-jest": "^26.6.0",
"babel-loader": "8.1.0",
"babel-preset-react-app": "^9.1.2",
"chalk": "2.4.2",
"chokidar": "^3.3.0",
"cross-env": "6.0.3",
"eslint": "^6.1.0",
"eslint": "^7.11.0",
"eslint-config-react-app": "^5.2.1",
"eslint-plugin-flowtype": "4.5.2",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.19.0",
"flow-bin": "^0.116.0",
"html-entities": "1.2.1",
"jest": "24.9.0",
"jest": "26.6.0",
"jest-fetch-mock": "2.1.2",
"object-assign": "4.1.1",
"promise": "8.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/bin/react-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];

if (['build', 'eject', 'start', 'test'].includes(script)) {
const result = spawn.sync(
'node',
process.execPath,
nodeArgs
.concat(require.resolve('../scripts/' + script))
.concat(args.slice(scriptIndex + 1)),
Expand Down
7 changes: 6 additions & 1 deletion packages/react-scripts/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ if (!NODE_ENV) {
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
`${paths.dotenv}.${NODE_ENV}`,
paths.dotenv,
].filter(Boolean);

Expand Down Expand Up @@ -93,6 +93,11 @@ function getClientEnvironment(publicUrl) {
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
// Whether or not react-refresh is enabled.
// react-refresh is not 100% stable at this time,
// which is why it's disabled by default.
// It is defined here so it is available in the webpackHotDevClient.
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
}
);
// Stringify all values so we can feed into webpack DefinePlugin
Expand Down
25 changes: 23 additions & 2 deletions packages/react-scripts/config/jest/babelTransform.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
// @remove-file-on-eject
// @remove-on-eject-begin
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';

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

const hasJsxRuntime = (() => {
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
return false;
}

try {
require.resolve('react/jsx-runtime');
return true;
} catch (e) {
return false;
}
})();

module.exports = babelJest.createTransformer({
presets: [require.resolve('babel-preset-react-app')],
presets: [
[
require.resolve('babel-preset-react-app'),
{
runtime: hasJsxRuntime ? 'automatic' : 'classic',
},
],
],
babelrc: false,
configFile: false,
});
11 changes: 2 additions & 9 deletions packages/react-scripts/config/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,8 @@ const resolve = require('resolve');
function getAdditionalModulePaths(options = {}) {
const baseUrl = options.baseUrl;

// We need to explicitly check for null and undefined (and not a falsy value) because
// TypeScript treats an empty string as `.`.
if (baseUrl == null) {
// If there's no baseUrl set we respect NODE_PATH
// Note that NODE_PATH is deprecated and will be removed
// in the next major release of create-react-app.

const nodePath = process.env.NODE_PATH || '';
return nodePath.split(path.delimiter).filter(Boolean);
if (!baseUrl) {
return '';
}

const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
Expand Down
11 changes: 8 additions & 3 deletions packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const publicUrlOrPath = getPublicUrlOrPath(
process.env.PUBLIC_URL
);

const buildPath = process.env.BUILD_PATH || 'build';

const moduleFileExtensions = [
'web.mjs',
'mjs',
Expand Down Expand Up @@ -60,7 +62,7 @@ const resolveModule = (resolveFn, filePath) => {
module.exports = {
dotenv: resolveApp('.env'),
appPath: resolveApp('.'),
appBuild: resolveApp('build'),
appBuild: resolveApp(buildPath),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
entryHtml: resolveApp(`public/${process.env.SECOND_ENTRY}.html`),
Expand All @@ -74,6 +76,7 @@ module.exports = {
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
swSrc: resolveModule(resolveApp, 'src/service-worker'),
publicUrlOrPath,
};

Expand All @@ -84,7 +87,7 @@ const resolveOwn = relativePath => path.resolve(__dirname, '..', relativePath);
module.exports = {
dotenv: resolveApp('.env'),
appPath: resolveApp('.'),
appBuild: resolveApp('build'),
appBuild: resolveApp(buildPath),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
entryHtml: resolveApp(`public/${process.env.SECOND_ENTRY}.html`),
Expand All @@ -98,6 +101,7 @@ module.exports = {
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
swSrc: resolveModule(resolveApp, 'src/service-worker'),
publicUrlOrPath,
// These properties only exist before ejecting:
ownPath: resolveOwn('.'),
Expand All @@ -121,7 +125,7 @@ if (
module.exports = {
dotenv: resolveOwn(`${templatePath}/.env`),
appPath: resolveApp('.'),
appBuild: resolveOwn('../../build'),
appBuild: resolveOwn(path.join('../..', buildPath)),
appPublic: resolveOwn(`${templatePath}/public`),
appHtml: resolveOwn(`${templatePath}/public/index.html`),
appIndexJs: resolveModule(resolveOwn, `${templatePath}/src/index`),
Expand All @@ -133,6 +137,7 @@ if (
testsSetup: resolveModule(resolveOwn, `${templatePath}/src/setupTests`),
proxySetup: resolveOwn(`${templatePath}/src/setupProxy.js`),
appNodeModules: resolveOwn('node_modules'),
swSrc: resolveModule(resolveOwn, `${templatePath}/src/service-worker`),
publicUrlOrPath,
// These properties only exist before ejecting:
ownPath: resolveOwn('.'),
Expand Down
Loading