diff --git a/.babelrc.js b/.babelrc.js index 4e9ca959f..358791d8b 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -1,4 +1,4 @@ -const pathAliases = require('./pathAliases'); +const path = require('path'); module.exports = { env: { @@ -29,7 +29,9 @@ module.exports = { 'module-resolver', { root: ['./'], - alias: pathAliases, + alias: { + '@/': path.resolve('./'), + }, }, ], 'macros', diff --git a/.eslintrc.js b/.eslintrc.js index 3a0952a40..806366926 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -120,11 +120,11 @@ module.exports = { }, }, { - files: ['components/nav.js', 'components/Footer/Footer.js'], + files: ['./components/nav.js', './components/Footer/Footer.js'], rules: { 'jsx-a11y/anchor-is-valid': 'off' }, }, { - files: ['components/UpdateProfileForm/**/*.js'], + files: ['./components/UpdateProfileForm/**/*.js'], rules: { 'react/sort-comp': 'off' }, }, ], @@ -227,7 +227,7 @@ module.exports = { paths: [ { name: 'react-select', - message: 'Please use `components/Form/Select/ThemedReactSelect` instead.', + message: 'Please use `@/components/Form/Select/ThemedReactSelect` instead.', }, { name: 'prop-types', @@ -237,7 +237,7 @@ module.exports = { { name: 'formik', importNames: ['Form'], - message: `Please use our Form component to have good defaults defined.\n "import { Form } from 'components/Form/Form';"`, + message: `Please use our Form component to have good defaults defined.\n "import { Form } from '@/components/Form/Form';"`, }, { name: 'react', diff --git a/.storybook/backgrounds.js b/.storybook/backgrounds.js index 153e36314..53d5eeaad 100644 --- a/.storybook/backgrounds.js +++ b/.storybook/backgrounds.js @@ -1,5 +1,5 @@ -import { brandColorsObject } from 'common/styles/styleExports'; -import { capitalizeFirstLetter } from 'common/utils/string-utils'; +import { brandColorsObject } from '@/common/styles/styleExports'; +import { capitalizeFirstLetter } from '@/common/utils/string-utils'; const backgroundsPaletteArray = Object.keys(brandColorsObject).map(name => ({ name: capitalizeFirstLetter(name), diff --git a/.storybook/preview.js b/.storybook/preview.js index d3e5f9115..24d8e27db 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,5 +1,5 @@ import backgroundsPalleteArray from './backgrounds'; -import 'common/styles/globals.css'; +import '@/common/styles/globals.css'; import * as viewports from '@storybook/addon-viewport'; export const decorators = [ diff --git a/common/constants/api.js b/common/constants/api.js index cceba2745..154b5758c 100644 --- a/common/constants/api.js +++ b/common/constants/api.js @@ -1,5 +1,5 @@ -import { get, post, patch, put, ResourcesAPI } from 'common/utils/api-utils'; -import { formatUserData } from 'common/utils/formatters'; +import { get, post, patch, put, ResourcesAPI } from '@/common/utils/api-utils'; +import { formatUserData } from '@/common/utils/formatters'; /* GET REQUESTS */ export const getUserPromise = ({ token }) => get('auth/user/', { token }); diff --git a/common/constants/partners.js b/common/constants/partners.js index eca23040a..d70c481a0 100644 --- a/common/constants/partners.js +++ b/common/constants/partners.js @@ -1,5 +1,5 @@ -import { s3 } from 'common/constants/urls'; import sortBy from 'lodash/sortBy'; +import { s3 } from '@/common/constants/urls'; export const PARTNER_TYPES = { PAID: 'PAID', diff --git a/common/constants/successStories.js b/common/constants/successStories.js index 122a4d8c9..a68db9a43 100644 --- a/common/constants/successStories.js +++ b/common/constants/successStories.js @@ -1,4 +1,4 @@ -import { s3 } from 'common/constants/urls'; +import { s3 } from '@/common/constants/urls'; export const successStories = [ { diff --git a/common/styles/breakpoints.js b/common/styles/breakpoints.js index e473ec3ef..26b464988 100644 --- a/common/styles/breakpoints.js +++ b/common/styles/breakpoints.js @@ -1,5 +1,5 @@ -import { breakpointsObject } from 'common/styles/styleExports'; -import { getBreakpoints } from 'common/utils/style-utils'; +import { breakpointsObject } from '@/common/styles/styleExports'; +import { getBreakpoints } from '@/common/utils/style-utils'; const breakpoints = getBreakpoints(Object.values(breakpointsObject)); diff --git a/common/styles/styleExports.ts b/common/styles/styleExports.ts index a87861c46..59f92c51f 100644 --- a/common/styles/styleExports.ts +++ b/common/styles/styleExports.ts @@ -1,4 +1,4 @@ -import { isHexColor } from 'common/utils/style-utils'; +import { isHexColor } from '@/common/utils/style-utils'; import * as themeMap from './themeMap'; const themeMapValues = Object.entries(themeMap); @@ -17,16 +17,13 @@ export const breakpointsObject: StyleObjectType = themeMapValues.reduce((object, return object; }, {} as StyleObjectType); -export const brandColorsObject: StyleObjectType = themeMapValues.reduce( - (object, [key, value]) => { - if (isHexColor(value)) { - object[key] = value; // eslint-disable-line no-param-reassign - } +export const brandColorsObject: StyleObjectType = themeMapValues.reduce((object, [key, value]) => { + if (isHexColor(value)) { + object[key] = value; // eslint-disable-line no-param-reassign + } - return object; - }, - {} as StyleObjectType, -); + return object; +}, {} as StyleObjectType); export const fontsObject: StyleObjectType = themeMapValues.reduce((object, [key, value]) => { if (key.includes('Font')) { diff --git a/common/utils/__tests__/api-utils.test.js b/common/utils/__tests__/api-utils.test.js index 5f61340ef..5b58a10e9 100644 --- a/common/utils/__tests__/api-utils.test.js +++ b/common/utils/__tests__/api-utils.test.js @@ -1,5 +1,5 @@ -import { getServerErrorMessage } from 'common/utils/api-utils'; -import { networkErrorMessages } from 'common/constants/messages'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; +import { networkErrorMessages } from '@/common/constants/messages'; describe('API Utilities', () => { describe('getServerErrorMessage', () => { diff --git a/common/utils/api-utils.js b/common/utils/api-utils.js index 400bb61f3..0129a1015 100644 --- a/common/utils/api-utils.js +++ b/common/utils/api-utils.js @@ -1,9 +1,9 @@ import axios from 'axios'; import lodashGet from 'lodash/get'; -import { networkErrorMessages } from 'common/constants/messages'; -import { apiUrl, resourcesAPIURL } from 'common/config/environment'; -import { setAuthorizationHeader } from 'common/utils/cookie-utils'; import qs from 'qs'; +import { networkErrorMessages } from '@/common/constants/messages'; +import { apiUrl, resourcesAPIURL } from '@/common/config/environment'; +import { setAuthorizationHeader } from '@/common/utils/cookie-utils'; const baseAxiosConfig = { baseURL: apiUrl, diff --git a/common/utils/formatters.js b/common/utils/formatters.js index 9269ab6a7..aa2f1f2d4 100644 --- a/common/utils/formatters.js +++ b/common/utils/formatters.js @@ -1,4 +1,4 @@ -import { isFilledArray } from 'common/utils/array-utils'; +import { isFilledArray } from '@/common/utils/array-utils'; // TODO: Remove eslint disable when more items are exported /* eslint-disable import/prefer-default-export */ diff --git a/common/utils/thirdParty/gtag.js b/common/utils/thirdParty/gtag.js index 9aa04cb69..465adf171 100644 --- a/common/utils/thirdParty/gtag.js +++ b/common/utils/thirdParty/gtag.js @@ -1,5 +1,5 @@ import snakeCase from 'lodash/snakeCase'; -import { clientTokens } from 'common/config/environment'; +import { clientTokens } from '@/common/config/environment'; // TODO: Leverage prod-build-time-only env vars instead NODE_ENV for prod check const isProduction = process.env.NODE_ENV === 'production'; diff --git a/components/Accordion/Accordion.tsx b/components/Accordion/Accordion.tsx index 2f1987486..3646816a3 100644 --- a/components/Accordion/Accordion.tsx +++ b/components/Accordion/Accordion.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import classNames from 'classnames'; import Chevron from 'public/static/images/icons/FontAwesome/angle-right-solid.svg'; -import { ACCORDION_CONTENT, ACCORDION_TOGGLE_BUTTON } from 'common/constants/testIDs'; +import { ACCORDION_CONTENT, ACCORDION_TOGGLE_BUTTON } from '@/common/constants/testIDs'; import { ScreenReaderOnly, toggleMessages } from '../ScreenReaderOnly/ScreenReaderOnly'; import { Card } from '../Cards/Card/Card'; import styles from './Accordion.module.css'; diff --git a/components/Accordion/__tests__/Accordion.test.tsx b/components/Accordion/__tests__/Accordion.test.tsx index e5c37cbbe..2b0a62f94 100644 --- a/components/Accordion/__tests__/Accordion.test.tsx +++ b/components/Accordion/__tests__/Accordion.test.tsx @@ -4,7 +4,7 @@ import { ACCORDION_CONTENT, ACCORDION_TOGGLE_BUTTON, SCREEN_READER_ONLY, -} from 'common/constants/testIDs'; +} from '@/common/constants/testIDs'; import { toggleMessages } from '../../ScreenReaderOnly/ScreenReaderOnly'; import meta, { Default } from '../__stories__/Accordion.stories'; diff --git a/components/Alert/Alert.tsx b/components/Alert/Alert.tsx index acc100629..aa685ff3a 100644 --- a/components/Alert/Alert.tsx +++ b/components/Alert/Alert.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; -import { ALERT, ALERT_CLOSE_BUTTON } from 'common/constants/testIDs'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { ALERT, ALERT_CLOSE_BUTTON } from '@/common/constants/testIDs'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; import styles from './Alert.module.css'; export interface AlertPropsType { diff --git a/components/Alert/__tests__/Alert.test.tsx b/components/Alert/__tests__/Alert.test.tsx index 2c17f9f83..c6ac3d60b 100644 --- a/components/Alert/__tests__/Alert.test.tsx +++ b/components/Alert/__tests__/Alert.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, render } from '@testing-library/react'; import { composeStory } from '@storybook/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { ALERT_CLOSE_BUTTON } from 'common/constants/testIDs'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { ALERT_CLOSE_BUTTON } from '@/common/constants/testIDs'; import meta, { ErrorAlert, SuccessAlert, WarningAlert } from '../__stories__/Alert.stories'; const ErrorAlertStory = composeStory(ErrorAlert, meta); diff --git a/components/Badge/__tests__/Badge.test.tsx b/components/Badge/__tests__/Badge.test.tsx index 38330dd7f..26fb6923d 100644 --- a/components/Badge/__tests__/Badge.test.tsx +++ b/components/Badge/__tests__/Badge.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import Icon from 'static/images/icons/github_logo.svg'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import Icon from '@/public/static/images/icons/github_logo.svg'; import { Badge } from '../Badge'; diff --git a/components/Branding/ColorSection/ColorSection.tsx b/components/Branding/ColorSection/ColorSection.tsx index 20b04a0b8..74242c76e 100644 --- a/components/Branding/ColorSection/ColorSection.tsx +++ b/components/Branding/ColorSection/ColorSection.tsx @@ -1,6 +1,6 @@ -import { brandColorsObject } from 'common/styles/styleExports'; -import { Swatch } from 'components/Branding/Swatch/Swatch'; -import { Content } from 'components/Content/Content'; +import { brandColorsObject } from '@/common/styles/styleExports'; +import { Swatch } from '@/components/Branding/Swatch/Swatch'; +import { Content } from '@/components/Content/Content'; export function ColorSection() { const primaryColor = { name: 'Primary', hexCode: brandColorsObject.primary }; diff --git a/components/Branding/ColorSection/__tests__/ColorSection.test.tsx b/components/Branding/ColorSection/__tests__/ColorSection.test.tsx index c661a5450..ab6c9dd6a 100644 --- a/components/Branding/ColorSection/__tests__/ColorSection.test.tsx +++ b/components/Branding/ColorSection/__tests__/ColorSection.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { ColorSection } from '../ColorSection'; diff --git a/components/Branding/FontSection/FontSection.tsx b/components/Branding/FontSection/FontSection.tsx index 097baadad..b872f25ac 100644 --- a/components/Branding/FontSection/FontSection.tsx +++ b/components/Branding/FontSection/FontSection.tsx @@ -1,5 +1,5 @@ -import { Content } from 'components/Content/Content'; -import { fontsObject } from 'common/styles/styleExports'; +import { Content } from '@/components/Content/Content'; +import { fontsObject } from '@/common/styles/styleExports'; export function FontSection() { // Every letter of the alphabet in one string diff --git a/components/Branding/FontSection/__tests__/FontSection.test.tsx b/components/Branding/FontSection/__tests__/FontSection.test.tsx index f4b3c68ad..4098e53c1 100644 --- a/components/Branding/FontSection/__tests__/FontSection.test.tsx +++ b/components/Branding/FontSection/__tests__/FontSection.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { FontSection } from '../FontSection'; diff --git a/components/Branding/LogoSection/LogoSection.tsx b/components/Branding/LogoSection/LogoSection.tsx index ad29edabd..d64e81839 100644 --- a/components/Branding/LogoSection/LogoSection.tsx +++ b/components/Branding/LogoSection/LogoSection.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; -import { Badge } from 'components/Badge/Badge'; -import { Content } from 'components/Content/Content'; -import { s3 } from 'common/constants/urls'; +import { Badge } from '@/components/Badge/Badge'; +import { Content } from '@/components/Content/Content'; +import { s3 } from '@/common/constants/urls'; import Image from 'next/legacy/image'; import styles from './LogoSection.module.css'; diff --git a/components/Branding/LogoSection/__tests__/LogoSection.test.tsx b/components/Branding/LogoSection/__tests__/LogoSection.test.tsx index 584d708e7..288d3ca75 100644 --- a/components/Branding/LogoSection/__tests__/LogoSection.test.tsx +++ b/components/Branding/LogoSection/__tests__/LogoSection.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { LogoSection } from '../LogoSection'; diff --git a/components/Branding/Swatch/Swatch.tsx b/components/Branding/Swatch/Swatch.tsx index da657b689..fdc8693a8 100644 --- a/components/Branding/Swatch/Swatch.tsx +++ b/components/Branding/Swatch/Swatch.tsx @@ -1,5 +1,5 @@ import { string } from 'prop-types'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; Swatch.propTypes = { colorName: string.isRequired, diff --git a/components/Branding/Swatch/__tests__/Swatch.test.tsx b/components/Branding/Swatch/__tests__/Swatch.test.tsx index 65ff37719..2b7fc40ac 100644 --- a/components/Branding/Swatch/__tests__/Swatch.test.tsx +++ b/components/Branding/Swatch/__tests__/Swatch.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { Swatch } from '../Swatch'; diff --git a/components/Buttons/Button/Button.tsx b/components/Buttons/Button/Button.tsx index ab1b5a3d2..8c4336b7c 100644 --- a/components/Buttons/Button/Button.tsx +++ b/components/Buttons/Button/Button.tsx @@ -1,8 +1,8 @@ import noop from 'lodash/noop'; import classNames from 'classnames'; -import { BUTTON } from 'common/constants/testIDs'; -import { gtag } from 'common/utils/thirdParty/gtag'; -import { getDataAttributes, getAriaAttributes } from 'common/utils/prop-utils'; +import { BUTTON } from '@/common/constants/testIDs'; +import { gtag } from '@/common/utils/thirdParty/gtag'; +import { getDataAttributes, getAriaAttributes } from '@/common/utils/prop-utils'; import styles from './Button.module.css'; interface GoogleAnalyticsEventPropType { diff --git a/components/Buttons/Button/__tests__/Button.test.tsx b/components/Buttons/Button/__tests__/Button.test.tsx index b1dcbf5eb..09bc4dfc4 100644 --- a/components/Buttons/Button/__tests__/Button.test.tsx +++ b/components/Buttons/Button/__tests__/Button.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, render } from '@testing-library/react'; -import { BUTTON } from 'common/constants/testIDs'; -import { gtag } from 'common/utils/thirdParty/gtag'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import { BUTTON } from '@/common/constants/testIDs'; +import { gtag } from '@/common/utils/thirdParty/gtag'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { Button } from '../Button'; diff --git a/components/Buttons/CloseButton/CloseButton.tsx b/components/Buttons/CloseButton/CloseButton.tsx index 0a48c7caf..6d5ac8706 100644 --- a/components/Buttons/CloseButton/CloseButton.tsx +++ b/components/Buttons/CloseButton/CloseButton.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; -import { CLOSE_BUTTON } from 'common/constants/testIDs'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; -import PlusIcon from 'static/images/icons/plus.svg'; +import { CLOSE_BUTTON } from '@/common/constants/testIDs'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; +import PlusIcon from '@/public/static/images/icons/plus.svg'; import styles from './CloseButton.module.css'; export type CloseButtonProps = { diff --git a/components/Buttons/CloseButton/__tests__/CloseButton.test.tsx b/components/Buttons/CloseButton/__tests__/CloseButton.test.tsx index 3cd1253cb..0b8e02c82 100644 --- a/components/Buttons/CloseButton/__tests__/CloseButton.test.tsx +++ b/components/Buttons/CloseButton/__tests__/CloseButton.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, render } from '@testing-library/react'; -import { CLOSE_BUTTON } from 'common/constants/testIDs'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import { CLOSE_BUTTON } from '@/common/constants/testIDs'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { CloseButton } from '../CloseButton'; describe('CloseButton', () => { diff --git a/components/Buttons/LinkButton/LinkButton.tsx b/components/Buttons/LinkButton/LinkButton.tsx index 5a5196810..6ec9653ad 100644 --- a/components/Buttons/LinkButton/LinkButton.tsx +++ b/components/Buttons/LinkButton/LinkButton.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import Link from 'next/link'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; import styles from '../Button/Button.module.css'; export interface LinkButtonProps { diff --git a/components/Buttons/LinkButton/__tests__/LinkButton.test.tsx b/components/Buttons/LinkButton/__tests__/LinkButton.test.tsx index 98c227af7..381a961ab 100644 --- a/components/Buttons/LinkButton/__tests__/LinkButton.test.tsx +++ b/components/Buttons/LinkButton/__tests__/LinkButton.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, render } from '@testing-library/react'; -import { gtag } from 'common/utils/thirdParty/gtag'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import { gtag } from '@/common/utils/thirdParty/gtag'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { LinkButton } from '../LinkButton'; describe('LinkButton', () => { diff --git a/components/Cards/Card/Card.tsx b/components/Cards/Card/Card.tsx index ff7c77c14..ce439d564 100644 --- a/components/Cards/Card/Card.tsx +++ b/components/Cards/Card/Card.tsx @@ -1,5 +1,5 @@ import { twMerge } from 'tailwind-merge'; -import { getDataAttributes } from 'common/utils/prop-utils'; +import { getDataAttributes } from '@/common/utils/prop-utils'; export interface CardPropsType { children: React.ReactNode; diff --git a/components/Cards/Card/__tests__/Card.test.tsx b/components/Cards/Card/__tests__/Card.test.tsx index 537ddcf59..f70fb5a94 100644 --- a/components/Cards/Card/__tests__/Card.test.tsx +++ b/components/Cards/Card/__tests__/Card.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { Card } from '../Card'; describe('Card', () => { diff --git a/components/Cards/FlatCard/FlatCard.tsx b/components/Cards/FlatCard/FlatCard.tsx index 64ef09ba9..9dc7fa7d0 100644 --- a/components/Cards/FlatCard/FlatCard.tsx +++ b/components/Cards/FlatCard/FlatCard.tsx @@ -1,8 +1,8 @@ import classNames from 'classnames'; import { twMerge } from 'tailwind-merge'; import Image from 'next/legacy/image'; -import { FLAT_CARD_IMAGE } from 'common/constants/testIDs'; -import { getPlaceholder } from 'common/utils/next-utils'; +import { FLAT_CARD_IMAGE } from '@/common/constants/testIDs'; +import { getPlaceholder } from '@/common/utils/next-utils'; import { ReactNode } from 'react'; interface FlatCardProps { diff --git a/components/Cards/FlatCard/__tests__/FlatCard.test.js b/components/Cards/FlatCard/__tests__/FlatCard.test.js index 9bedb2e30..bcf003aac 100644 --- a/components/Cards/FlatCard/__tests__/FlatCard.test.js +++ b/components/Cards/FlatCard/__tests__/FlatCard.test.js @@ -1,9 +1,9 @@ import { render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { FLAT_CARD_IMAGE } from 'common/constants/testIDs'; -import { s3 } from 'common/constants/urls'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; import { FlatCard } from '../FlatCard'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { FLAT_CARD_IMAGE } from '@/common/constants/testIDs'; +import { s3 } from '@/common/constants/urls'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; describe('FlatCard', () => { const requiredProps = { diff --git a/components/Cards/ImageCard/ImageCard.tsx b/components/Cards/ImageCard/ImageCard.tsx index fa5c7273a..5619dbfd3 100644 --- a/components/Cards/ImageCard/ImageCard.tsx +++ b/components/Cards/ImageCard/ImageCard.tsx @@ -1,6 +1,6 @@ import { twMerge } from 'tailwind-merge'; import Image from 'next/legacy/image'; -import { Card, CardPropsType } from 'components/Cards/Card/Card'; +import { Card, CardPropsType } from '@/components/Cards/Card/Card'; export type ImageCardPropsType = { /** diff --git a/components/Cards/ImageCard/__tests__/ImageCard.test.tsx b/components/Cards/ImageCard/__tests__/ImageCard.test.tsx index fa1eadb60..7801548cd 100644 --- a/components/Cards/ImageCard/__tests__/ImageCard.test.tsx +++ b/components/Cards/ImageCard/__tests__/ImageCard.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { ImageCard } from '../ImageCard'; describe('ImageCard', () => { diff --git a/components/Cards/ResourceCard/ResourceCard.tsx b/components/Cards/ResourceCard/ResourceCard.tsx index 4dad1a177..a4ddc86a7 100644 --- a/components/Cards/ResourceCard/ResourceCard.tsx +++ b/components/Cards/ResourceCard/ResourceCard.tsx @@ -1,8 +1,8 @@ import { useState } from 'react'; import classNames from 'classnames'; -import { Accordion } from 'components/Accordion/Accordion'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { Accordion } from '@/components/Accordion/Accordion'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; import { UPVOTE_BUTTON, UPVOTE_COUNT, @@ -10,9 +10,9 @@ import { DOWNVOTE_COUNT, RESOURCE_CARD, RESOURCE_TITLE, -} from 'common/constants/testIDs'; -import ThumbsUp from 'static/images/icons/FontAwesome/thumbs-up.svg'; -import ThumbsDown from 'static/images/icons/FontAwesome/thumbs-down.svg'; +} from '@/common/constants/testIDs'; +import ThumbsUp from '@/public/static/images/icons/FontAwesome/thumbs-up.svg'; +import ThumbsDown from '@/public/static/images/icons/FontAwesome/thumbs-down.svg'; import styles from './ResourceCard.module.css'; const DESKTOP_VOTING_BLOCK = 'desktopVotingBlock'; diff --git a/components/Cards/ResourceCard/__tests__/ResourceCard.test.tsx b/components/Cards/ResourceCard/__tests__/ResourceCard.test.tsx index 790553dab..602db2ebb 100644 --- a/components/Cards/ResourceCard/__tests__/ResourceCard.test.tsx +++ b/components/Cards/ResourceCard/__tests__/ResourceCard.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, render } from '@testing-library/react'; -import { UPVOTE_BUTTON, DOWNVOTE_BUTTON } from 'common/constants/testIDs'; +import { UPVOTE_BUTTON, DOWNVOTE_BUTTON } from '@/common/constants/testIDs'; import { ResourceCard } from '../ResourceCard'; describe('ResourceCard', () => { diff --git a/components/Cards/ResourceCard/__tests__/ResourceSkeletonCard.test.tsx b/components/Cards/ResourceCard/__tests__/ResourceSkeletonCard.test.tsx index 9d9b47d16..9d312be44 100644 --- a/components/Cards/ResourceCard/__tests__/ResourceSkeletonCard.test.tsx +++ b/components/Cards/ResourceCard/__tests__/ResourceSkeletonCard.test.tsx @@ -1,5 +1,5 @@ import { render } from '@testing-library/react'; -import { SKELETON_CARD } from 'common/constants/testIDs'; +import { SKELETON_CARD } from '@/common/constants/testIDs'; import { ResourceSkeletonCard } from '../ResourceSkeletonCard'; describe('ResourceSkeletonCard', () => { diff --git a/components/Cards/ValueCard/ValueCard.tsx b/components/Cards/ValueCard/ValueCard.tsx index 318728e03..108a6a07c 100644 --- a/components/Cards/ValueCard/ValueCard.tsx +++ b/components/Cards/ValueCard/ValueCard.tsx @@ -1,4 +1,4 @@ -import { Card } from 'components/Cards/Card/Card'; +import { Card } from '@/components/Cards/Card/Card'; export interface ValueCardPropsType { name: string; diff --git a/components/Cards/ValueCard/__tests__/ValueCard.test.tsx b/components/Cards/ValueCard/__tests__/ValueCard.test.tsx index ed72488ed..888528efc 100644 --- a/components/Cards/ValueCard/__tests__/ValueCard.test.tsx +++ b/components/Cards/ValueCard/__tests__/ValueCard.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { ValueCard } from '../ValueCard'; describe('ValueCard', () => { diff --git a/components/Container/Container.tsx b/components/Container/Container.tsx index d791c886f..061e8da8f 100644 --- a/components/Container/Container.tsx +++ b/components/Container/Container.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import { getDataAttributes } from 'common/utils/prop-utils'; +import { getDataAttributes } from '@/common/utils/prop-utils'; import styles from './Container.module.css'; export interface ContainerPropsType { diff --git a/components/Container/__tests__/Container.test.tsx b/components/Container/__tests__/Container.test.tsx index 31041194f..a5cb6e074 100644 --- a/components/Container/__tests__/Container.test.tsx +++ b/components/Container/__tests__/Container.test.tsx @@ -1,6 +1,6 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; -import { s3 } from 'common/constants/urls'; +import { s3 } from '@/common/constants/urls'; import { Container } from '../Container'; describe('Container', () => { diff --git a/components/Content/Content.tsx b/components/Content/Content.tsx index ff0c98ac0..213f74fce 100644 --- a/components/Content/Content.tsx +++ b/components/Content/Content.tsx @@ -1,6 +1,6 @@ import { cloneElement, ReactElement } from 'react'; -import { Container } from 'components/Container/Container'; -import { Heading } from 'components/Heading/Heading'; +import { Container } from '@/components/Container/Container'; +import { Heading } from '@/components/Heading/Heading'; export interface ContentPropsType { /** diff --git a/components/Content/__tests__/Content.test.tsx b/components/Content/__tests__/Content.test.tsx index 2c0887c48..eeb2543f9 100644 --- a/components/Content/__tests__/Content.test.tsx +++ b/components/Content/__tests__/Content.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { Content } from '../Content'; diff --git a/components/Drawer/__tests__/Drawer.test.tsx b/components/Drawer/__tests__/Drawer.test.tsx index ffcd6a15a..fb3fb389e 100644 --- a/components/Drawer/__tests__/Drawer.test.tsx +++ b/components/Drawer/__tests__/Drawer.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { Drawer } from '../Drawer'; diff --git a/components/ErrorDisplay/ErrorDisplay.tsx b/components/ErrorDisplay/ErrorDisplay.tsx index d1a5d2200..d1575a69a 100644 --- a/components/ErrorDisplay/ErrorDisplay.tsx +++ b/components/ErrorDisplay/ErrorDisplay.tsx @@ -1,4 +1,4 @@ -import { Head } from 'components/Head'; +import { Head } from '@/components/Head'; export interface ErrorDisplayPropsType { /** diff --git a/components/ErrorDisplay/__tests__/ErrorDisplay.test.tsx b/components/ErrorDisplay/__tests__/ErrorDisplay.test.tsx index 9e7faf4d4..bf794d470 100644 --- a/components/ErrorDisplay/__tests__/ErrorDisplay.test.tsx +++ b/components/ErrorDisplay/__tests__/ErrorDisplay.test.tsx @@ -1,5 +1,5 @@ import { render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { ErrorDisplay } from '../ErrorDisplay'; describe('ErrorDisplay', () => { diff --git a/components/FeaturedJobItem/FeaturedJobItem.tsx b/components/FeaturedJobItem/FeaturedJobItem.tsx index a7f3f0b98..783868646 100644 --- a/components/FeaturedJobItem/FeaturedJobItem.tsx +++ b/components/FeaturedJobItem/FeaturedJobItem.tsx @@ -1,7 +1,7 @@ -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import BuildingIcon from 'static/images/icons/FontAwesome/building_icon.svg'; -import CloudUploadIcon from 'static/images/icons/FontAwesome/cloud_upload_icon.svg'; -import MapMarkerIcon from 'static/images/icons/FontAwesome/map_marker_icon.svg'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import BuildingIcon from '@/public/static/images/icons/FontAwesome/building_icon.svg'; +import CloudUploadIcon from '@/public/static/images/icons/FontAwesome/cloud_upload_icon.svg'; +import MapMarkerIcon from '@/public/static/images/icons/FontAwesome/map_marker_icon.svg'; export interface FeaturedJobItemPropsType { /** diff --git a/components/FeaturedJobItem/__tests__/FeaturedJobItem.test.tsx b/components/FeaturedJobItem/__tests__/FeaturedJobItem.test.tsx index a7d5bd189..d572bb606 100644 --- a/components/FeaturedJobItem/__tests__/FeaturedJobItem.test.tsx +++ b/components/FeaturedJobItem/__tests__/FeaturedJobItem.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { FeaturedJobItem } from '../FeaturedJobItem'; describe('FeaturedJobItem', () => { diff --git a/components/Footer/Footer.tsx b/components/Footer/Footer.tsx index fbb24124c..8828e65f4 100644 --- a/components/Footer/Footer.tsx +++ b/components/Footer/Footer.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { SocialMedia } from 'components/SocialMedia/SocialMedia'; -import { footerItems } from 'common/constants/navigation'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { SocialMedia } from '@/components/SocialMedia/SocialMedia'; +import { footerItems } from '@/common/constants/navigation'; import Image from 'next/legacy/image'; import Logo from 'public/static/images/logo.svg'; diff --git a/components/Footer/__tests__/Footer.test.tsx b/components/Footer/__tests__/Footer.test.tsx index e1289e130..2cab91856 100644 --- a/components/Footer/__tests__/Footer.test.tsx +++ b/components/Footer/__tests__/Footer.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { Footer } from '../Footer'; diff --git a/components/Form/Checkbox/Checkbox.js b/components/Form/Checkbox/Checkbox.js index 89891ce18..a102b2404 100644 --- a/components/Form/Checkbox/Checkbox.js +++ b/components/Form/Checkbox/Checkbox.js @@ -1,10 +1,10 @@ import { shape, string, node, number, object, objectOf, oneOfType } from 'prop-types'; import classNames from 'classnames'; import { ErrorMessage } from 'formik'; -import { CHECKBOX, CHECKBOX_ERROR } from 'common/constants/testIDs'; -import { Alert } from 'components/Alert/Alert'; -import { Label } from 'components/Form/Label/Label'; import styles from './Checkbox.module.css'; +import { CHECKBOX, CHECKBOX_ERROR } from '@/common/constants/testIDs'; +import { Alert } from '@/components/Alert/Alert'; +import { Label } from '@/components/Form/Label/Label'; Checkbox.propTypes = { field: shape({ diff --git a/components/Form/Input/Input.js b/components/Form/Input/Input.js index 87a99c384..34de3ed4b 100644 --- a/components/Form/Input/Input.js +++ b/components/Form/Input/Input.js @@ -1,10 +1,10 @@ import { shape, string, number, object, objectOf, oneOfType, bool, oneOf } from 'prop-types'; import classNames from 'classnames'; import { ErrorMessage } from 'formik'; -import { INPUT, INPUT_ERROR, INPUT_FEEDBACK_GROUPING } from 'common/constants/testIDs'; -import { Alert } from 'components/Alert/Alert'; -import { Label } from 'components/Form/Label/Label'; import styles from './Input.module.css'; +import { INPUT, INPUT_ERROR, INPUT_FEEDBACK_GROUPING } from '@/common/constants/testIDs'; +import { Alert } from '@/components/Alert/Alert'; +import { Label } from '@/components/Form/Label/Label'; Input.propTypes = { className: string, diff --git a/components/Form/Input/__tests__/Input.test.js b/components/Form/Input/__tests__/Input.test.js index 534479446..cd81a308c 100644 --- a/components/Form/Input/__tests__/Input.test.js +++ b/components/Form/Input/__tests__/Input.test.js @@ -1,11 +1,10 @@ import { Formik, Field } from 'formik'; import { cleanup, fireEvent, render } from '@testing-library/react'; -import { INPUT, INPUT_ERROR, INPUT_FEEDBACK_GROUPING, LABEL } from 'common/constants/testIDs'; -import { validationErrorMessages } from 'common/constants/messages'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; - import { Form } from '../../Form'; import { Input } from '../Input'; +import { INPUT, INPUT_ERROR, INPUT_FEEDBACK_GROUPING, LABEL } from '@/common/constants/testIDs'; +import { validationErrorMessages } from '@/common/constants/messages'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; describe('Input', () => { const requiredProps = { diff --git a/components/Form/Label/Label.js b/components/Form/Label/Label.js index 8b30b8933..90ef30e54 100644 --- a/components/Form/Label/Label.js +++ b/components/Form/Label/Label.js @@ -1,7 +1,7 @@ import { node, string, bool } from 'prop-types'; import classNames from 'classnames'; -import { LABEL } from 'common/constants/testIDs'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { LABEL } from '@/common/constants/testIDs'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; Label.propTypes = { children: node.isRequired, diff --git a/components/Form/Label/__tests__/Label.test.js b/components/Form/Label/__tests__/Label.test.js index aea98a5a1..80b478aa4 100644 --- a/components/Form/Label/__tests__/Label.test.js +++ b/components/Form/Label/__tests__/Label.test.js @@ -1,9 +1,8 @@ /* eslint-disable jsx-a11y/label-has-associated-control */ import { render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { LABEL, SCREEN_READER_ONLY } from 'common/constants/testIDs'; - import { Label } from '../Label'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { LABEL, SCREEN_READER_ONLY } from '@/common/constants/testIDs'; describe('Label', () => { it('should render with required props', () => { diff --git a/components/Form/MultiStepForm.js b/components/Form/MultiStepForm.js index 076e823f2..0e5a2aab8 100644 --- a/components/Form/MultiStepForm.js +++ b/components/Form/MultiStepForm.js @@ -3,17 +3,17 @@ import { useState } from 'react'; import { arrayOf, func, object } from 'prop-types'; import noop from 'lodash/noop'; import { Formik } from 'formik'; -import { validStep } from 'common/constants/custom-props'; +import styles from './MultiStepForm.module.css'; +import { validStep } from '@/common/constants/custom-props'; import { MULTI_STEP_STEP_BUTTON, MULTI_STEP_SUBMIT_BUTTON, MULTI_STEP_PREVIOUS_BUTTON, -} from 'common/constants/testIDs'; -import { Button } from 'components/Buttons/Button/Button'; -import { Form } from 'components/Form/Form'; -import { Alert } from 'components/Alert/Alert'; -import { ProgressIndicator } from 'components/ProgressIndicator/ProgressIndicator'; -import styles from './MultiStepForm.module.css'; +} from '@/common/constants/testIDs'; +import { Button } from '@/components/Buttons/Button/Button'; +import { Form } from '@/components/Form/Form'; +import { Alert } from '@/components/Alert/Alert'; +import { ProgressIndicator } from '@/components/ProgressIndicator/ProgressIndicator'; MultiStepForm.propTypes = { // initialValues must be object where entire form's shape is described diff --git a/components/Form/Select/Select.js b/components/Form/Select/Select.js index 99545267d..3ae3e13a2 100644 --- a/components/Form/Select/Select.js +++ b/components/Form/Select/Select.js @@ -10,10 +10,10 @@ import { string, } from 'prop-types'; import { ErrorMessage } from 'formik'; -import { Alert } from 'components/Alert/Alert'; -import { Label } from 'components/Form/Label/Label'; import { ThemedReactSelect } from './ThemedReactSelect'; import styles from './Select.module.css'; +import { Alert } from '@/components/Alert/Alert'; +import { Label } from '@/components/Form/Label/Label'; Select.propTypes = { field: shape({ diff --git a/components/Form/Select/ThemedReactSelect.js b/components/Form/Select/ThemedReactSelect.js index 035fbb34c..42eeacd45 100644 --- a/components/Form/Select/ThemedReactSelect.js +++ b/components/Form/Select/ThemedReactSelect.js @@ -8,7 +8,7 @@ import { rgbValuesSecondary, successDeep, errorDeep, -} from 'common/styles/themeMap'; +} from '@/common/styles/themeMap'; ThemedReactSelect.propTypes = { disabled: bool, diff --git a/components/Form/Select/__tests__/Select.test.js b/components/Form/Select/__tests__/Select.test.js index a34d39cdc..c7b8de2d0 100644 --- a/components/Form/Select/__tests__/Select.test.js +++ b/components/Form/Select/__tests__/Select.test.js @@ -1,11 +1,11 @@ import { Formik, Field } from 'formik'; import { fireEvent, render, waitFor } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { KEY_CODES } from 'test-utils/identifiers'; - -import { LABEL } from 'common/constants/testIDs'; import { Form } from '../../Form'; import { Select } from '../Select'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { KEY_CODES } from '@/test-utils/identifiers'; + +import { LABEL } from '@/common/constants/testIDs'; const getReactSelect = domElement => domElement.querySelector('[id^=react-select]'); diff --git a/components/Form/Select/__tests__/ThemedReactSelect.test.js b/components/Form/Select/__tests__/ThemedReactSelect.test.js index 4aee709e1..9865ffba6 100644 --- a/components/Form/Select/__tests__/ThemedReactSelect.test.js +++ b/components/Form/Select/__tests__/ThemedReactSelect.test.js @@ -1,6 +1,5 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; - import { ThemedReactSelect } from '../ThemedReactSelect'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; describe('ThemedReactSelect', () => { it('should render with required props', () => { diff --git a/components/Form/__tests__/MultiStepForm.test.js b/components/Form/__tests__/MultiStepForm.test.js index 113b520d4..17b733bd5 100644 --- a/components/Form/__tests__/MultiStepForm.test.js +++ b/components/Form/__tests__/MultiStepForm.test.js @@ -7,13 +7,13 @@ import get from 'lodash/get'; import { fireEvent, render, waitFor, getByTestId } from '@testing-library/react'; import { Field } from 'formik'; import * as Yup from 'yup'; -import { networkErrorMessages } from 'common/constants/messages'; +import { MultiStepForm } from '../MultiStepForm'; +import { networkErrorMessages } from '@/common/constants/messages'; import { MULTI_STEP_SUBMIT_BUTTON, MULTI_STEP_STEP_BUTTON, MULTI_STEP_PREVIOUS_BUTTON, -} from 'common/constants/testIDs'; -import { MultiStepForm } from '../MultiStepForm'; +} from '@/common/constants/testIDs'; const submitForm = async ({ container, isFinalStep = false }) => { const button = await waitFor( diff --git a/components/Forms/ChangePasswordForm/ChangePasswordForm.js b/components/Forms/ChangePasswordForm/ChangePasswordForm.js index 8931cc173..d77445658 100644 --- a/components/Forms/ChangePasswordForm/ChangePasswordForm.js +++ b/components/Forms/ChangePasswordForm/ChangePasswordForm.js @@ -2,15 +2,15 @@ import { useState } from 'react'; import { string, func, shape } from 'prop-types'; import { Field, Formik } from 'formik'; import * as Yup from 'yup'; -import { CHANGE_PASSWORD_FORM_ERROR } from 'common/constants/testIDs'; -import { Button } from 'components/Buttons/Button/Button'; -import { Form } from 'components/Form/Form'; -import { Input } from 'components/Form/Input/Input'; -import { Alert } from 'components/Alert/Alert'; -import { validationErrorMessages } from 'common/constants/messages'; -import { getServerErrorMessage } from 'common/utils/api-utils'; -import { minimumPasswordLength } from 'common/constants/validations'; -import { hasRequiredCharacters } from 'common/utils/validator-utils'; +import { CHANGE_PASSWORD_FORM_ERROR } from '@/common/constants/testIDs'; +import { Button } from '@/components/Buttons/Button/Button'; +import { Form } from '@/components/Form/Form'; +import { Input } from '@/components/Form/Input/Input'; +import { Alert } from '@/components/Alert/Alert'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; +import { minimumPasswordLength } from '@/common/constants/validations'; +import { hasRequiredCharacters } from '@/common/utils/validator-utils'; const defaultValues = { newPassword1: '', diff --git a/components/Forms/ChangePasswordForm/__tests__/ChangePasswordForm.test.js b/components/Forms/ChangePasswordForm/__tests__/ChangePasswordForm.test.js index ff9db6859..f9cad896f 100644 --- a/components/Forms/ChangePasswordForm/__tests__/ChangePasswordForm.test.js +++ b/components/Forms/ChangePasswordForm/__tests__/ChangePasswordForm.test.js @@ -1,11 +1,11 @@ import { fireEvent, render, waitFor } from '@testing-library/react'; -import { passwordResetSubmit } from 'common/constants/api'; -import { validationErrorMessages } from 'common/constants/messages'; -import { BUTTON, INPUT_ERROR, CHANGE_PASSWORD_FORM_ERROR } from 'common/constants/testIDs'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import mockUser from 'test-utils/mockGenerators/mockUser'; import { ChangePasswordForm } from '../ChangePasswordForm'; +import { passwordResetSubmit } from '@/common/constants/api'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { BUTTON, INPUT_ERROR, CHANGE_PASSWORD_FORM_ERROR } from '@/common/constants/testIDs'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; +import mockUser from '@/test-utils/mockGenerators/mockUser'; beforeEach(() => { OperationCodeAPIMock.reset(); diff --git a/components/Forms/CreateResourceForm/CreateResourceForm.js b/components/Forms/CreateResourceForm/CreateResourceForm.js index 8121385de..ef37a7a24 100644 --- a/components/Forms/CreateResourceForm/CreateResourceForm.js +++ b/components/Forms/CreateResourceForm/CreateResourceForm.js @@ -5,13 +5,13 @@ import * as Yup from 'yup'; import { insertIf } from '@innocuous/functions'; import isEmpty from 'lodash/isEmpty'; import get from 'lodash/get'; -import { createResource } from 'common/constants/api'; -import { getServerErrorMessage } from 'common/utils/api-utils'; -import { validationErrorMessages } from 'common/constants/messages'; -import { Button } from 'components/Buttons/Button/Button'; -import { Form } from 'components/Form/Form'; -import { Input } from 'components/Form/Input/Input'; -import { Select } from 'components/Form/Select/Select'; +import { createResource } from '@/common/constants/api'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { Button } from '@/components/Buttons/Button/Button'; +import { Form } from '@/components/Form/Form'; +import { Input } from '@/components/Form/Input/Input'; +import { Select } from '@/components/Form/Select/Select'; // This exists only because we don't have a radio component and I wanna get this done quickly! // TODO: Make radio input component diff --git a/components/Forms/LoginForm/LoginForm.js b/components/Forms/LoginForm/LoginForm.js index b7ff84632..4793acebf 100644 --- a/components/Forms/LoginForm/LoginForm.js +++ b/components/Forms/LoginForm/LoginForm.js @@ -2,13 +2,13 @@ import { useState } from 'react'; import { func, shape, string } from 'prop-types'; import { Formik, Field } from 'formik'; import * as Yup from 'yup'; -import { getServerErrorMessage } from 'common/utils/api-utils'; -import { validationErrorMessages } from 'common/constants/messages'; -import { LOGIN_BUTTON, LOGIN_FORM } from 'common/constants/testIDs'; -import { Button } from 'components/Buttons/Button/Button'; -import { Form } from 'components/Form/Form'; -import { Input } from 'components/Form/Input/Input'; -import Alert from 'components/Alert/Alert'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { LOGIN_BUTTON, LOGIN_FORM } from '@/common/constants/testIDs'; +import { Button } from '@/components/Buttons/Button/Button'; +import { Form } from '@/components/Form/Form'; +import { Input } from '@/components/Form/Input/Input'; +import Alert from '@/components/Alert/Alert'; const defaultValues = { email: '', diff --git a/components/Forms/LoginForm/__tests__/LoginForm.test.js b/components/Forms/LoginForm/__tests__/LoginForm.test.js index fc05a805e..fb57c13ea 100644 --- a/components/Forms/LoginForm/__tests__/LoginForm.test.js +++ b/components/Forms/LoginForm/__tests__/LoginForm.test.js @@ -1,11 +1,11 @@ import faker from 'faker'; import { render, fireEvent, waitFor, screen } from '@testing-library/react'; -import { loginUser } from 'common/constants/api'; -import { networkErrorMessages, validationErrorMessages } from 'common/constants/messages'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import mockUser from 'test-utils/mockGenerators/mockUser'; import { LoginForm } from '../LoginForm'; +import { loginUser } from '@/common/constants/api'; +import { networkErrorMessages, validationErrorMessages } from '@/common/constants/messages'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; +import mockUser from '@/test-utils/mockGenerators/mockUser'; describe('LoginForm', () => { afterEach(() => { diff --git a/components/Forms/PasswordResetForm/PasswordResetForm.js b/components/Forms/PasswordResetForm/PasswordResetForm.js index ddd6cea7c..f5d0d6f85 100644 --- a/components/Forms/PasswordResetForm/PasswordResetForm.js +++ b/components/Forms/PasswordResetForm/PasswordResetForm.js @@ -2,12 +2,12 @@ import { useState } from 'react'; import { string, func, shape } from 'prop-types'; import { Field, Formik } from 'formik'; import * as Yup from 'yup'; -import { Button } from 'components/Buttons/Button/Button'; -import { Form } from 'components/Form/Form'; -import { Input } from 'components/Form/Input/Input'; -import { Alert } from 'components/Alert/Alert'; -import { validationErrorMessages } from 'common/constants/messages'; -import { getServerErrorMessage } from 'common/utils/api-utils'; +import { Button } from '@/components/Buttons/Button/Button'; +import { Form } from '@/components/Form/Form'; +import { Input } from '@/components/Form/Input/Input'; +import { Alert } from '@/components/Alert/Alert'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; const defaultValues = { email: '' }; diff --git a/components/Forms/PasswordResetForm/__tests__/PasswordResetForm.test.js b/components/Forms/PasswordResetForm/__tests__/PasswordResetForm.test.js index a9e015ed8..9013b1549 100644 --- a/components/Forms/PasswordResetForm/__tests__/PasswordResetForm.test.js +++ b/components/Forms/PasswordResetForm/__tests__/PasswordResetForm.test.js @@ -1,10 +1,10 @@ import { fireEvent, render, waitFor } from '@testing-library/react'; -import { passwordReset } from 'common/constants/api'; -import { validationErrorMessages } from 'common/constants/messages'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import mockUser from 'test-utils/mockGenerators/mockUser'; import { PasswordResetForm } from '../PasswordResetForm'; +import { passwordReset } from '@/common/constants/api'; +import { validationErrorMessages } from '@/common/constants/messages'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; +import mockUser from '@/test-utils/mockGenerators/mockUser'; afterEach(() => { OperationCodeAPIMock.reset(); diff --git a/components/Forms/RegistrationForm/RegistrationForm.js b/components/Forms/RegistrationForm/RegistrationForm.js index dc5c125ba..b7ec88d60 100644 --- a/components/Forms/RegistrationForm/RegistrationForm.js +++ b/components/Forms/RegistrationForm/RegistrationForm.js @@ -3,18 +3,18 @@ import { func, number, oneOfType, shape, string, boolean } from 'prop-types'; import { Formik, Field } from 'formik'; import * as Yup from 'yup'; import noop from 'lodash/noop'; -import { createUser } from 'common/constants/api'; -import { getServerErrorMessage } from 'common/utils/api-utils'; -import { validationErrorMessages } from 'common/constants/messages'; -import { capitalizeFirstLetter } from 'common/utils/string-utils'; -import { codeOfConduct, slackGuidelines } from 'common/constants/urls'; -import { Button } from 'components/Buttons/Button/Button'; -import { Checkbox } from 'components/Form/Checkbox/Checkbox'; -import { Form } from 'components/Form/Form'; -import { Input } from 'components/Form/Input/Input'; -import { Alert } from 'components/Alert/Alert'; import Link from 'next/link'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { createUser } from '@/common/constants/api'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { capitalizeFirstLetter } from '@/common/utils/string-utils'; +import { codeOfConduct, slackGuidelines } from '@/common/constants/urls'; +import { Button } from '@/components/Buttons/Button/Button'; +import { Checkbox } from '@/components/Form/Checkbox/Checkbox'; +import { Form } from '@/components/Form/Form'; +import { Input } from '@/components/Form/Input/Input'; +import { Alert } from '@/components/Alert/Alert'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; export const PASSWORD_FOR_EVERYBODY = 'nOnEeDfOrP@ssw0rd!'; diff --git a/components/Forms/RegistrationForm/__tests__/RegistrationForm.test.js b/components/Forms/RegistrationForm/__tests__/RegistrationForm.test.js index dcd13cb42..f604a0544 100644 --- a/components/Forms/RegistrationForm/__tests__/RegistrationForm.test.js +++ b/components/Forms/RegistrationForm/__tests__/RegistrationForm.test.js @@ -1,9 +1,9 @@ import { fireEvent, render, waitFor, screen } from '@testing-library/react'; -import { networkErrorMessages } from 'common/constants/messages'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import mockUser from 'test-utils/mockGenerators/mockUser'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import RegistrationForm from '../RegistrationForm'; +import { RegistrationForm } from '../RegistrationForm'; +import { networkErrorMessages } from '@/common/constants/messages'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import mockUser from '@/test-utils/mockGenerators/mockUser'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; beforeEach(() => { OperationCodeAPIMock.reset(); diff --git a/components/Forms/ResourceSearchForm/ResourceSearchForm.js b/components/Forms/ResourceSearchForm/ResourceSearchForm.js index 96b6bceb9..76f9f2ccb 100644 --- a/components/Forms/ResourceSearchForm/ResourceSearchForm.js +++ b/components/Forms/ResourceSearchForm/ResourceSearchForm.js @@ -2,15 +2,15 @@ import { Field, Formik } from 'formik'; import omit from 'lodash/omit'; import styles from 'styles/resources.module.css'; import { string, func, shape, array } from 'prop-types'; -import { Button } from 'components/Buttons/Button/Button'; -import { Form } from 'components/Form/Form'; -import { Input } from 'components/Form/Input/Input'; -import { Select } from 'components/Form/Select/Select'; +import { Button } from '@/components/Buttons/Button/Button'; +import { Form } from '@/components/Form/Form'; +import { Input } from '@/components/Form/Input/Input'; +import { Select } from '@/components/Form/Select/Select'; import { RESOURCE_SEARCH, RESOURCE_SEARCH_BUTTON, RESOURCE_RESET_BUTTON, -} from 'common/constants/testIDs'; +} from '@/common/constants/testIDs'; ResourceSearchForm.propTypes = { setIsLoading: func.isRequired, diff --git a/components/Forms/ResourceSearchForm/__tests__/ResourceSearchForm.test.js b/components/Forms/ResourceSearchForm/__tests__/ResourceSearchForm.test.js index a91182842..d1278e432 100644 --- a/components/Forms/ResourceSearchForm/__tests__/ResourceSearchForm.test.js +++ b/components/Forms/ResourceSearchForm/__tests__/ResourceSearchForm.test.js @@ -1,5 +1,5 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; import { ResourceSearchForm } from '../ResourceSearchForm'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; const mockFields = { languages: null, diff --git a/components/Forms/UpdateProfileForm/UpdateProfileForm.js b/components/Forms/UpdateProfileForm/UpdateProfileForm.js index af90a1b6c..40afb33cf 100644 --- a/components/Forms/UpdateProfileForm/UpdateProfileForm.js +++ b/components/Forms/UpdateProfileForm/UpdateProfileForm.js @@ -1,11 +1,11 @@ import { useState } from 'react'; import get from 'lodash/get'; import Router from 'next/router'; -import { getServerErrorMessage } from 'common/utils/api-utils'; import { array, objectOf, oneOfType, string, number, bool } from 'prop-types'; import { insertIf } from '@innocuous/functions'; -import { MultiStepForm } from 'components/Form/MultiStepForm'; import { ProfessionalDetails, MilitaryStatus, MilitaryDetails, Technology } from './steps'; +import { MultiStepForm } from '@/components/Form/MultiStepForm'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; UpdateProfileForm.propTypes = { // Not required to allow for diff props in testing diff --git a/components/Forms/UpdateProfileForm/__tests__/UpdateProfileForm.test.js b/components/Forms/UpdateProfileForm/__tests__/UpdateProfileForm.test.js index 709e75332..9649f4cb3 100644 --- a/components/Forms/UpdateProfileForm/__tests__/UpdateProfileForm.test.js +++ b/components/Forms/UpdateProfileForm/__tests__/UpdateProfileForm.test.js @@ -1,5 +1,5 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; import { UpdateProfileForm } from '../UpdateProfileForm'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; describe('UpdateProfileForm', () => { it('should render with required props', () => { diff --git a/components/Forms/UpdateProfileForm/steps/MilitaryDetails.js b/components/Forms/UpdateProfileForm/steps/MilitaryDetails.js index 80beff5ea..d6f90de49 100644 --- a/components/Forms/UpdateProfileForm/steps/MilitaryDetails.js +++ b/components/Forms/UpdateProfileForm/steps/MilitaryDetails.js @@ -1,11 +1,11 @@ import { bool } from 'prop-types'; import { Field } from 'formik'; import * as Yup from 'yup'; -import { updateUser } from 'common/constants/api'; -import { validationErrorMessages } from 'common/constants/messages'; -import { Input } from 'components/Form/Input/Input'; -import { Select } from 'components/Form/Select/Select'; import styles from './_steps.module.css'; +import { updateUser } from '@/common/constants/api'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { Input } from '@/components/Form/Input/Input'; +import { Select } from '@/components/Form/Select/Select'; MilitaryDetails.propTypes = { isSubmitting: bool, diff --git a/components/Forms/UpdateProfileForm/steps/MilitaryStatus.js b/components/Forms/UpdateProfileForm/steps/MilitaryStatus.js index 4aa6050aa..730577d5e 100644 --- a/components/Forms/UpdateProfileForm/steps/MilitaryStatus.js +++ b/components/Forms/UpdateProfileForm/steps/MilitaryStatus.js @@ -1,10 +1,10 @@ import { bool } from 'prop-types'; import { Field } from 'formik'; import * as Yup from 'yup'; -import { updateUser } from 'common/constants/api'; -import { validationErrorMessages } from 'common/constants/messages'; -import { Select } from 'components/Form/Select/Select'; import styles from './_steps.module.css'; +import { updateUser } from '@/common/constants/api'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { Select } from '@/components/Form/Select/Select'; MilitaryStatus.propTypes = { isSubmitting: bool, diff --git a/components/Forms/UpdateProfileForm/steps/ProfessionalDetails.js b/components/Forms/UpdateProfileForm/steps/ProfessionalDetails.js index 0910d276c..6aa94f70c 100644 --- a/components/Forms/UpdateProfileForm/steps/ProfessionalDetails.js +++ b/components/Forms/UpdateProfileForm/steps/ProfessionalDetails.js @@ -1,11 +1,11 @@ import { bool } from 'prop-types'; import { Field } from 'formik'; import * as Yup from 'yup'; -import { updateUser } from 'common/constants/api'; -import { validationErrorMessages } from 'common/constants/messages'; -import { Input } from 'components/Form/Input/Input'; -import { Select } from 'components/Form/Select/Select'; import styles from './_steps.module.css'; +import { updateUser } from '@/common/constants/api'; +import { validationErrorMessages } from '@/common/constants/messages'; +import { Input } from '@/components/Form/Input/Input'; +import { Select } from '@/components/Form/Select/Select'; ProfessionalDetails.propTypes = { isSubmitting: bool, diff --git a/components/Forms/UpdateProfileForm/steps/Technology.js b/components/Forms/UpdateProfileForm/steps/Technology.js index 788e0ed94..c49477a63 100644 --- a/components/Forms/UpdateProfileForm/steps/Technology.js +++ b/components/Forms/UpdateProfileForm/steps/Technology.js @@ -1,10 +1,10 @@ import { bool } from 'prop-types'; import { Field } from 'formik'; import * as Yup from 'yup'; -import { updateUser } from 'common/constants/api'; import { mapStringsToSelectOptions } from '@innocuous/functions'; -import { Select } from 'components/Form/Select/Select'; import styles from './_steps.module.css'; +import { updateUser } from '@/common/constants/api'; +import { Select } from '@/components/Form/Select/Select'; const programmingLanguages = [ 'JavaScript', diff --git a/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryDetails.test.js b/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryDetails.test.js index 38e2e2ead..9c9999760 100644 --- a/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryDetails.test.js +++ b/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryDetails.test.js @@ -1,11 +1,10 @@ import { Formik } from 'formik'; import { fireEvent, render, waitFor } from '@testing-library/react'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { KEY_CODES } from 'test-utils/identifiers'; -import { Form } from 'components/Form/Form'; - import { MilitaryDetails } from '../MilitaryDetails'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { KEY_CODES } from '@/test-utils/identifiers'; +import { Form } from '@/components/Form/Form'; describe('UpdateProfileForm/Steps/MilitaryDetails', () => { afterEach(() => { diff --git a/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryStatus.test.js b/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryStatus.test.js index 1c1327317..3b0f79702 100644 --- a/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryStatus.test.js +++ b/components/Forms/UpdateProfileForm/steps/__tests__/MilitaryStatus.test.js @@ -1,11 +1,10 @@ import { Formik } from 'formik'; import { fireEvent, render, waitFor } from '@testing-library/react'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { KEY_CODES } from 'test-utils/identifiers'; -import { Form } from 'components/Form/Form'; - import { MilitaryStatus } from '../MilitaryStatus'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { KEY_CODES } from '@/test-utils/identifiers'; +import { Form } from '@/components/Form/Form'; describe('UpdateProfileForm/Steps/MilitaryStatus', () => { afterEach(() => { diff --git a/components/Forms/UpdateProfileForm/steps/__tests__/ProfessionalDetails.test.js b/components/Forms/UpdateProfileForm/steps/__tests__/ProfessionalDetails.test.js index a67c5fa7b..039a3d78a 100644 --- a/components/Forms/UpdateProfileForm/steps/__tests__/ProfessionalDetails.test.js +++ b/components/Forms/UpdateProfileForm/steps/__tests__/ProfessionalDetails.test.js @@ -1,11 +1,10 @@ import { Formik } from 'formik'; import { fireEvent, render, waitFor } from '@testing-library/react'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { KEY_CODES } from 'test-utils/identifiers'; -import { Form } from 'components/Form/Form'; - import { ProfessionalDetails } from '../ProfessionalDetails'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { KEY_CODES } from '@/test-utils/identifiers'; +import { Form } from '@/components/Form/Form'; describe('UpdateProfileForm/Steps/ProfessionalDetails', () => { afterEach(() => { diff --git a/components/Forms/UpdateProfileForm/steps/__tests__/Technology.test.js b/components/Forms/UpdateProfileForm/steps/__tests__/Technology.test.js index 199f16380..00163d9b6 100644 --- a/components/Forms/UpdateProfileForm/steps/__tests__/Technology.test.js +++ b/components/Forms/UpdateProfileForm/steps/__tests__/Technology.test.js @@ -1,11 +1,11 @@ import { Formik } from 'formik'; import { fireEvent, render, waitFor } from '@testing-library/react'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { Form } from 'components/Form/Form'; - -import { KEY_CODES } from 'test-utils/identifiers'; import { Technology } from '../Technology'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { Form } from '@/components/Form/Form'; + +import { KEY_CODES } from '@/test-utils/identifiers'; describe('UpdateProfileForm/Steps/Technology', () => { afterEach(() => { diff --git a/components/Head.tsx b/components/Head.tsx index 63a7856ca..519c0f110 100644 --- a/components/Head.tsx +++ b/components/Head.tsx @@ -1,5 +1,5 @@ import NextHead from 'next/head'; -import { s3 } from 'common/constants/urls'; +import { s3 } from '@/common/constants/urls'; import { ReactNode } from 'react'; interface HeadProps { diff --git a/components/Heading/Heading.tsx b/components/Heading/Heading.tsx index bb6ee868b..87f60f692 100644 --- a/components/Heading/Heading.tsx +++ b/components/Heading/Heading.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import kebabCase from 'lodash/kebabCase'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; -import LinkIcon from 'static/images/icons/FontAwesome/link-solid.svg'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; +import LinkIcon from '@/public/static/images/icons/FontAwesome/link-solid.svg'; import styles from './Heading.module.css'; type HeadingLevelType = 1 | 2 | 3 | 4 | 5 | 6; diff --git a/components/Heading/__tests__/Heading.test.tsx b/components/Heading/__tests__/Heading.test.tsx index e31c66786..2b48f8110 100644 --- a/components/Heading/__tests__/Heading.test.tsx +++ b/components/Heading/__tests__/Heading.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { Heading } from '../Heading'; describe('Heading', () => { diff --git a/components/HeroBanner/HeroBanner.tsx b/components/HeroBanner/HeroBanner.tsx index 520e0e937..d802825d1 100644 --- a/components/HeroBanner/HeroBanner.tsx +++ b/components/HeroBanner/HeroBanner.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; -import { Container } from 'components/Container/Container'; -import { HERO_BANNER_H1 } from 'common/constants/testIDs'; +import { Container } from '@/components/Container/Container'; +import { HERO_BANNER_H1 } from '@/common/constants/testIDs'; export interface HeroBannerPropsType { /** diff --git a/components/HeroBanner/__tests__/HeroBanner.test.tsx b/components/HeroBanner/__tests__/HeroBanner.test.tsx index 63c663061..86127eed5 100644 --- a/components/HeroBanner/__tests__/HeroBanner.test.tsx +++ b/components/HeroBanner/__tests__/HeroBanner.test.tsx @@ -1,6 +1,6 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; -import { s3 } from 'common/constants/urls'; +import { s3 } from '@/common/constants/urls'; import { HeroBanner } from '../HeroBanner'; describe('HeroBanner', () => { diff --git a/components/Modal/Modal.tsx b/components/Modal/Modal.tsx index 05bee3293..24b637353 100644 --- a/components/Modal/Modal.tsx +++ b/components/Modal/Modal.tsx @@ -1,8 +1,8 @@ import classNames from 'classnames'; import * as Dialog from '@radix-ui/react-dialog'; -import { gtag } from 'common/utils/thirdParty/gtag'; -import { CloseButton } from 'components/Buttons/CloseButton/CloseButton'; -import { MODAL_CONTENT, MODAL_OVERLAY } from 'common/constants/testIDs'; +import { gtag } from '@/common/utils/thirdParty/gtag'; +import { CloseButton } from '@/components/Buttons/CloseButton/CloseButton'; +import { MODAL_CONTENT, MODAL_OVERLAY } from '@/common/constants/testIDs'; export interface ModalPropsType { /** diff --git a/components/Modal/__tests__/Modal.test.tsx b/components/Modal/__tests__/Modal.test.tsx index 2da43aa97..0701d64ee 100644 --- a/components/Modal/__tests__/Modal.test.tsx +++ b/components/Modal/__tests__/Modal.test.tsx @@ -1,5 +1,5 @@ import { cleanup, render } from '@testing-library/react'; -import { gtag } from 'common/utils/thirdParty/gtag'; +import { gtag } from '@/common/utils/thirdParty/gtag'; import { Modal } from '../Modal'; describe('Modal', () => { diff --git a/components/Nav/Nav.tsx b/components/Nav/Nav.tsx index 5fae20c42..6540023fb 100644 --- a/components/Nav/Nav.tsx +++ b/components/Nav/Nav.tsx @@ -4,14 +4,14 @@ import Router from 'next/router'; import classNames from 'classnames'; import Logo from 'public/static/images/logo.svg'; -import { desktopNavItems, mobileNavItems } from 'common/constants/navigation'; -import { NavMobile } from 'components/Nav/NavMobile/NavMobile'; +import { desktopNavItems, mobileNavItems } from '@/common/constants/navigation'; +import { NavMobile } from '@/components/Nav/NavMobile/NavMobile'; import dynamic from 'next/dynamic'; import UserLogo from '../../public/static/images/icons/FontAwesome/user.svg'; import styles from './Nav.module.css'; const NavListItem = dynamic( - () => import('components/Nav/NavListItem/NavListItem').then(module => module.NavListItem), + () => import('@/components/Nav/NavListItem/NavListItem').then(module => module.NavListItem), { ssr: false }, ); diff --git a/components/Nav/NavListItem/NavListItem.tsx b/components/Nav/NavListItem/NavListItem.tsx index d89bf460e..14ee135f6 100644 --- a/components/Nav/NavListItem/NavListItem.tsx +++ b/components/Nav/NavListItem/NavListItem.tsx @@ -1,8 +1,8 @@ import { useState } from 'react'; import classNames from 'classnames'; import Link from 'next/link'; -import PlusIcon from 'static/images/icons/plus.svg'; -import MinusIcon from 'static/images/icons/minus.svg'; +import PlusIcon from '@/public/static/images/icons/plus.svg'; +import MinusIcon from '@/public/static/images/icons/minus.svg'; import styles from './NavListItem.module.css'; interface SublinkType { diff --git a/components/Nav/NavListItem/__tests__/NavListItem.test.tsx b/components/Nav/NavListItem/__tests__/NavListItem.test.tsx index 623e7e4ac..2f92fd88c 100644 --- a/components/Nav/NavListItem/__tests__/NavListItem.test.tsx +++ b/components/Nav/NavListItem/__tests__/NavListItem.test.tsx @@ -1,6 +1,6 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { render, fireEvent } from '@testing-library/react'; -import { KEY_CODES } from 'test-utils/identifiers'; +import { KEY_CODES } from '@/test-utils/identifiers'; import { NavListItem } from '../NavListItem'; diff --git a/components/Nav/NavMobile/NavMobile.tsx b/components/Nav/NavMobile/NavMobile.tsx index ca6d16e49..d082ae5f2 100644 --- a/components/Nav/NavMobile/NavMobile.tsx +++ b/components/Nav/NavMobile/NavMobile.tsx @@ -1,9 +1,9 @@ import Link from 'next/link'; import classNames from 'classnames'; -import { s3 } from 'common/constants/urls'; -import HamburgerIcon from 'static/images/icons/hamburger.svg'; -import { CloseButton } from 'components/Buttons/CloseButton/CloseButton'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { s3 } from '@/common/constants/urls'; +import HamburgerIcon from '@/public/static/images/icons/hamburger.svg'; +import { CloseButton } from '@/components/Buttons/CloseButton/CloseButton'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; import Image from 'next/legacy/image'; import styles from './NavMobile.module.css'; diff --git a/components/Nav/NavMobile/__tests__/NavMobile.test.tsx b/components/Nav/NavMobile/__tests__/NavMobile.test.tsx index ba05b0703..af7552913 100644 --- a/components/Nav/NavMobile/__tests__/NavMobile.test.tsx +++ b/components/Nav/NavMobile/__tests__/NavMobile.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, render } from '@testing-library/react'; -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; -import { mobileNavItems } from 'common/constants/navigation'; -import { CLOSE_BUTTON } from 'common/constants/testIDs'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; +import { mobileNavItems } from '@/common/constants/navigation'; +import { CLOSE_BUTTON } from '@/common/constants/testIDs'; import { NavMobile } from '../NavMobile'; diff --git a/components/Nav/__tests__/Nav.test.tsx b/components/Nav/__tests__/Nav.test.tsx index c79eb0ecf..da38350a9 100644 --- a/components/Nav/__tests__/Nav.test.tsx +++ b/components/Nav/__tests__/Nav.test.tsx @@ -1,8 +1,8 @@ // @ts-expect-error import cookie from 'js-cookie'; import { fireEvent, render, screen } from '@testing-library/react'; -import { CLOSE_BUTTON } from 'common/constants/testIDs'; -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import { CLOSE_BUTTON } from '@/common/constants/testIDs'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { Nav } from '../Nav'; diff --git a/components/OutboundLink/OutboundLink.tsx b/components/OutboundLink/OutboundLink.tsx index 46978ef82..ca228d736 100644 --- a/components/OutboundLink/OutboundLink.tsx +++ b/components/OutboundLink/OutboundLink.tsx @@ -1,6 +1,6 @@ -import { gtag } from 'common/utils/thirdParty/gtag'; -import ExternalLinkIcon from 'static/images/icons/FontAwesome/external-link-square-alt-solid.svg'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { gtag } from '@/common/utils/thirdParty/gtag'; +import ExternalLinkIcon from '@/public/static/images/icons/FontAwesome/external-link-square-alt-solid.svg'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; import classNames from 'node_modules/classnames/index'; export interface OutboundLinkPropsType { diff --git a/components/OutboundLink/__tests__/OutboundLink.test.tsx b/components/OutboundLink/__tests__/OutboundLink.test.tsx index 9994fc776..1a6cd2476 100644 --- a/components/OutboundLink/__tests__/OutboundLink.test.tsx +++ b/components/OutboundLink/__tests__/OutboundLink.test.tsx @@ -1,5 +1,5 @@ import { render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { OutboundLink } from '../OutboundLink'; describe('OutboundLink', () => { diff --git a/components/Pagination/Pagination.tsx b/components/Pagination/Pagination.tsx index 203e94815..cf1a8c9a7 100644 --- a/components/Pagination/Pagination.tsx +++ b/components/Pagination/Pagination.tsx @@ -1,5 +1,5 @@ -import LeftAngleIcon from 'static/images/icons/FontAwesome/angle-left-solid.svg'; -import RightAngleIcon from 'static/images/icons/FontAwesome/angle-right-solid.svg'; +import LeftAngleIcon from '@/public/static/images/icons/FontAwesome/angle-left-solid.svg'; +import RightAngleIcon from '@/public/static/images/icons/FontAwesome/angle-right-solid.svg'; import { PREV_PAGE_BUTTON, NEXT_PAGE_BUTTON } from '../../common/constants/testIDs'; import { PaginationItem } from './PaginationItem/PaginationItem'; diff --git a/components/Pagination/PaginationItem/PaginationItem.tsx b/components/Pagination/PaginationItem/PaginationItem.tsx index 6609d394f..22f2d00c5 100644 --- a/components/Pagination/PaginationItem/PaginationItem.tsx +++ b/components/Pagination/PaginationItem/PaginationItem.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; import omit from 'lodash/omit'; import classNames from 'classnames'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; import styles from './PaginationItem.module.css'; export interface PaginationItemPropsType { diff --git a/components/Pagination/PaginationItem/__tests__/PaginationItem.test.tsx b/components/Pagination/PaginationItem/__tests__/PaginationItem.test.tsx index 9ec29d177..153ea65e9 100644 --- a/components/Pagination/PaginationItem/__tests__/PaginationItem.test.tsx +++ b/components/Pagination/PaginationItem/__tests__/PaginationItem.test.tsx @@ -1,5 +1,5 @@ import { cleanup, render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { PaginationItem } from '../PaginationItem'; diff --git a/components/Pagination/__tests__/Pagination.test.tsx b/components/Pagination/__tests__/Pagination.test.tsx index f7260f37e..3227d056f 100644 --- a/components/Pagination/__tests__/Pagination.test.tsx +++ b/components/Pagination/__tests__/Pagination.test.tsx @@ -1,5 +1,5 @@ import { cleanup, render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { Pagination, developmentErrors } from '../Pagination'; diff --git a/components/PartnerLogoLink/PartnerLogoLink.tsx b/components/PartnerLogoLink/PartnerLogoLink.tsx index ae1ddf278..3c8778932 100644 --- a/components/PartnerLogoLink/PartnerLogoLink.tsx +++ b/components/PartnerLogoLink/PartnerLogoLink.tsx @@ -1,5 +1,5 @@ import Image from 'next/legacy/image'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; type SizeType = 'small' | 'medium' | 'large'; diff --git a/components/PartnerLogoLink/__tests__/PartnerLogoLink.test.tsx b/components/PartnerLogoLink/__tests__/PartnerLogoLink.test.tsx index 670a1c56e..23971280a 100644 --- a/components/PartnerLogoLink/__tests__/PartnerLogoLink.test.tsx +++ b/components/PartnerLogoLink/__tests__/PartnerLogoLink.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { PartnerLogoLink } from '../PartnerLogoLink'; describe('PartnerLogoLink', () => { diff --git a/components/Press/PressLinks/PressLinks.tsx b/components/Press/PressLinks/PressLinks.tsx index bab728ef8..bdee68dfe 100644 --- a/components/Press/PressLinks/PressLinks.tsx +++ b/components/Press/PressLinks/PressLinks.tsx @@ -1,5 +1,5 @@ import * as Tabs from '@radix-ui/react-tabs'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; import { objectKeys } from 'utils/types'; import * as Articles from './Articles'; import styles from './PressLinks.module.css'; diff --git a/components/Press/PressLinks/__tests__/PressLinks.test.tsx b/components/Press/PressLinks/__tests__/PressLinks.test.tsx index 21b26ea22..5cb58b88e 100644 --- a/components/Press/PressLinks/__tests__/PressLinks.test.tsx +++ b/components/Press/PressLinks/__tests__/PressLinks.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { PressLinks } from '../PressLinks'; diff --git a/components/Press/PressPhotos/PressPhotos.tsx b/components/Press/PressPhotos/PressPhotos.tsx index f8a129220..18c8888eb 100644 --- a/components/Press/PressPhotos/PressPhotos.tsx +++ b/components/Press/PressPhotos/PressPhotos.tsx @@ -1,4 +1,4 @@ -import { s3 } from 'common/constants/urls'; +import { s3 } from '@/common/constants/urls'; import Image from 'next/legacy/image'; import styles from './PressPhotos.module.css'; diff --git a/components/Press/PressPhotos/__tests__/PressPhotos.test.tsx b/components/Press/PressPhotos/__tests__/PressPhotos.test.tsx index 64cdbbc1f..2e5c3fd4e 100644 --- a/components/Press/PressPhotos/__tests__/PressPhotos.test.tsx +++ b/components/Press/PressPhotos/__tests__/PressPhotos.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { PressPhotos } from '../PressPhotos'; diff --git a/components/Press/PressVideos/__tests__/PressVideos.test.tsx b/components/Press/PressVideos/__tests__/PressVideos.test.tsx index a121d7988..079c91f56 100644 --- a/components/Press/PressVideos/__tests__/PressVideos.test.tsx +++ b/components/Press/PressVideos/__tests__/PressVideos.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { PressVideos } from '../PressVideos'; diff --git a/components/ProgressIndicator/__tests__/ProgressIndicator.test.tsx b/components/ProgressIndicator/__tests__/ProgressIndicator.test.tsx index dd75478d1..ddf48770a 100644 --- a/components/ProgressIndicator/__tests__/ProgressIndicator.test.tsx +++ b/components/ProgressIndicator/__tests__/ProgressIndicator.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { ProgressIndicator, developmentErrors } from '../ProgressIndicator'; diff --git a/components/ReusableSections/DonateSection/DonateSection.tsx b/components/ReusableSections/DonateSection/DonateSection.tsx index 7ec8d9679..0df371b55 100644 --- a/components/ReusableSections/DonateSection/DonateSection.tsx +++ b/components/ReusableSections/DonateSection/DonateSection.tsx @@ -1,7 +1,7 @@ -import { s3 } from 'common/constants/urls'; -import { Container } from 'components/Container/Container'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; -import { Heading } from 'components/Heading/Heading'; +import { s3 } from '@/common/constants/urls'; +import { Container } from '@/components/Container/Container'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; +import { Heading } from '@/components/Heading/Heading'; export function DonateSection() { return ( diff --git a/components/ReusableSections/DonateSection/__tests__/DonateSection.test.tsx b/components/ReusableSections/DonateSection/__tests__/DonateSection.test.tsx index d8f438d06..a7cd2c926 100644 --- a/components/ReusableSections/DonateSection/__tests__/DonateSection.test.tsx +++ b/components/ReusableSections/DonateSection/__tests__/DonateSection.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { DonateSection } from '../DonateSection'; describe('DonateSection', () => { diff --git a/components/ReusableSections/JoinSection/JoinSection.tsx b/components/ReusableSections/JoinSection/JoinSection.tsx index 46e2cbe2e..7961cb90e 100644 --- a/components/ReusableSections/JoinSection/JoinSection.tsx +++ b/components/ReusableSections/JoinSection/JoinSection.tsx @@ -1,7 +1,7 @@ -import { Container } from 'components/Container/Container'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; -import { Heading } from 'components/Heading/Heading'; +import { Container } from '@/components/Container/Container'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; +import { Heading } from '@/components/Heading/Heading'; export function JoinSection() { return ( diff --git a/components/ReusableSections/JoinSection/__tests__/JoinSection.test.tsx b/components/ReusableSections/JoinSection/__tests__/JoinSection.test.tsx index 618161665..39744b9e4 100644 --- a/components/ReusableSections/JoinSection/__tests__/JoinSection.test.tsx +++ b/components/ReusableSections/JoinSection/__tests__/JoinSection.test.tsx @@ -1,5 +1,5 @@ import { render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { JoinSection } from '../JoinSection'; describe('JoinSection', () => { diff --git a/components/ReusableSections/SponsorsSection/SponsorsSection.tsx b/components/ReusableSections/SponsorsSection/SponsorsSection.tsx index 871b3a828..b59b32b7d 100644 --- a/components/ReusableSections/SponsorsSection/SponsorsSection.tsx +++ b/components/ReusableSections/SponsorsSection/SponsorsSection.tsx @@ -1,7 +1,7 @@ -import { Container } from 'components/Container/Container'; -import { Heading } from 'components/Heading/Heading'; -import { PartnerLogoLink } from 'components/PartnerLogoLink/PartnerLogoLink'; -import { PARTNER_TYPES, sortedPartners } from 'common/constants/partners'; +import { Container } from '@/components/Container/Container'; +import { Heading } from '@/components/Heading/Heading'; +import { PartnerLogoLink } from '@/components/PartnerLogoLink/PartnerLogoLink'; +import { PARTNER_TYPES, sortedPartners } from '@/common/constants/partners'; interface Partner { name: string; diff --git a/components/ReusableSections/SponsorsSection/__tests__/SponsorsSection.test.tsx b/components/ReusableSections/SponsorsSection/__tests__/SponsorsSection.test.tsx index a334bd708..b075cfe12 100644 --- a/components/ReusableSections/SponsorsSection/__tests__/SponsorsSection.test.tsx +++ b/components/ReusableSections/SponsorsSection/__tests__/SponsorsSection.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import { sortedPartners } from 'common/constants/partners'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { sortedPartners } from '@/common/constants/partners'; import { SponsorsSection } from '../SponsorsSection'; describe('SponsorsSection', () => { diff --git a/components/ScreenReaderOnly/ScreenReaderOnly.tsx b/components/ScreenReaderOnly/ScreenReaderOnly.tsx index d55d99dd2..a2d97ef2e 100644 --- a/components/ScreenReaderOnly/ScreenReaderOnly.tsx +++ b/components/ScreenReaderOnly/ScreenReaderOnly.tsx @@ -1,4 +1,4 @@ -import { SCREEN_READER_ONLY } from 'common/constants/testIDs'; +import { SCREEN_READER_ONLY } from '@/common/constants/testIDs'; export const toggleMessages = { open: 'Show more', diff --git a/components/ScreenReaderOnly/__tests__/ScreenReaderOnly.test.tsx b/components/ScreenReaderOnly/__tests__/ScreenReaderOnly.test.tsx index 054618c50..a5963b04b 100644 --- a/components/ScreenReaderOnly/__tests__/ScreenReaderOnly.test.tsx +++ b/components/ScreenReaderOnly/__tests__/ScreenReaderOnly.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { composeStory } from '@storybook/react'; import meta, { Default } from '../__stories__/ScreenReaderOnly.stories'; diff --git a/components/SocialLoginGroup/SocialLoginButtons.js b/components/SocialLoginGroup/SocialLoginButtons.js index 64f68c712..2567b78b9 100644 --- a/components/SocialLoginGroup/SocialLoginButtons.js +++ b/components/SocialLoginGroup/SocialLoginButtons.js @@ -2,8 +2,8 @@ import { func } from 'prop-types'; import classNames from 'classnames'; import GoogleLogin from 'react-google-login'; import FacebookLogin from 'react-facebook-login/dist/facebook-login-render-props'; -import { clientTokens } from 'common/config/environment'; import styles from './SocialLoginGroup.module.css'; +import { clientTokens } from '@/common/config/environment'; SocialLoginButtons.propTypes = { onSuccess: func.isRequired, diff --git a/components/SocialLoginGroup/SocialLoginGroup.js b/components/SocialLoginGroup/SocialLoginGroup.js index 7e40b1286..a79f1809a 100644 --- a/components/SocialLoginGroup/SocialLoginGroup.js +++ b/components/SocialLoginGroup/SocialLoginGroup.js @@ -1,9 +1,9 @@ import { useState } from 'react'; import { string, func } from 'prop-types'; import classNames from 'classnames'; -import { getServerErrorMessage } from 'common/utils/api-utils'; -import { Alert } from 'components/Alert/Alert'; import styles from './SocialLoginGroup.module.css'; +import { getServerErrorMessage } from '@/common/utils/api-utils'; +import { Alert } from '@/components/Alert/Alert'; SocialLoginGroup.propTypes = { className: string, diff --git a/components/SocialLoginGroup/__tests__/SocialLoginButtons.test.js b/components/SocialLoginGroup/__tests__/SocialLoginButtons.test.js index 597e77812..4171f57da 100644 --- a/components/SocialLoginGroup/__tests__/SocialLoginButtons.test.js +++ b/components/SocialLoginGroup/__tests__/SocialLoginButtons.test.js @@ -1,5 +1,5 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; import { SocialLoginButtons } from '../SocialLoginButtons'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; describe('SocialLoginButtons', () => { beforeEach(() => { diff --git a/components/SocialLoginGroup/__tests__/SocialLoginGroup.test.js b/components/SocialLoginGroup/__tests__/SocialLoginGroup.test.js index ac6060635..96d80432e 100644 --- a/components/SocialLoginGroup/__tests__/SocialLoginGroup.test.js +++ b/components/SocialLoginGroup/__tests__/SocialLoginGroup.test.js @@ -1,8 +1,8 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; import { render, act } from '@testing-library/react'; -import { loginSocial } from 'common/constants/api'; -import OperationCodeAPIMock from 'test-utils/mocks/apiMock'; import { SocialLoginGroup } from '../SocialLoginGroup'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import { loginSocial } from '@/common/constants/api'; +import OperationCodeAPIMock from '@/test-utils/mocks/apiMock'; describe('SocialLoginGroup', () => { const socialReturnToken = { accessToken: 'abc123' }; diff --git a/components/SocialMedia/SocialMedia.tsx b/components/SocialMedia/SocialMedia.tsx index 4f7206a73..2543cbee2 100644 --- a/components/SocialMedia/SocialMedia.tsx +++ b/components/SocialMedia/SocialMedia.tsx @@ -1,9 +1,9 @@ -import FacebookLogo from 'static/images/icons/facebook_logo.svg'; -import TwitterLogo from 'static/images/icons/twitter_logo.svg'; -import GitHubLogo from 'static/images/icons/github_logo_circle.svg'; -import InstagramLogo from 'static/images/icons/instagram_logo.svg'; -import YouTubeLogo from 'static/images/icons/youtube_logo.svg'; -import LinkedInLogo from 'static/images/icons/linkedin_logo_circle.svg'; +import FacebookLogo from '@/public/static/images/icons/facebook_logo.svg'; +import TwitterLogo from '@/public/static/images/icons/twitter_logo.svg'; +import GitHubLogo from '@/public/static/images/icons/github_logo_circle.svg'; +import InstagramLogo from '@/public/static/images/icons/instagram_logo.svg'; +import YouTubeLogo from '@/public/static/images/icons/youtube_logo.svg'; +import LinkedInLogo from '@/public/static/images/icons/linkedin_logo_circle.svg'; import { SocialMediaContainer } from './SocialMediaContainer/SocialMediaContainer'; import { SocialMediaItem } from './SocialMediaItem/SocialMediaItem'; diff --git a/components/SocialMedia/SocialMediaContainer/__tests__/SocialMediaContainer.test.tsx b/components/SocialMedia/SocialMediaContainer/__tests__/SocialMediaContainer.test.tsx index 239ad8fbf..b5c64b2bc 100644 --- a/components/SocialMedia/SocialMediaContainer/__tests__/SocialMediaContainer.test.tsx +++ b/components/SocialMedia/SocialMediaContainer/__tests__/SocialMediaContainer.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { SocialMediaContainer } from '../SocialMediaContainer'; diff --git a/components/SocialMedia/SocialMediaItem/SocialMediaItem.tsx b/components/SocialMedia/SocialMediaItem/SocialMediaItem.tsx index 8cc82e77a..a1208c5bd 100644 --- a/components/SocialMedia/SocialMediaItem/SocialMediaItem.tsx +++ b/components/SocialMedia/SocialMediaItem/SocialMediaItem.tsx @@ -1,5 +1,5 @@ -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; export interface SocialMediaItemPropsType { /** diff --git a/components/SocialMedia/SocialMediaItem/__tests__/SocialMediaItem.test.tsx b/components/SocialMedia/SocialMediaItem/__tests__/SocialMediaItem.test.tsx index 4bf699808..905cc380f 100644 --- a/components/SocialMedia/SocialMediaItem/__tests__/SocialMediaItem.test.tsx +++ b/components/SocialMedia/SocialMediaItem/__tests__/SocialMediaItem.test.tsx @@ -1,5 +1,5 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; -import FacebookLogo from 'static/images/icons/facebook_logo.svg'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; +import FacebookLogo from '@/public/static/images/icons/facebook_logo.svg'; import { SocialMediaItem } from '../SocialMediaItem'; describe('SocialMediaItem', () => { diff --git a/components/SocialMedia/__tests__/SocialMedia.test.tsx b/components/SocialMedia/__tests__/SocialMedia.test.tsx index 260932a1a..ef2860227 100644 --- a/components/SocialMedia/__tests__/SocialMedia.test.tsx +++ b/components/SocialMedia/__tests__/SocialMedia.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { SocialMedia } from '../SocialMedia'; diff --git a/components/SuccessStory/SuccessStory.tsx b/components/SuccessStory/SuccessStory.tsx index 1e25c4e5f..e3191dc77 100644 --- a/components/SuccessStory/SuccessStory.tsx +++ b/components/SuccessStory/SuccessStory.tsx @@ -1,4 +1,4 @@ -import { FlatCard } from 'components/Cards/FlatCard/FlatCard'; +import { FlatCard } from '@/components/Cards/FlatCard/FlatCard'; export interface SuccessStoryPropsType { /** diff --git a/components/SuccessStory/__tests__/SuccessStory.test.tsx b/components/SuccessStory/__tests__/SuccessStory.test.tsx index 71009250b..4ea0cfcc4 100644 --- a/components/SuccessStory/__tests__/SuccessStory.test.tsx +++ b/components/SuccessStory/__tests__/SuccessStory.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { SuccessStory } from '../SuccessStory'; describe('SuccessStory', () => { diff --git a/components/Timeline/TimelineEvent/__tests__/TimelineEvent.test.tsx b/components/Timeline/TimelineEvent/__tests__/TimelineEvent.test.tsx index be78abd20..d8b7c5174 100644 --- a/components/Timeline/TimelineEvent/__tests__/TimelineEvent.test.tsx +++ b/components/Timeline/TimelineEvent/__tests__/TimelineEvent.test.tsx @@ -1,4 +1,4 @@ -import createSnapshotTest from 'test-utils/createSnapshotTest'; +import createSnapshotTest from '@/test-utils/createSnapshotTest'; import { TimelineEvent } from '../TimelineEvent'; diff --git a/components/Timeline/TimelineNav/__tests__/TimelineNav.test.tsx b/components/Timeline/TimelineNav/__tests__/TimelineNav.test.tsx index 9be725e9d..aa680f79b 100644 --- a/components/Timeline/TimelineNav/__tests__/TimelineNav.test.tsx +++ b/components/Timeline/TimelineNav/__tests__/TimelineNav.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { TimelineNav } from '../TimelineNav'; describe('TimelineNav', () => { diff --git a/components/Timeline/__tests__/Timeline.test.tsx b/components/Timeline/__tests__/Timeline.test.tsx index 31568ec5d..b8d299fd5 100644 --- a/components/Timeline/__tests__/Timeline.test.tsx +++ b/components/Timeline/__tests__/Timeline.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { Timeline } from '../Timeline'; diff --git a/components/Timeline/historyData.js b/components/Timeline/historyData.js index 7748690d5..5efbfef77 100644 --- a/components/Timeline/historyData.js +++ b/components/Timeline/historyData.js @@ -1,4 +1,4 @@ -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; export const historyData = { 2011: [ diff --git a/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx b/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx index 37594740b..74a29ee2a 100644 --- a/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx +++ b/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx @@ -1,8 +1,8 @@ import noop from 'lodash/noop'; -import { Modal } from 'components/Modal/Modal'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import WarningSign from 'static/images/icons/FontAwesome/exclamation-triangle-solid.svg'; -import { s3 } from 'common/constants/urls'; +import { Modal } from '@/components/Modal/Modal'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import WarningSign from '@/public/static/images/icons/FontAwesome/exclamation-triangle-solid.svg'; +import { s3 } from '@/common/constants/urls'; import Image from 'next/legacy/image'; import styles from './UpgradeBrowserOverlay.module.css'; diff --git a/components/UpgradeBrowserOverlay/__tests__/UpgradeBrowserOverlay.test.tsx b/components/UpgradeBrowserOverlay/__tests__/UpgradeBrowserOverlay.test.tsx index 0cf47572e..1288308fa 100644 --- a/components/UpgradeBrowserOverlay/__tests__/UpgradeBrowserOverlay.test.tsx +++ b/components/UpgradeBrowserOverlay/__tests__/UpgradeBrowserOverlay.test.tsx @@ -1,4 +1,4 @@ -import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest'; +import createShallowSnapshotTest from '@/test-utils/createShallowSnapshotTest'; import { UpgradeBrowserOverlay } from '../UpgradeBrowserOverlay'; diff --git a/cypress/e2e/faq.spec.js b/cypress/e2e/faq.spec.js index 2ab934ddc..686a4cfb1 100644 --- a/cypress/e2e/faq.spec.js +++ b/cypress/e2e/faq.spec.js @@ -1,4 +1,4 @@ -import { ACCORDION_CONTENT, ACCORDION_TOGGLE_BUTTON } from 'common/constants/testIDs'; +import { ACCORDION_CONTENT, ACCORDION_TOGGLE_BUTTON } from '@/common/constants/testIDs'; describe('faq', () => { beforeEach(() => { diff --git a/cypress/e2e/hashlink.spec.js b/cypress/e2e/hashlink.spec.js index b2c90407e..3c600d58a 100644 --- a/cypress/e2e/hashlink.spec.js +++ b/cypress/e2e/hashlink.spec.js @@ -1,4 +1,4 @@ -import { HERO_BANNER_H1 } from 'common/constants/testIDs'; +import { HERO_BANNER_H1 } from '@/common/constants/testIDs'; describe('Hash Links', () => { const verifyHashLink = (title, path) => { diff --git a/cypress/e2e/join.spec.js b/cypress/e2e/join.spec.js index 00dfd9ee0..e4f5f51da 100644 --- a/cypress/e2e/join.spec.js +++ b/cypress/e2e/join.spec.js @@ -1,7 +1,7 @@ import jwt_decode from 'jwt-decode'; // eslint-disable-line camelcase -import { validationErrorMessages } from 'common/constants/messages'; -import existingUser from 'test-utils/mocks/existingUser'; -import mockUser from 'test-utils/mockGenerators/mockUser'; +import { validationErrorMessages } from '@/common/constants/messages'; +import existingUser from '@/test-utils/mocks/existingUser'; +import mockUser from '@/test-utils/mockGenerators/mockUser'; const validUser = mockUser(); const inputFields = { diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 7255cdc23..4d6ec7e68 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -7,6 +7,7 @@ // You can read more here: // https://on.cypress.io/plugins-guide // *********************************************************** +const path = require('path'); const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin'); const webpack = require('@cypress/webpack-preprocessor'); // This function is called when a project is opened or re-opened (e.g. due to @@ -28,7 +29,13 @@ module.exports = (on, config) => { on( 'file:preprocessor', webpack({ - webpackOptions: { resolve: { alias: require('../../pathAliases') } }, + webpackOptions: { + resolve: { + alias: { + '@/': path.resolve('./'), + }, + }, + }, watchOptions: {}, }), ); diff --git a/decorators/withAuthSync/withAuthSync.js b/decorators/withAuthSync/withAuthSync.js index b57cecf75..57575ba60 100644 --- a/decorators/withAuthSync/withAuthSync.js +++ b/decorators/withAuthSync/withAuthSync.js @@ -1,7 +1,7 @@ import { Component } from 'react'; import Router from 'next/router'; -import { authenticate } from 'common/utils/auth-utils'; -import getDisplayName from 'decorators/getDisplayName'; +import { authenticate } from '@/common/utils/auth-utils'; +import getDisplayName from '@/decorators/getDisplayName'; const withAuthSync = WrappedComponent => class extends Component { diff --git a/jsconfig.json b/jsconfig.json index 65ae901c1..ea4fb1116 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -6,16 +6,6 @@ "allowSyntheticDefaultImports": true, "experimentalDecorators": true, "baseUrl": ".", - "paths": { - // Ensure intellisense continues to operate - match with webpack aliases - "common/*": ["./common/*"], - "components/*": ["./components/*"], - "pages/*": ["./pages/*"], - "public/*": ["./public/*"], - "scripts/*": ["./scripts/*"], - "static/*": ["./public/static/*"], - "styles/*": ["./styles/*"], - "test-utils/*": ["./test-utils/*"] - } + "paths": { "@/*": ["./*"] } } } diff --git a/pages/404.tsx b/pages/404.tsx index 9a3512c7c..7cd61cfc8 100644 --- a/pages/404.tsx +++ b/pages/404.tsx @@ -1,4 +1,4 @@ -import { ErrorDisplay } from 'components/ErrorDisplay/ErrorDisplay'; +import { ErrorDisplay } from '@/components/ErrorDisplay/ErrorDisplay'; export default function Custom404() { return ; diff --git a/pages/_app.tsx b/pages/_app.tsx index 543813c20..b518e2db9 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -10,11 +10,11 @@ import hash from 'object-hash'; import LogRocket from 'logrocket'; import setupLogRocketReact from 'logrocket-react'; import ScrollUpButton from 'react-scroll-up-button'; -import { clientTokens } from 'common/config/environment'; -import { gtag } from 'common/utils/thirdParty/gtag'; -import { Nav } from 'components/Nav/Nav'; -import { Footer } from 'components/Footer/Footer'; -import 'common/styles/globals.css'; +import { clientTokens } from '@/common/config/environment'; +import { gtag } from '@/common/utils/thirdParty/gtag'; +import { Nav } from '@/components/Nav/Nav'; +import { Footer } from '@/components/Footer/Footer'; +import '@/common/styles/globals.css'; import { AppProps } from 'next/app'; import NextErrorComponent from 'next/error'; diff --git a/pages/_document.tsx b/pages/_document.tsx index cee32ee3c..a66acd507 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,5 +1,5 @@ import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'; -import { clientTokens } from 'common/config/environment'; +import { clientTokens } from '@/common/config/environment'; export default class MyDocument extends Document { static async getInitialProps(ctx: DocumentContext) { diff --git a/pages/_error.tsx b/pages/_error.tsx index 02250041f..d17caf2a2 100644 --- a/pages/_error.tsx +++ b/pages/_error.tsx @@ -1,6 +1,6 @@ import NextErrorComponent, { ErrorProps } from 'next/error'; import * as Sentry from '@sentry/nextjs'; -import { ErrorDisplay } from 'components/ErrorDisplay/ErrorDisplay'; +import { ErrorDisplay } from '@/components/ErrorDisplay/ErrorDisplay'; import { NextPageContext } from 'next'; interface CustomErrorProps extends ErrorProps { diff --git a/pages/about.tsx b/pages/about.tsx index a2ff885c3..553f8c7d2 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -1,11 +1,11 @@ import Link from 'next/link'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { ImageCard } from 'components/Cards/ImageCard/ImageCard'; -import { ValueCard } from 'components/Cards/ValueCard/ValueCard'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { s3 } from 'common/constants/urls'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { ImageCard } from '@/components/Cards/ImageCard/ImageCard'; +import { ValueCard } from '@/components/Cards/ValueCard/ValueCard'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { s3 } from '@/common/constants/urls'; import styles from 'styles/about.module.css'; const pageTitle = 'About Us'; diff --git a/pages/blog/index.tsx b/pages/blog/index.tsx index 064bcd165..4429afe87 100644 --- a/pages/blog/index.tsx +++ b/pages/blog/index.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react'; import { useRouter } from 'next/router'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; const pageTitle = 'Blog'; diff --git a/pages/branding.tsx b/pages/branding.tsx index ba3874bd6..d84742759 100644 --- a/pages/branding.tsx +++ b/pages/branding.tsx @@ -1,10 +1,10 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { LogoSection } from 'components/Branding/LogoSection/LogoSection'; -import { ColorSection } from 'components/Branding/ColorSection/ColorSection'; -import { FontSection } from 'components/Branding/FontSection/FontSection'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { s3 } from 'common/constants/urls'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { LogoSection } from '@/components/Branding/LogoSection/LogoSection'; +import { ColorSection } from '@/components/Branding/ColorSection/ColorSection'; +import { FontSection } from '@/components/Branding/FontSection/FontSection'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { s3 } from '@/common/constants/urls'; import styles from 'styles/branding.module.css'; const pageTitle = 'Branding Guide'; diff --git a/pages/challenge.tsx b/pages/challenge.tsx index d13511363..841480527 100644 --- a/pages/challenge.tsx +++ b/pages/challenge.tsx @@ -1,9 +1,9 @@ -import { s3 } from 'common/constants/urls'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import challengers from 'static/operationcode_challenge/names'; +import { s3 } from '@/common/constants/urls'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import challengers from '@/public/static/operationcode_challenge/names'; import range from 'lodash/range'; import styles from 'styles/challenge.module.css'; import Image from 'next/legacy/image'; diff --git a/pages/chapter_leader.tsx b/pages/chapter_leader.tsx index b8060e73f..186c0a262 100644 --- a/pages/chapter_leader.tsx +++ b/pages/chapter_leader.tsx @@ -1,8 +1,8 @@ import classNames from 'classnames'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; import styles from 'styles/chapter_leader.module.css'; const pageTitle = 'Chapter Leaders'; diff --git a/pages/chapters.tsx b/pages/chapters.tsx index ce522e22d..4c46f120d 100644 --- a/pages/chapters.tsx +++ b/pages/chapters.tsx @@ -1,8 +1,8 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { FlatCard } from 'components/Cards/FlatCard/FlatCard'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { FlatCard } from '@/components/Cards/FlatCard/FlatCard'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; const pageTitle = 'Chapters'; diff --git a/pages/confirm_email.tsx b/pages/confirm_email.tsx index 292291dd0..9ec107c3f 100644 --- a/pages/confirm_email.tsx +++ b/pages/confirm_email.tsx @@ -1,9 +1,9 @@ import { NextPageContext } from 'next'; import Link from 'next/link'; -import { confirmEmail } from 'common/constants/api'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; +import { confirmEmail } from '@/common/constants/api'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; import { Alert } from '../components/Alert/Alert'; ConfirmEmail.getInitialProps = async ({ query: { key } }: NextPageContext) => { diff --git a/pages/contact.tsx b/pages/contact.tsx index 37cfc085b..d88c40daf 100644 --- a/pages/contact.tsx +++ b/pages/contact.tsx @@ -1,8 +1,8 @@ import classNames from 'classnames'; import Link from 'next/link'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; import styles from 'styles/contact.module.css'; const pageTitle = 'Contact Us'; diff --git a/pages/corporate-training/index.tsx b/pages/corporate-training/index.tsx index 716e745f7..dd5756ff3 100644 --- a/pages/corporate-training/index.tsx +++ b/pages/corporate-training/index.tsx @@ -1,7 +1,7 @@ import Image from 'next/legacy/image'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; import { ReactNode } from 'react'; import classNames from 'classnames'; diff --git a/pages/donate.tsx b/pages/donate.tsx index 8bd9a094e..74c6e41a0 100644 --- a/pages/donate.tsx +++ b/pages/donate.tsx @@ -1,8 +1,8 @@ -import { Head } from 'components/Head'; -import { Container } from 'components/Container/Container'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; +import { Head } from '@/components/Head'; +import { Container } from '@/components/Container/Container'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; import styles from 'styles/donate.module.css'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; const pageTitle = 'Donate'; diff --git a/pages/faq.tsx b/pages/faq.tsx index 85a8efbd2..377af6bea 100644 --- a/pages/faq.tsx +++ b/pages/faq.tsx @@ -1,9 +1,9 @@ import Link from 'next/link'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { Accordion } from 'components/Accordion/Accordion'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { Accordion } from '@/components/Accordion/Accordion'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; import styles from 'styles/faq.module.css'; const questions = { diff --git a/pages/get_involved.tsx b/pages/get_involved.tsx index 33b68fcdd..5524d6b67 100644 --- a/pages/get_involved.tsx +++ b/pages/get_involved.tsx @@ -1,21 +1,21 @@ import classNames from 'classnames'; import TrackVisibility from 'react-on-screen'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Badge } from 'components/Badge/Badge'; -import { Content } from 'components/Content/Content'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Badge } from '@/components/Badge/Badge'; +import { Content } from '@/components/Content/Content'; import Link from 'next/link'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; -import { Heading } from 'components/Heading/Heading'; -import { DonateSection } from 'components/ReusableSections/DonateSection/DonateSection'; -import { JoinSection } from 'components/ReusableSections/JoinSection/JoinSection'; -import HighfivingIcon from 'static/images/icons/Custom/high_fiving.svg'; -import BullseyeIcon from 'static/images/icons/Custom/bullseye.svg'; -import ManHoldingKeyIcon from 'static/images/icons/Custom/man_holding_key.svg'; -import NetworkingIcon from 'static/images/icons/Custom/networked_people.svg'; -import ChartIcon from 'static/images/icons/Custom/chart.svg'; -import PeopleMeetingIcon from 'static/images/icons/Custom/people_meeting.svg'; -import { s3 } from 'common/constants/urls'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; +import { Heading } from '@/components/Heading/Heading'; +import { DonateSection } from '@/components/ReusableSections/DonateSection/DonateSection'; +import { JoinSection } from '@/components/ReusableSections/JoinSection/JoinSection'; +import HighfivingIcon from '@/public/static/images/icons/Custom/high_fiving.svg'; +import BullseyeIcon from '@/public/static/images/icons/Custom/bullseye.svg'; +import ManHoldingKeyIcon from '@/public/static/images/icons/Custom/man_holding_key.svg'; +import NetworkingIcon from '@/public/static/images/icons/Custom/networked_people.svg'; +import ChartIcon from '@/public/static/images/icons/Custom/chart.svg'; +import PeopleMeetingIcon from '@/public/static/images/icons/Custom/people_meeting.svg'; +import { s3 } from '@/common/constants/urls'; import styles from 'styles/get_involved.module.css'; import Image from 'next/legacy/image'; diff --git a/pages/history.tsx b/pages/history.tsx index 782d4466e..716a9ad92 100644 --- a/pages/history.tsx +++ b/pages/history.tsx @@ -1,9 +1,9 @@ -import { s3 } from 'common/constants/urls'; -import { Content } from 'components/Content/Content'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Timeline } from 'components/Timeline/Timeline'; -import { TimelineNav } from 'components/Timeline/TimelineNav/TimelineNav'; +import { s3 } from '@/common/constants/urls'; +import { Content } from '@/components/Content/Content'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Timeline } from '@/components/Timeline/Timeline'; +import { TimelineNav } from '@/components/Timeline/TimelineNav/TimelineNav'; import styles from 'styles/history.module.css'; const pageTitle = 'History'; diff --git a/pages/index.tsx b/pages/index.tsx index cb8a0caac..0752b2c5c 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,13 +1,13 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { JoinSection } from 'components/ReusableSections/JoinSection/JoinSection'; -import { SponsorsSection } from 'components/ReusableSections/SponsorsSection/SponsorsSection'; -import { SuccessStory } from 'components/SuccessStory/SuccessStory'; -import { Heading } from 'components/Heading/Heading'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; -import { successStories } from 'common/constants/successStories'; -import { s3 } from 'common/constants/urls'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { JoinSection } from '@/components/ReusableSections/JoinSection/JoinSection'; +import { SponsorsSection } from '@/components/ReusableSections/SponsorsSection/SponsorsSection'; +import { SuccessStory } from '@/components/SuccessStory/SuccessStory'; +import { Heading } from '@/components/Heading/Heading'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; +import { successStories } from '@/common/constants/successStories'; +import { s3 } from '@/common/constants/urls'; import styles from 'styles/index.module.css'; function Home() { diff --git a/pages/jobs.tsx b/pages/jobs.tsx index 41a527aa7..23e0c5e9a 100644 --- a/pages/jobs.tsx +++ b/pages/jobs.tsx @@ -1,9 +1,9 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import FeaturedJobsData from 'components/FeaturedJobItem/featuredJobs.json'; -import { FeaturedJobItem } from 'components/FeaturedJobItem/FeaturedJobItem'; -import { ZipRecruiterJobs } from 'components/ZipRecruiterJobs/ZipRecruiterJobs'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import FeaturedJobsData from '@/components/FeaturedJobItem/featuredJobs.json'; +import { FeaturedJobItem } from '@/components/FeaturedJobItem/FeaturedJobItem'; +import { ZipRecruiterJobs } from '@/components/ZipRecruiterJobs/ZipRecruiterJobs'; const pageTitle = 'Jobs'; diff --git a/pages/join/form.tsx b/pages/join/form.tsx index 8c05c237b..2d3e93ab5 100644 --- a/pages/join/form.tsx +++ b/pages/join/form.tsx @@ -1,11 +1,11 @@ import nextCookie from 'next-cookies'; import get from 'lodash/get'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { UpdateProfileForm } from 'components/Forms/UpdateProfileForm/UpdateProfileForm'; -import withAuthSync from 'decorators/withAuthSync/withAuthSync'; -import { getUserPromise } from 'common/constants/api'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { UpdateProfileForm } from '@/components/Forms/UpdateProfileForm/UpdateProfileForm'; +import withAuthSync from '@/decorators/withAuthSync/withAuthSync'; +import { getUserPromise } from '@/common/constants/api'; import { NextPage } from 'next'; const pageTitle = 'Update Profile'; diff --git a/pages/join/index.tsx b/pages/join/index.tsx index a9489d4a8..0c3616937 100644 --- a/pages/join/index.tsx +++ b/pages/join/index.tsx @@ -1,11 +1,11 @@ import { useEffect } from 'react'; import { useRouter } from 'next/router'; -import { gtag } from 'common/utils/thirdParty/gtag'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import RegistrationForm from 'components/Forms/RegistrationForm/RegistrationForm'; -import { login } from 'common/utils/auth-utils'; +import { gtag } from '@/common/utils/thirdParty/gtag'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import RegistrationForm from '@/components/Forms/RegistrationForm/RegistrationForm'; +import { login } from '@/common/utils/auth-utils'; const pageTitle = 'Join'; diff --git a/pages/join/success.tsx b/pages/join/success.tsx index 9d4b6c9e2..4466ffa6b 100644 --- a/pages/join/success.tsx +++ b/pages/join/success.tsx @@ -1,6 +1,6 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; const pageTitle = `Successful Registration!`; diff --git a/pages/podcast.tsx b/pages/podcast.tsx index e8aced699..b90557fa0 100644 --- a/pages/podcast.tsx +++ b/pages/podcast.tsx @@ -2,12 +2,12 @@ import axios from 'axios'; import get from 'lodash/get'; import dynamic from 'next/dynamic'; import { parse as parseXml } from 'fast-xml-parser'; -import { ONE_DAY } from 'common/constants/unitsOfTime'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Card } from 'components/Cards/Card/Card'; -import { Content } from 'components/Content/Content'; -import { Heading } from 'components/Heading/Heading'; +import { ONE_DAY } from '@/common/constants/unitsOfTime'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Card } from '@/components/Cards/Card/Card'; +import { Content } from '@/components/Content/Content'; +import { Heading } from '@/components/Heading/Heading'; import styles from 'styles/podcast.module.css'; import Image from 'next/legacy/image'; diff --git a/pages/policy.tsx b/pages/policy.tsx index dc04a89c6..c8335e99e 100644 --- a/pages/policy.tsx +++ b/pages/policy.tsx @@ -1,6 +1,6 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { s3 } from 'common/constants/urls'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { s3 } from '@/common/constants/urls'; import styles from 'styles/policy.module.css'; function Policy() { diff --git a/pages/press.tsx b/pages/press.tsx index 25c74ceb4..d17228400 100644 --- a/pages/press.tsx +++ b/pages/press.tsx @@ -1,8 +1,8 @@ import Link from 'next/link'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { Videos, Photos, Links } from 'components/Press'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { Videos, Photos, Links } from '@/components/Press'; import styles from 'styles/press.module.css'; const pageTitle = 'Press'; diff --git a/pages/project_rebuild.tsx b/pages/project_rebuild.tsx index e7d8131d4..dda888baa 100644 --- a/pages/project_rebuild.tsx +++ b/pages/project_rebuild.tsx @@ -1,11 +1,11 @@ import Image from 'next/legacy/image'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; import styles from 'styles/project_rebuild.module.css'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; -import { s3 } from 'common/constants/urls'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; +import { s3 } from '@/common/constants/urls'; const pageTitle = 'Project Rebuild'; diff --git a/pages/scholarship/code_platoon.tsx b/pages/scholarship/code_platoon.tsx index 14d606c96..3460f4fa2 100644 --- a/pages/scholarship/code_platoon.tsx +++ b/pages/scholarship/code_platoon.tsx @@ -1,6 +1,6 @@ -import { Head } from 'components/Head'; -import { Container } from 'components/Container/Container'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; +import { Head } from '@/components/Head'; +import { Container } from '@/components/Container/Container'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; import { useEffect } from 'react'; const pageTitle = 'Code Platoon X Operation Code Bootcamp Scholarship'; diff --git a/pages/scholarship/index.tsx b/pages/scholarship/index.tsx index 860917cee..543c1d3bf 100644 --- a/pages/scholarship/index.tsx +++ b/pages/scholarship/index.tsx @@ -1,10 +1,10 @@ -import { Head } from 'components/Head'; -import { Container } from 'components/Container/Container'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { s3 } from 'common/constants/urls'; +import { Head } from '@/components/Head'; +import { Container } from '@/components/Container/Container'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { s3 } from '@/common/constants/urls'; import Link from 'next/link'; -import { Card } from 'components/Cards/Card/Card'; +import { Card } from '@/components/Cards/Card/Card'; import Image from 'next/legacy/image'; const pageTitle = 'Scholarships Program'; diff --git a/pages/services.tsx b/pages/services.tsx index 7457dba77..3def33d69 100644 --- a/pages/services.tsx +++ b/pages/services.tsx @@ -1,17 +1,17 @@ import TrackVisibility from 'react-on-screen'; import classNames from 'classnames'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Badge } from 'components/Badge/Badge'; -import { Content } from 'components/Content/Content'; -import { ImageCard } from 'components/Cards/ImageCard/ImageCard'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { JoinSection } from 'components/ReusableSections/JoinSection/JoinSection'; -import CareerServicesIcon from 'static/images/icons/Custom/career_services.svg'; -import MentorshipIcon from 'static/images/icons/Custom/mentorship.svg'; -import ScholarshipsIcon from 'static/images/icons/Custom/scholarships.svg'; -import { s3 } from 'common/constants/urls'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Badge } from '@/components/Badge/Badge'; +import { Content } from '@/components/Content/Content'; +import { ImageCard } from '@/components/Cards/ImageCard/ImageCard'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { JoinSection } from '@/components/ReusableSections/JoinSection/JoinSection'; +import CareerServicesIcon from '@/public/static/images/icons/Custom/career_services.svg'; +import MentorshipIcon from '@/public/static/images/icons/Custom/mentorship.svg'; +import ScholarshipsIcon from '@/public/static/images/icons/Custom/scholarships.svg'; +import { s3 } from '@/common/constants/urls'; import styles from 'styles/services.module.css'; const VISIBILITY_OFFSET = 400; diff --git a/pages/slack_guide.tsx b/pages/slack_guide.tsx index 8a6faa4d9..8351f1bff 100644 --- a/pages/slack_guide.tsx +++ b/pages/slack_guide.tsx @@ -1,10 +1,10 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { Accordion } from 'components/Accordion/Accordion'; -import { OutboundLink } from 'components/OutboundLink/OutboundLink'; -import { s3, codeOfConduct } from 'common/constants/urls'; -import { ScreenReaderOnly } from 'components/ScreenReaderOnly/ScreenReaderOnly'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { Accordion } from '@/components/Accordion/Accordion'; +import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { s3, codeOfConduct } from '@/common/constants/urls'; +import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; import styles from 'styles/slack_guide.module.css'; import Image from 'next/legacy/image'; diff --git a/pages/sponsorship.tsx b/pages/sponsorship.tsx index a79135311..bb968f728 100644 --- a/pages/sponsorship.tsx +++ b/pages/sponsorship.tsx @@ -1,12 +1,12 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; -import { Badge } from 'components/Badge/Badge'; -import { Card } from 'components/Cards/Card/Card'; -import { FlatCard } from 'components/Cards/FlatCard/FlatCard'; -import { LinkButton } from 'components/Buttons/LinkButton/LinkButton'; -import { SponsorsSection } from 'components/ReusableSections/SponsorsSection/SponsorsSection'; -import MedalSolid from 'static/images/icons/FontAwesome/medal-solid.svg'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; +import { Badge } from '@/components/Badge/Badge'; +import { Card } from '@/components/Cards/Card/Card'; +import { FlatCard } from '@/components/Cards/FlatCard/FlatCard'; +import { LinkButton } from '@/components/Buttons/LinkButton/LinkButton'; +import { SponsorsSection } from '@/components/ReusableSections/SponsorsSection/SponsorsSection'; +import MedalSolid from '@/public/static/images/icons/FontAwesome/medal-solid.svg'; import styles from 'styles/sponsorship.module.css'; const pageTitle = 'Corporate Sponsorship'; diff --git a/pages/team.tsx b/pages/team.tsx index 4c32a6b40..103901beb 100644 --- a/pages/team.tsx +++ b/pages/team.tsx @@ -1,8 +1,8 @@ -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { s3 } from 'common/constants/urls'; -import { Content } from 'components/Content/Content'; -import { FlatCard } from 'components/Cards/FlatCard/FlatCard'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { s3 } from '@/common/constants/urls'; +import { Content } from '@/components/Content/Content'; +import { FlatCard } from '@/components/Cards/FlatCard/FlatCard'; import styles from 'styles/team.module.css'; const boardMembers = [ diff --git a/pages/terms.tsx b/pages/terms.tsx index 3eda05227..4db3d43ad 100644 --- a/pages/terms.tsx +++ b/pages/terms.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { Content } from 'components/Content/Content'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { Content } from '@/components/Content/Content'; function Terms() { return ( diff --git a/pages/thank_you.tsx b/pages/thank_you.tsx index 9ea08f3ca..4f5318b80 100644 --- a/pages/thank_you.tsx +++ b/pages/thank_you.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react'; -import { Head } from 'components/Head'; -import { HeroBanner } from 'components/HeroBanner/HeroBanner'; -import { gtag } from 'common/utils/thirdParty/gtag'; +import { Head } from '@/components/Head'; +import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; +import { gtag } from '@/common/utils/thirdParty/gtag'; import styles from 'styles/thank_you.module.css'; const pageTitle = 'Thank You'; diff --git a/pathAliases.js b/pathAliases.js deleted file mode 100644 index 7b9c8b189..000000000 --- a/pathAliases.js +++ /dev/null @@ -1,11 +0,0 @@ -const path = require('path'); - -module.exports = { - common: path.resolve('./common'), - components: path.resolve('./components'), - pages: path.resolve('./pages'), - public: path.resolve('./public'), - scripts: path.resolve('./scripts'), - static: path.resolve('./public/static'), - 'test-utils': path.resolve('./test-utils'), -}; diff --git a/scripts/createComponent/createComponent.js b/scripts/createComponent/createComponent.js index fba75bffc..e3dcde01a 100644 --- a/scripts/createComponent/createComponent.js +++ b/scripts/createComponent/createComponent.js @@ -3,7 +3,7 @@ const fs = require('fs'); const { buildJS, buildCss, buildStoryJs, buildTestJs } = require('./builders'); const replacementString = 'Component'; -const componentPath = 'components/'; +const componentPath = '@/components/'; const componentStruct = { root: { diff --git a/scripts/createPage/builders.js b/scripts/createPage/builders.js index 58299c911..c33e84880 100644 --- a/scripts/createPage/builders.js +++ b/scripts/createPage/builders.js @@ -8,8 +8,8 @@ const builder = { buildJS: pageTitle => { const componentName = pascalCase(pageTitle); - return `import {Head} from 'components/head';; - import { HeroBanner } from 'components/HeroBanner/HeroBanner'; + return `import {Head} from '@/components/head';; + import { HeroBanner } from '@/components/HeroBanner/HeroBanner'; // customize styles by creating and importing a stylesheet in the ~/styles folder const pageTitle = '${pageTitle}'; diff --git a/test-utils/jest-next-image.js b/test-utils/jest-next-image.js deleted file mode 100644 index 8e740aafc..000000000 --- a/test-utils/jest-next-image.js +++ /dev/null @@ -1,12 +0,0 @@ -const { s3hostName } = require('../common/constants/urls'); - -process.env = { - ...process.env, - __NEXT_IMAGE_OPTS: { - deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], - imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], - domains: [s3hostName, 'user-images.githubusercontent.com'], - path: '/', - loader: 'default', - }, -}; diff --git a/test-utils/mocks/apiMock.js b/test-utils/mocks/apiMock.js index 13c0375a1..e46d6872c 100644 --- a/test-utils/mocks/apiMock.js +++ b/test-utils/mocks/apiMock.js @@ -1,5 +1,5 @@ import MockAdapter from 'axios-mock-adapter'; -import { OperationCodeAPI } from 'common/utils/api-utils'; +import { OperationCodeAPI } from '@/common/utils/api-utils'; const OperationCodeAPIMock = new MockAdapter(OperationCodeAPI); diff --git a/tsconfig.json b/tsconfig.json index d0c1e6370..bf04a0893 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "baseUrl": "./", "target": "esnext", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, @@ -24,16 +23,7 @@ "jsxFragmentFactory": "React.Fragment", "noEmit": true, "noEmitOnError": true, - "paths": { - "common/*": ["./common/*"], - "components/*": ["./components/*"], - "pages/*": ["./pages/*"], - "public/*": ["./public/*"], - "scripts/*": ["./scripts/*"], - "static/*": ["./public/static/*"], - "styles/*": ["./styles/*"], - "test-utils/*": ["./test-utils/*"] - }, + "paths": { "@/*": ["./*"] }, "types": ["vitest/globals", "@testing-library/jest-dom"] }, "include": ["next-env.d.ts", "**/*.js", "**/*.ts", "**/*.tsx", "vitest.config.mts"], diff --git a/vitest.config.mts b/vitest.config.mts index 6c9a8f58a..e1d239ff2 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -30,9 +30,9 @@ export default defineConfig({ coverage: { reportsDirectory: './vitest-coverage', include: [ - 'common/**/*.{js,ts,tsx}', - 'components/**/*.{js,ts,tsx}', - 'decorators/**/*.{js,ts,tsx}', + '@/common/**/*.{js,ts,tsx}', + '@/components/**/*.{js,ts,tsx}', + '@/decorators/**/*.{js,ts,tsx}', ], exclude: [ // Irrelevant configs and local-only scripts @@ -45,8 +45,8 @@ export default defineConfig({ '{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', 'vitest.{workspace,projects}.[jt]s?(on)', '.{eslint,mocha,prettier}rc.{?(c|m)js,yml}', - 'scripts/**', - 'test-utils/**', + '@/scripts/**', + '@/test-utils/**', // Folders covered by integration tests 'node_modules/**', diff --git a/vitest.setup.tsx b/vitest.setup.tsx index e237f8fea..66984e80f 100644 --- a/vitest.setup.tsx +++ b/vitest.setup.tsx @@ -8,7 +8,7 @@ const LegacyMockedNextImage = ({ src, alt, ...props }: ImageProps) => ( /* MOCKS */ vi.mock('next/legacy/image', () => ({ default: LegacyMockedNextImage })); -vi.importMock('common/utils/thirdParty/gtag'); +vi.importMock('@/common/utils/thirdParty/gtag'); beforeAll(async () => { const IntersectionObserverMock = vi.fn(() => ({