From 2018336dc7bb9c74f1143288befc994ca2fc15b2 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Wed, 9 Apr 2025 14:53:18 -0600 Subject: [PATCH] ERA-11293: Update ejected dependencies --- __mocks__/scss.js | 11 + package.json | 62 +- react-app-config/env.js | 10 +- .../{getHttpsConfig.js => getServerConfig.js} | 36 +- react-app-config/modules.js | 2 +- react-app-config/paths.js | 8 +- react-app-config/webpack.config.js | 101 +- react-app-config/webpackDevServer.config.js | 33 +- src/AddAttachmentButton/index.js | 2 +- .../AddItemModal/AddPatrolTab/index.js | 2 +- .../AddItemModal/AddReportTab/index.js | 2 +- .../AddItemModal/TypesList/index.js | 2 +- src/AddItemButton/AddItemModal/index.js | 2 +- src/AddItemButton/index.js | 2 +- src/AddToIncidentModal/index.js | 7 +- src/AddToPatrolModal/index.js | 7 +- src/AlertsModal/index.js | 2 +- src/AnalyzerConfigPopup/index.js | 2 +- src/AnalyzerLayerList/AnalyzerListItem.js | 2 +- src/AnalyzerLayerList/index.js | 4 +- src/Badge/index.js | 2 +- src/CheckboxList/index.js | 2 +- src/Checkmark/index.js | 2 +- src/ClearAllControl/index.js | 2 +- src/ColumnSort/index.js | 2 +- src/ConfirmationCheck/index.js | 2 +- src/ContextMenu/index.js | 2 +- src/CursorGpsDisplay/MenuPopover/index.js | 2 +- src/CursorGpsDisplay/index.js | 2 +- src/DailyReportModal/index.js | 2 +- .../CalendarPopper/MonthPicker/index.js | 2 +- src/DatePicker/CalendarPopper/index.js | 2 +- src/DatePicker/index.js | 2 +- src/DateRangeSelector/index.js | 4 +- src/DateTime/index.js | 2 +- src/DateTimePicker/index.js | 2 +- .../AttachmentListItem/index.js | 2 +- .../ContainedReportListItem/index.js | 4 +- .../ActivitySection/DateListItem/index.js | 4 +- .../ActivitySection/ItemActionButton/index.js | 2 +- .../ActivitySection/NoteListItem/index.js | 2 +- .../ActivitySection/index.js | 2 +- .../AddReportButton/index.js | 2 +- .../HistorySection/UpdateListItem/index.js | 2 +- .../HistorySection/index.js | 2 +- src/Drawer/index.js | 2 +- src/EarthRangerIconLoadingOverlay/index.js | 2 +- src/EditableItem/AttachmentControls.js | 2 +- src/EditableItem/AttachmentList.js | 2 +- src/EditableItem/Body.js | 2 +- src/EditableItem/Footer.js | 2 +- src/EditableItem/Header.js | 2 +- src/EditableItem/Modal.js | 2 +- src/ErrorBoundary/index.js | 2 +- src/ErrorMessage/index.js | 2 +- src/ErrorMessages/index.js | 2 +- src/EventFeed/index.js | 8 +- src/EventFilter/DateFilter/index.js | 2 +- src/EventFilter/Filters/index.js | 4 +- src/EventFilter/index.js | 6 +- src/EventIcon/index.js | 2 +- src/EventItemContextMenu/index.js | 2 +- src/FeatureLayerList/Content.js | 4 +- src/FeatureLayerList/FeatureListItem.js | 2 +- src/FeatureLayerList/FeatureTypeListItem.js | 6 +- src/FeatureLayerList/index.js | 4 +- src/FeedDateFilter/index.js | 2 +- src/FeedListItem/index.js | 2 +- src/FilterSettingsControl/index.js | 2 +- src/GetUserLocationButton/index.js | 2 +- src/GlobalMenuDrawer/index.js | 2 +- src/GpsFormatToggle/index.js | 2 +- src/GpsInput/index.js | 2 +- src/HamburgerMenuIcon/index.js | 2 +- src/HeatmapLegend/index.js | 2 +- src/HeatmapStyleControls/index.js | 3 +- src/HeatmapToggleButton/index.js | 2 +- src/ImageModal/index.js | 2 +- src/InactiveRadioControl/index.js | 2 +- src/InlineEditable/index.js | 2 +- src/KMLExportModal/index.js | 5 +- src/KebabMenu/index.js | 2 +- src/KebabMenuIcon/index.js | 2 +- src/LayerSelectorPopup/index.js | 2 +- src/LoadingOverlay/index.js | 2 +- src/LocationJumpButton/index.js | 2 +- src/LocationPicker/MenuPopover/index.js | 2 +- src/LocationPicker/index.js | 2 +- src/Login/index.js | 2 +- src/MapBaseLayerControl/index.js | 2 +- src/MapDrawingTools/index.js | 2 +- src/MapLayerFilter/index.js | 2 +- src/MapLegend/index.js | 2 +- src/MapLocationSelectionOverview/index.js | 2 +- src/MapLockControl/index.js | 2 +- src/MapMarkerDropper/index.js | 2 +- src/MapNamesControl/index.js | 2 +- src/MapPrintControl/index.js | 2 +- src/MapRulerControl/PointPopup.js | 2 +- src/MapRulerControl/index.js | 2 +- .../ClusterMemberControl/index.js | 2 +- src/MapSettingsControl/index.js | 2 +- src/MessageInput/index.js | 2 +- src/MessageList/MessageListItem.js | 4 +- src/MessageList/MessageSummaryList.js | 2 +- src/MessageList/MessageSummaryListItem.js | 8 +- src/MessageList/ParamFedMessageList.js | 2 +- src/MessageList/SenderDetails.js | 2 +- src/MessageList/index.js | 2 +- src/MessagingSelect/index.js | 4 +- src/MessagingSelect/styles.module.scss | 0 src/ModalRenderer/index.js | 11 +- src/MouseMarkerPopup/index.js | 2 +- src/Nav/MessageMenu.js | 2 +- src/Nav/NavHomeMenu/index.js | 2 +- src/NavigationPromptModal/index.js | 2 +- src/NotificationMenu/index.js | 4 +- src/NumericInput/index.js | 2 +- src/PatrolDetailView/Header/index.js | 2 +- src/PatrolDetailView/PlanSection/index.js | 4 +- src/PatrolDetailView/index.js | 4 +- src/PatrolFilter/DateRangePopover/index.js | 2 +- src/PatrolFilter/FiltersPopover/index.js | 6 +- src/PatrolFilter/PatrolFilterSettings.js | 6 +- src/PatrolFilter/index.js | 8 +- src/PatrolList/index.js | 2 +- src/PatrolListItem/index.js | 2 +- src/PatrolListItem/index.test.js | 2 +- src/PatrolMenu/index.js | 2 +- src/PatrolTrackControls/index.js | 2 +- src/PatrolTrackControls/styles.module.scss | 2 +- src/PatrolTrackLegend/index.js | 2 +- src/PickMapLocationButton/index.js | 2 +- src/PopupLayer/index.js | 8 +- src/PrintTitle/index.js | 2 +- src/PriorityPicker/index.js | 2 +- src/PrioritySelect/index.js | 2 +- src/ProfilePINModal/index.js | 2 +- src/QuickLinks/index.js | 2 +- src/ReportFormSummary/index.js | 2 +- .../CancelationConfirmationModal/index.js | 2 +- src/ReportGeometryDrawer/Footer/index.js | 2 +- .../InformationModal/index.js | 2 +- src/ReportListItem/index.js | 2 +- .../GeometryPreview/index.js | 2 +- .../DetailsSection/AreaSelectorInput/index.js | 4 +- .../SchemaForm/fields/ChoiceList/Dropdown.js | 2 +- .../SchemaForm/fields/ChoiceList/index.js | 2 +- .../SortableList/Item/FormModal/index.js | 4 +- .../SortableList/Item/FormPreview/index.js | 2 +- .../Collection/SortableList/Item/index.js | 2 +- .../SchemaForm/fields/Collection/index.js | 2 +- .../SchemaForm/fields/DateTime/index.js | 2 +- .../SchemaForm/fields/Header/index.js | 2 +- .../SchemaForm/fields/Header/index.test.js | 2 +- .../SchemaForm/fields/Location/index.js | 2 +- .../SchemaForm/fields/Numeric/index.js | 2 +- .../SchemaForm/fields/Section/index.js | 2 +- .../SchemaForm/fields/Text/index.js | 2 +- src/ReportManager/DetailsSection/index.js | 3 +- src/ReportManager/Header/ReportMenu/index.js | 2 +- src/ReportManager/Header/index.js | 2 +- .../LinksSection/LinkItem/index.js | 2 +- src/ReportManager/LinksSection/index.js | 2 +- src/ReportManager/ReportDetailView/index.js | 4 +- src/ReportManager/index.js | 2 +- src/ReportMapControl/index.js | 4 +- src/ReportTypeMultiSelect/index.js | 4 +- src/ReportedBySelect/index.js | 2 +- src/SchemaFields/index.js | 2 +- src/SearchBar/index.js | 4 +- src/Select/index.js | 6 +- src/SelectListGroup/SelectableItem/index.js | 2 +- src/SelectListGroup/index.js | 2 +- src/SideBar/ReportsFeedTab/index.js | 4 +- .../SettingsPane/SchemaSelector/index.js | 2 +- src/SideBar/SettingsPane/index.js | 5 +- src/SideBar/index.js | 2 +- .../index.js | 3 +- src/SubjectControls/button.js | 2 +- src/SubjectControls/index.js | 8 +- src/SubjectGroupList/Content.js | 4 +- src/SubjectGroupList/SubjectListItem.js | 2 +- src/SubjectGroupList/index.js | 2 +- src/SubjectHeatmapLegend/index.js | 2 +- src/SubjectHistoricalDataModal/index.js | 2 +- src/SubjectHistoryButton/index.js | 2 +- src/SubjectMessagesPopover/index.js | 2 +- src/SubjectMessagesPopup/index.js | 2 +- src/SubjectPopup/index.js | 4 +- src/SubjectTrackLegend/index.js | 2 +- src/SystemStatus/index.js | 4 +- src/TextCopyBtn/index.js | 2 +- src/TimeInput/index.js | 2 +- src/TimePicker/OptionsPopover/index.js | 2 +- src/TimePicker/index.js | 2 +- src/TimeSlider/TimeSliderMapControl.js | 2 +- src/TimeSlider/index.js | 2 +- src/ToastBody/index.js | 4 +- .../TimeOfDaySettings/TimeZoneSelect/index.js | 2 +- src/TrackLegend/TimeOfDaySettings/index.js | 2 +- src/TrackLegend/TrackSettings/index.js | 2 +- src/TrackLegend/TracksList/index.js | 2 +- src/TrackLegend/index.js | 2 +- src/TrackToggleButton/index.js | 4 +- src/TrackToggleButton/styles.module.scss | 4 +- src/UserMenu/index.js | 2 +- src/constants/index.js | 2 +- src/hooks/useSortedNodes/index.js | 2 +- src/utils/event-types/index.js | 2 +- src/utils/events.js | 2 +- src/utils/patrols.js | 2 +- src/views/EULA/index.js | 4 +- yarn.lock | 2845 ++++++++--------- 214 files changed, 1772 insertions(+), 1874 deletions(-) create mode 100644 __mocks__/scss.js rename react-app-config/{getHttpsConfig.js => getServerConfig.js} (63%) delete mode 100644 src/MessagingSelect/styles.module.scss diff --git a/__mocks__/scss.js b/__mocks__/scss.js new file mode 100644 index 000000000..ae4f5cb45 --- /dev/null +++ b/__mocks__/scss.js @@ -0,0 +1,11 @@ +module.exports = new Proxy( + {}, + { + get: (target, key) => { + if (key === '__esModule') { + return true; + } + return key; + }, + } +); diff --git a/package.json b/package.json index de78864f7..55d853dd5 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -181,7 +180,8 @@ "modulePaths": [], "moduleNameMapper": { "^react-native$": "react-native-web", - "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy" + ".+\\.module\\.scss": "/__mocks__/scss.js", + "^.+\\.module\\.(css|sass)$": "identity-obj-proxy" }, "moduleFileExtensions": [ "web.js", @@ -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" } } diff --git a/react-app-config/env.js b/react-app-config/env.js index ffa7e496a..e339e0f23 100644 --- a/react-app-config/env.js +++ b/react-app-config/env.js @@ -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, }) @@ -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 @@ -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]; diff --git a/react-app-config/getHttpsConfig.js b/react-app-config/getServerConfig.js similarity index 63% rename from react-app-config/getHttpsConfig.js rename to react-app-config/getServerConfig.js index 013d493c1..dd1ad40ff 100644 --- a/react-app-config/getHttpsConfig.js +++ b/react-app-config/getServerConfig.js @@ -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; diff --git a/react-app-config/modules.js b/react-app-config/modules.js index d63e41d78..1a8e72836 100644 --- a/react-app-config/modules.js +++ b/react-app-config/modules.js @@ -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.' ) ); diff --git a/react-app-config/paths.js b/react-app-config/paths.js index 07ecd5e7f..f27de50a4 100644 --- a/react-app-config/paths.js +++ b/react-app-config/paths.js @@ -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