Skip to content

ERA-11293 [Part 2: Update ejected dependencies] #1279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
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
11 changes: 11 additions & 0 deletions __mocks__/scss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = new Proxy(
{},
{
get: (target, key) => {
if (key === '__esModule') {
return true;
}
return key;
},
}
);
62 changes: 28 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@
"@rjsf/core": "^5.24.8",
"@rjsf/utils": "^5.24.8",
"@rjsf/validator-ajv6": "^5.24.8",
"@svgr/webpack": "^5.5.0",
"@svgr/webpack": "^8.1.0",
"@turf/turf": "^7.1.0",
"ajv": "^8.17.1",
"ajv-draft-04": "^1.0.0",
"ajv-formats": "^3.0.1",
"axios": "1.8.4",
"axios-progress-bar": "^1.2.0",
"babel-jest": "^27.4.2",
"babel-loader": "^8.2.3",
"babel-jest": "^29.7.0",
"babel-loader": "^10.0.0",
"babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "^10.0.1",
"bfj": "^7.0.2",
"bootstrap": "5.3.3",
"bfj": "^9.1.2",
"bootstrap": "5.3.5",
"browserslist": "^4.18.1",
"buffer": "^6.0.3",
"camelcase": "^6.2.1",
"camelcase": "^6.3.0",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.2.0",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.2",
"date-fns": "^4.1.0",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"eslint": "^8.3.0",
"dotenv": "^16.4.7",
"dotenv-expand": "^12.0.1",
"eslint": "^8.10.0",
"eslint-config-react-app": "^7.0.1",
"eslint-webpack-plugin": "^3.1.1",
"eslint-webpack-plugin": "^5.0.0",
"file-loader": "^6.2.0",
"fs-extra": "^10.0.0",
"fs-extra": "^11.3.0",
"geodesy": "^2.4.0",
"html-webpack-plugin": "^5.5.0",
"humanize-duration": "^3.32.1",
Expand All @@ -61,9 +61,9 @@
"pluralize": "^8.0.0",
"postcss": "^8.4.4",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-loader": "^6.2.1",
"postcss-normalize": "^10.0.1",
"postcss-preset-env": "^7.0.1",
"postcss-loader": "^8.1.1",
"postcss-normalize": "^13.0.1",
"postcss-preset-env": "^10.1.5",
"prompts": "^2.4.2",
"prop-types": "^15.8.1",
"react": "^18.3.1",
Expand All @@ -83,7 +83,7 @@
"react-js-pagination": "^3.0.3",
"react-pin-field": "^3.1.5",
"react-redux": "^9.1.2",
"react-refresh": "^0.11.0",
"react-refresh": "^0.17.0",
"react-router-dom": "^7.0.1",
"react-select": "^5.8.3",
"react-spinners": "^0.15.0",
Expand All @@ -96,21 +96,21 @@
"redux-thunk": "^3.1.0",
"reselect": "^5.1.1",
"resolve": "^1.20.0",
"resolve-url-loader": "^4.0.0",
"sass-loader": "^12.3.0",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^16.0.5",
"semver": "^7.3.5",
"socket.io-client": "^4.8.1",
"source-map-loader": "^3.0.0",
"style-loader": "^3.3.1",
"source-map-loader": "^5.0.0",
"style-loader": "^4.0.0",
"suncalc": "^1.9.0",
"tailwindcss": "^3.0.2",
"tailwindcss": "^4.1.3",
"terser-webpack-plugin": "^5.2.5",
"use-sound": "^5.0.0",
"uuid": "^11.0.3",
"webpack": "^5.64.4",
"webpack-dev-server": "^4.6.0",
"webpack-manifest-plugin": "^4.0.2",
"workbox-webpack-plugin": "^6.4.1"
"webpack": "^5.98.0",
"webpack-dev-server": "^5.2.1",
"webpack-manifest-plugin": "^5.0.1",
"workbox-webpack-plugin": "^7.3.0"
},
"scripts": {
"start": "node react-scripts/start.js",
Expand All @@ -133,7 +133,6 @@
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^13.0.16",
"eslint": "^8.10.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^5.2.0",
Expand Down Expand Up @@ -181,7 +180,8 @@
"modulePaths": [],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
".+\\.module\\.scss": "<rootDir>/__mocks__/scss.js",
"^.+\\.module\\.(css|sass)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"web.js",
Expand Down Expand Up @@ -218,15 +218,9 @@
"last 1 firefox version",
"last 1 safari version"
],
"resolutions": {
"resolve-url-loader": "5.0.0"
},
"babel": {
"presets": [
"react-app"
]
},
"eslintConfig": {
"extends": "react-app"
}
}
10 changes: 5 additions & 5 deletions react-app-config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const dotenvFiles = [
// that have already been set. Variable expansion is supported in .env files.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
dotenvFiles.forEach(dotenvFile => {
dotenvFiles.forEach((dotenvFile) => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv-expand').expand(
require('dotenv').config({
path: dotenvFile,
})
Expand All @@ -52,8 +52,8 @@ dotenvFiles.forEach(dotenvFile => {
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.filter((folder) => folder && !path.isAbsolute(folder))
.map((folder) => path.resolve(appDirectory, folder))
.join(path.delimiter);

// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
Expand All @@ -62,7 +62,7 @@ const REACT_APP = /^REACT_APP_/i;

function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.filter((key) => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,30 @@ function readEnvFile(file, type) {
return fs.readFileSync(file);
}

// Get the https config
// Return cert files if provided in env, otherwise just true or false
function getHttpsConfig() {
// Get the server config
// Return server option if provided in env, otherwise just string
function getServerConfig() {
const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
const isHttps = HTTPS === 'true';
const protocol = HTTPS === 'true' ? 'https' : 'http';

if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
const config = {
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
};
if (protocol === 'https') {
if (SSL_CRT_FILE && SSL_KEY_FILE) {
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
const config = {
type: protocol,
options: {
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
},
};

validateKeyAndCerts({ ...config, keyFile, crtFile });
return config;
validateKeyAndCerts({ ...config.options, keyFile, crtFile });
return config;
}
return protocol;
}
return isHttps;
return protocol;
}

module.exports = getHttpsConfig;
module.exports = getServerConfig;
2 changes: 1 addition & 1 deletion react-app-config/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getAdditionalModulePaths(options = {}) {
// Otherwise, throw an error.
throw new Error(
chalk.red.bold(
"Your project's `baseUrl` can only be set to `src` or `node_modules`." +
'Your project\'s `baseUrl` can only be set to `src` or `node_modules`.' +
' Create React App does not support other values at this time.'
)
);
Expand Down
8 changes: 3 additions & 5 deletions react-app-config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebook/create-react-app/issues/637
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);

// We use `PUBLIC_URL` environment variable or "homepage" field to infer
// We use `PUBLIC_URL` environment variable or 'homepage' field to infer
// "public path" at which the app is served.
// webpack needs to know it to put the right <script> hrefs into HTML even in
// single-page apps that may serve index.html for nested URLs like /todos/42.
Expand Down Expand Up @@ -39,7 +39,7 @@ const moduleFileExtensions = [

// Resolve file paths in the same order as webpack
const resolveModule = (resolveFn, filePath) => {
const extension = moduleFileExtensions.find(extension =>
const extension = moduleFileExtensions.find((extension) =>
fs.existsSync(resolveFn(`${filePath}.${extension}`))
);

Expand Down Expand Up @@ -72,6 +72,4 @@ module.exports = {
publicUrlOrPath,
};



module.exports.moduleFileExtensions = moduleFileExtensions;
Loading