diff --git a/react/.gitignore b/react/.gitignore index ed835a8e..a8966a8f 100644 --- a/react/.gitignore +++ b/react/.gitignore @@ -23,6 +23,10 @@ dist-ssr *.sln *.sw? +# Building artifacts from core-components +# (to be removed in https://tacc-main.atlassian.net/browse/WI-208) +.nx + # Environment .env secret_local.ts diff --git a/react/jest.config.cjs b/react/jest.config.cjs index 68700de6..d63ce4ec 100644 --- a/react/jest.config.cjs +++ b/react/jest.config.cjs @@ -25,8 +25,25 @@ module.exports = { collectCoverage: true, // An array of glob patterns indicating a set of files for which coverage information should be collected - // collectCoverageFrom: undefined, - + collectCoverageFrom: [ + 'src/**/*.{js,jsx,ts,tsx}', + // Exclude test files + '!src/**/*.test.{js,jsx,ts,tsx}', + '!src/**/*.spec.{js,jsx,ts,tsx}', + // Exclude test utilities + '!src/test/**/*', + '!src/testUtil.ts', + '!src/__fixtures__/**/*', + // Exclude secrets and other files + '!src/secret_local*ts', + '!src/types/react*.ts', + // Exclude build/dist directories + '!dist/**/*', + '!build/**/*', + '!src/vite-env*', + // Exclude node_modules + '!**/node_modules/**', + ], // The directory where Jest should output its coverage files coverageDirectory: 'coverage', diff --git a/react/src/pages/MainMenu/MainMenu.tsx b/react/src/pages/MainMenu/MainMenu.tsx index 861ffdfc..d3b5adf1 100644 --- a/react/src/pages/MainMenu/MainMenu.tsx +++ b/react/src/pages/MainMenu/MainMenu.tsx @@ -9,7 +9,7 @@ import useAuthenticatedUser from '@hazmapper/hooks/user/useAuthenticatedUser'; import { SystemSelect } from '@hazmapper/components/Systems'; import { ProjectListing } from '@hazmapper/components/Projects/ProjectListing'; -function MainMenu() { +const MainMenu = () => { const { data: userData, isLoading: isUserLoading, @@ -50,6 +50,6 @@ function MainMenu() { ); -} +}; export default MainMenu; diff --git a/react/src/vite-env.d.ts b/react/src/vite-env.d.ts index 4c64246d..11f02fe2 100644 --- a/react/src/vite-env.d.ts +++ b/react/src/vite-env.d.ts @@ -1,26 +1 @@ /// - -interface Env { - designSafeUrl: string; - backend: string; - geoapiUrl: string; - designsafePortalUrl: string; - clientId: string; - host: string; - baseHref: string; - jwt: string; - mapillaryAuthUrl: string; - mapillaryTokenUrl: string; - mapillaryApiUrl: string; - mapillaryTileUrl: string; - mapillaryScope: string; - mapillaryClientSecret: string; - mapillaryClientId: string; - mapillaryClientToken: string; -} - -interface ProcessEnv { - env: Env; -} - -declare const process: ProcessEnv; diff --git a/react/vite.config.ts b/react/vite.config.ts index e062e8e6..62d8d7e2 100644 --- a/react/vite.config.ts +++ b/react/vite.config.ts @@ -20,12 +20,6 @@ export default defineConfig(({ command, mode }) => { port: 4200, host: 'localhost', }, - resolve: { - alias: { - '@hazmapper': path.resolve(__dirname, './src'), - '@core-components': path.resolve(__dirname, './src/core-components'), - }, - }, resolve: { alias: { '@hazmapper': path.resolve(__dirname, './src'),