From 21c7088f1f7a75bb5d4dbe616852edf2564d2db5 Mon Sep 17 00:00:00 2001 From: david shibley Date: Mon, 14 Oct 2024 12:53:10 -0600 Subject: [PATCH] chore: remove vulnerable dependencies from Google Analytics app --- apps/google-analytics-4/frontend/.env | 9 +- .../frontend/{public => }/index.html | 1 + .../frontend/package-lock.json | 22377 ++++------------ apps/google-analytics-4/frontend/package.json | 16 +- apps/google-analytics-4/frontend/src/App.tsx | 2 +- .../frontend/src/apis/api.spec.ts | 147 +- .../frontend/src/apis/api.ts | 4 +- .../frontend/src/apis/fetchApi.ts | 4 +- .../src/clients/segmentClient.spec.ts | 9 +- .../frontend/src/clients/segmentClient.ts | 4 +- .../common/HyperLink/HyperLink.spec.tsx | 3 +- .../src/components/common/Note/Note.spec.tsx | 8 +- .../GoogleAnalyticsConfigPage.spec.tsx | 33 +- .../GoogleAnalyticsConfigPage.styles.ts | 2 +- .../GoogleAnalyticsConfigPage.tsx | 24 +- .../WarningDisplay/WarningDisplay.spec.tsx | 2 +- .../WarningDisplay/WarningDisplay.tsx | 2 +- .../api-access/ApiAccessSection.spec.tsx | 3 +- .../api-access/ApiAccessSection.tsx | 4 +- .../DisplayServiceAccountCard.spec.tsx | 7 +- .../display/DisplayServiceAccountCard.tsx | 10 +- .../display/ServiceAccountChecklist.spec.tsx | 6 +- .../display/ServiceAccountChecklist.tsx | 4 +- .../setup/SetupServiceAccountCard.spec.tsx | 5 +- .../setup/SetupServiceAccountCard.tsx | 2 +- .../AssignContentTypeCard.spec.tsx | 8 +- .../AssignContentTypeCard.tsx | 4 +- .../AssignContentTypeRow.spec.tsx | 9 +- .../AssignContentTypeRow.tsx | 4 +- .../AssignContentTypeSection.spec.tsx | 11 +- .../AssignContentTypeSection.tsx | 4 +- .../ContentTypeWarning.spec.tsx | 4 +- .../ContentTypeWarning.tsx | 6 +- .../header/AboutSection.spec.tsx | 2 +- .../MapAccountPropertyDropdown.spec.tsx | 11 +- .../MapAccountPropertyDropdown.tsx | 8 +- .../MapAccountPropertySection.spec.tsx | 7 +- .../MapAccountPropertySection.tsx | 2 +- .../AnalyticsApp/AnalyticsApp.spec.tsx | 42 +- .../main-app/AnalyticsApp/AnalyticsApp.tsx | 12 +- .../AnalyticsMetricDisplay.spec.tsx | 8 +- .../AnalyticsMetricDisplay.tsx | 6 +- .../ChartContent/ChartContent.spec.tsx | 9 +- .../main-app/ChartContent/ChartContent.tsx | 8 +- .../main-app/ChartFooter/ChartFooter.spec.tsx | 4 +- .../main-app/ChartHeader/ChartHeader.spec.tsx | 2 +- .../ErrorDisplay/CommonErrorDisplays.tsx | 4 +- .../ErrorDisplay/ErrorDisplay.spec.tsx | 27 +- .../main-app/ErrorDisplay/ErrorDisplay.tsx | 6 +- .../main-app/LineChart/LineChart.spec.tsx | 2 +- .../main-app/LineChart/LineChart.tsx | 2 +- .../SlugWarningDisplay.spec.tsx | 27 +- .../SlugWarningDisplay/SlugWarningDisplay.tsx | 11 +- .../google-analytics-4/frontend/src/config.ts | 20 +- .../DateRangeHelpers/DateRangeHelpers.spec.ts | 8 +- .../frontend/src/hooks/useApi.spec.ts | 5 +- .../useSidebarSlug/useSidebarSlug.spec.tsx | 120 +- .../hooks/useSidebarSlug/useSidebarSlug.tsx | 2 +- .../google-analytics-4/frontend/src/index.tsx | 2 +- .../frontend/src/locations/ConfigScreen.tsx | 2 +- .../frontend/src/locations/Dialog.spec.tsx | 5 +- .../src/locations/EntryEditor.spec.tsx | 5 +- .../frontend/src/locations/Field.spec.tsx | 5 +- .../frontend/src/locations/Home.spec.tsx | 5 +- .../frontend/src/locations/Page.spec.tsx | 5 +- .../frontend/src/locations/Sidebar.tsx | 10 +- .../SegmentAnalyticsProvider.spec.tsx | 11 +- .../providers/SegmentAnalyticsProvider.tsx | 2 +- .../frontend/src/setupTests.ts | 10 +- .../frontend/test/mocks/api/handlers.ts | 2 +- .../frontend/test/mocks/mockSdk.ts | 18 +- .../test/mocks/mockSegmentAnalytics.ts | 5 +- .../frontend/vite.config.js | 11 + .../frontend/vitest.config.js | 17 + 74 files changed, 5420 insertions(+), 17788 deletions(-) rename apps/google-analytics-4/frontend/{public => }/index.html (91%) create mode 100644 apps/google-analytics-4/frontend/vite.config.js create mode 100644 apps/google-analytics-4/frontend/vitest.config.js diff --git a/apps/google-analytics-4/frontend/.env b/apps/google-analytics-4/frontend/.env index d0f10eb620..81fa284818 100644 --- a/apps/google-analytics-4/frontend/.env +++ b/apps/google-analytics-4/frontend/.env @@ -1,4 +1,5 @@ -REACT_APP_BACKEND_API_URL=https://google-analytics-4.ctfapps.net -REACT_APP_VERSION=$npm_package_version -REACT_APP_SENTRY_DSN=https://b8f524eae7c446fb8071476431426640@o2239.ingest.sentry.io/4504725335834624 -REACT_APP_SEGMENT_WRITE_KEY=jGZHaYldsH12362MNsO2mT0BEvV2Hi6W +VITE_BACKEND_API_URL=https://google-analytics-4.ctfapps.net +VITE_VERSION=$npm_package_version +VITE_SENTRY_DSN=https://b8f524eae7c446fb8071476431426640@o2239.ingest.sentry.io/4504725335834624 +VITE_SEGMENT_WRITE_KEY=jGZHaYldsH12362MNsO2mT0BEvV2Hi6W +VITE_NODE_ENV=development \ No newline at end of file diff --git a/apps/google-analytics-4/frontend/public/index.html b/apps/google-analytics-4/frontend/index.html similarity index 91% rename from apps/google-analytics-4/frontend/public/index.html rename to apps/google-analytics-4/frontend/index.html index 0336ea57c3..05ec186d00 100644 --- a/apps/google-analytics-4/frontend/public/index.html +++ b/apps/google-analytics-4/frontend/index.html @@ -7,6 +7,7 @@
+