From efbffe0d70b3150bbcb9335ce5afa7f6b84d1bc8 Mon Sep 17 00:00:00 2001 From: frosso Date: Wed, 2 Jul 2025 17:03:32 +0200 Subject: [PATCH] update: ensure prefix in Webpack include path --- ...e-webpack-include-path-ensure-wcpay-prefix | 4 +++ client/capital/index.tsx | 14 +++++----- client/capital/test/index.test.tsx | 2 +- client/card-readers/index.tsx | 2 +- client/cart/blocks/product-details.js | 2 +- client/checkout/blocks/index.js | 2 +- client/checkout/preview.js | 2 +- client/checkout/upe-styles/test/index.js | 2 +- .../woopay/direct-checkout/test/index.test.js | 2 +- client/checkout/woopay/email-input-iframe.js | 2 +- .../express-button/express-checkout-iframe.js | 2 +- .../checkout/woopay/express-button/index.js | 2 +- .../test/express-checkout-iframe.test.js | 4 +-- .../woopay/express-button/test/index.test.js | 6 ++--- .../woopay-express-checkout-button.test.js | 4 +-- .../account-balances/balance-block.tsx | 2 +- .../account-balances/balance-tooltip.tsx | 4 +-- .../account-fees/expiration-bar.js | 2 +- .../account-status/account-fees/index.js | 2 +- .../account-status/account-fees/test/index.js | 2 +- client/components/account-status/index.js | 4 +-- .../components/account-status/status-chip.js | 2 +- .../components/active-loan-summary/index.tsx | 2 +- .../components/deposit-status-chip/index.tsx | 2 +- .../deposits-overview/deposit-notices.tsx | 2 +- .../deposits-overview/deposit-schedule.tsx | 2 +- client/components/deposits-overview/index.tsx | 2 +- .../recent-deposits-list.tsx | 4 +-- client/components/deposits-status/index.tsx | 2 +- .../disputed-order-notice/test/index.test.js | 2 +- client/components/file-upload/test/index.tsx | 2 +- client/components/payments-status/index.tsx | 2 +- .../modal/index.tsx | 4 +-- .../modal/test/index.test.tsx | 2 +- client/components/test-mode-notice/index.tsx | 2 +- .../test-mode-notice/test/index.tsx | 6 ++--- client/components/tip-box/index.tsx | 2 +- .../transaction-status-pill/mappings.ts | 2 +- client/components/welcome/index.tsx | 2 +- client/components/welcome/test/index.test.tsx | 2 +- client/components/woopay/index.tsx | 2 +- .../save-user/checkout-page-save-user.js | 4 +-- .../test/checkout-page-save-user.test.js | 4 +-- client/components/woopay/test/index.test.js | 2 +- client/connect-account-page/incentive.tsx | 2 +- client/connect-account-page/index.tsx | 8 +++--- .../info-notice-modal.tsx | 2 +- .../connect-account-page/modal/test/index.js | 2 +- client/data/authorizations/reducer.ts | 2 +- client/data/authorizations/selectors.ts | 2 +- .../data/authorizations/test/reducer.test.ts | 2 +- .../authorizations/test/selectors.test.ts | 2 +- client/data/deposits/reducer.js | 2 +- client/data/deposits/selectors.js | 2 +- client/data/deposits/test/reducer.js | 2 +- client/data/deposits/test/selectors.js | 2 +- client/data/disputes/reducer.js | 2 +- client/data/disputes/selectors.js | 2 +- client/data/disputes/test/reducer.js | 2 +- client/data/disputes/test/selectors.js | 2 +- client/data/documents/reducer.js | 2 +- client/data/documents/selectors.js | 2 +- client/data/documents/test/reducer.js | 2 +- client/data/documents/test/selectors.js | 2 +- client/data/transactions/reducer.js | 2 +- client/data/transactions/selectors.js | 2 +- client/data/transactions/test/reducer.js | 2 +- client/data/transactions/test/selectors.js | 2 +- client/deposits/details/index.tsx | 14 +++++----- client/deposits/filters/config.js | 2 +- client/deposits/index.tsx | 11 ++++---- client/deposits/list/index.tsx | 10 +++---- client/disputes/evidence/index.js | 15 ++++++----- client/disputes/index.tsx | 20 +++++++------- client/disputes/info/index.tsx | 6 ++--- client/disputes/new-evidence/index.tsx | 18 ++++++------- .../redirect-to-transaction-details/index.tsx | 4 +-- client/disputes/test/index.tsx | 4 +-- client/documents/index.tsx | 4 +-- client/documents/list/index.tsx | 2 +- client/documents/list/test/index.tsx | 6 ++--- .../components/express-checkout-preview.js | 2 +- client/index.js | 4 +-- .../test/index.test.tsx | 2 +- client/onboarding/form.tsx | 8 +++--- client/onboarding/index.tsx | 4 +-- client/onboarding/kyc/index.tsx | 2 +- client/onboarding/step.tsx | 2 +- client/onboarding/steps/business-details.tsx | 2 +- client/onboarding/steps/loading.tsx | 2 +- client/onboarding/steps/test/loading.tsx | 2 +- client/onboarding/test/form.tsx | 2 +- client/onboarding/tracking.ts | 2 +- client/onboarding/utils.ts | 4 +-- client/order/index.js | 2 +- .../order-status-change-strategies/index.tsx | 2 +- client/overview/inbox-notifications/index.js | 2 +- .../inbox-notifications/test/index.js | 4 +-- client/overview/index.js | 20 +++++++------- .../connection-success/test/index.test.tsx | 2 +- .../index.tsx | 2 +- .../test/index.test.tsx | 2 +- .../dispute-awaiting-response-details.tsx | 2 +- .../dispute-details/dispute-notice.tsx | 2 +- .../dispute-details/dispute-steps.tsx | 2 +- .../order-details/test/index.test.tsx | 2 +- .../payment-details/payment-method/detail.js | 2 +- .../payment-details/payment-method/index.js | 2 +- client/payment-details/readers/index.js | 6 ++--- client/payment-details/summary/index.tsx | 27 ++++++++++--------- client/payment-details/timeline/index.js | 2 +- client/payment-details/timeline/map-events.js | 2 +- .../transaction-breakdown/index.tsx | 2 +- client/settings/deposits/index.js | 4 +-- .../__tests__/index.test.js | 2 +- .../payment-request-settings.test.js | 2 +- ...general-payment-request-button-settings.js | 2 +- .../payment-request-button-preview.js | 2 +- .../advanced-settings/rule-card-notice.tsx | 2 +- .../fp-help-text/test/index.test.tsx | 2 +- .../test/index.test.tsx | 2 +- .../components/protection-levels/index.tsx | 4 +-- .../protection-levels/test/index.test.tsx | 2 +- .../payment-methods-list/payment-method.tsx | 2 +- .../transactions/manual-capture-control.tsx | 2 +- client/transactions/autocompleter.tsx | 2 +- client/transactions/blocked/index.tsx | 2 +- .../fraud-protection/autocompleter.tsx | 2 +- client/transactions/index.tsx | 4 +-- client/transactions/list/deposit.tsx | 4 +-- client/transactions/list/test/index.tsx | 6 ++--- client/transactions/risk-review/columns.tsx | 4 +-- client/transactions/risk-review/index.tsx | 2 +- client/transactions/test/index.tsx | 4 +-- client/transactions/uncaptured/index.tsx | 8 +++--- .../uncaptured/test/index.test.tsx | 4 +-- client/utils/account-fees.tsx | 2 +- client/utils/fees/index.test.ts | 2 +- client/utils/test/index.js | 2 +- webpack/shared.js | 1 - 140 files changed, 252 insertions(+), 246 deletions(-) create mode 100644 changelog/update-webpack-include-path-ensure-wcpay-prefix diff --git a/changelog/update-webpack-include-path-ensure-wcpay-prefix b/changelog/update-webpack-include-path-ensure-wcpay-prefix new file mode 100644 index 00000000000..2c48d34d8e3 --- /dev/null +++ b/changelog/update-webpack-include-path-ensure-wcpay-prefix @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +update: ensure that the `wcpay` prefix is included in the Webpack include path diff --git a/client/capital/index.tsx b/client/capital/index.tsx index 3cb691e974e..bf6bcdf20cb 100644 --- a/client/capital/index.tsx +++ b/client/capital/index.tsx @@ -10,17 +10,17 @@ import { TableCard } from '@woocommerce/components'; /** * Internal dependencies. */ -import Page from 'components/page'; -import { TestModeNotice } from 'components/test-mode-notice'; -import ErrorBoundary from 'components/error-boundary'; -import ActiveLoanSummary from 'components/active-loan-summary'; +import Page from 'wcpay/components/page'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; +import ErrorBoundary from 'wcpay/components/error-boundary'; +import ActiveLoanSummary from 'wcpay/components/active-loan-summary'; import { formatExplicitCurrency, isZeroDecimalCurrency, } from 'multi-currency/interface/functions'; -import { CapitalLoan } from 'data/capital/types'; -import ClickableCell from 'components/clickable-cell'; -import Chip from 'components/chip'; +import { CapitalLoan } from 'wcpay/data/capital/types'; +import ClickableCell from 'wcpay/components/clickable-cell'; +import Chip from 'wcpay/components/chip'; import { useLoans } from 'wcpay/data'; import { getAdminUrl } from 'wcpay/utils'; import './style.scss'; diff --git a/client/capital/test/index.test.tsx b/client/capital/test/index.test.tsx index c2a870256dc..e036b6c1e8d 100644 --- a/client/capital/test/index.test.tsx +++ b/client/capital/test/index.test.tsx @@ -7,7 +7,7 @@ import { render, screen } from '@testing-library/react'; * Internal dependencies */ import { useActiveLoanSummary, useLoans } from 'wcpay/data'; -import CapitalPage from '../index'; +import CapitalPage from '..'; // Mock the useLoans hook jest.mock( 'wcpay/data', () => ( { diff --git a/client/card-readers/index.tsx b/client/card-readers/index.tsx index 870fd62949d..d11f4cb0bf8 100644 --- a/client/card-readers/index.tsx +++ b/client/card-readers/index.tsx @@ -9,7 +9,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies. */ -import Page from 'components/page'; +import Page from 'wcpay/components/page'; import ReadersList from './list'; import { TabPanel } from 'wcpay/components/wp-components-wrapped'; diff --git a/client/cart/blocks/product-details.js b/client/cart/blocks/product-details.js index 26ed3c350b0..d6770014b42 100644 --- a/client/cart/blocks/product-details.js +++ b/client/cart/blocks/product-details.js @@ -12,7 +12,7 @@ import { select } from '@wordpress/data'; */ import { getAppearance, getFontRulesFromPage } from 'wcpay/checkout/upe-styles'; import { useStripeAsync } from 'wcpay/hooks/use-stripe-async'; -import { getUPEConfig } from 'utils/checkout'; +import { getUPEConfig } from 'wcpay/utils/checkout'; import WCPayAPI from '../../checkout/api'; import request from '../../checkout/utils/request'; import { useEffect, useState } from 'react'; diff --git a/client/checkout/blocks/index.js b/client/checkout/blocks/index.js index 418c5c1852c..7bc779c458e 100644 --- a/client/checkout/blocks/index.js +++ b/client/checkout/blocks/index.js @@ -11,7 +11,7 @@ import { /** * Internal dependencies */ -import { getUPEConfig, getConfig } from 'utils/checkout'; +import { getUPEConfig, getConfig } from 'wcpay/utils/checkout'; import { isLinkEnabled } from '../utils/upe'; import WCPayAPI from '../api'; import { SavedTokenHandler } from './saved-token-handler'; diff --git a/client/checkout/preview.js b/client/checkout/preview.js index 022bbe7ab84..c7daacdea99 100644 --- a/client/checkout/preview.js +++ b/client/checkout/preview.js @@ -2,7 +2,7 @@ * Internal dependencies */ -import { getConfig } from 'utils/checkout'; +import { getConfig } from 'wcpay/utils/checkout'; /** * Checks whether we're in a preview context. diff --git a/client/checkout/upe-styles/test/index.js b/client/checkout/upe-styles/test/index.js index 3df8e81ba1f..64f502dc14c 100644 --- a/client/checkout/upe-styles/test/index.js +++ b/client/checkout/upe-styles/test/index.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import * as upeStyles from '../index'; +import * as upeStyles from '..'; describe( 'Getting styles for automated theming', () => { const mockElement = document.createElement( 'input' ); diff --git a/client/checkout/woopay/direct-checkout/test/index.test.js b/client/checkout/woopay/direct-checkout/test/index.test.js index c62e98aad3b..0427daf4e58 100644 --- a/client/checkout/woopay/direct-checkout/test/index.test.js +++ b/client/checkout/woopay/direct-checkout/test/index.test.js @@ -46,7 +46,7 @@ global.$ = jest.fn( () => ( { }, } ) ); -require( '../index.js' ); +require( '..' ); describe( 'WooPay direct checkout window "load" event listener', () => { beforeEach( () => { diff --git a/client/checkout/woopay/email-input-iframe.js b/client/checkout/woopay/email-input-iframe.js index 7279a502ce2..dea1f5f35f0 100644 --- a/client/checkout/woopay/email-input-iframe.js +++ b/client/checkout/woopay/email-input-iframe.js @@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n'; import { getConfig } from 'wcpay/utils/checkout'; import { recordUserEvent, getTracksIdentity } from 'tracks'; import request from '../utils/request'; -import { buildAjaxURL } from 'utils/express-checkout'; +import { buildAjaxURL } from 'wcpay/utils/express-checkout'; import { getAppearance } from 'checkout/upe-styles'; import { getTargetElement, diff --git a/client/checkout/woopay/express-button/express-checkout-iframe.js b/client/checkout/woopay/express-button/express-checkout-iframe.js index ad5d3d4227c..3aed8efa48d 100644 --- a/client/checkout/woopay/express-button/express-checkout-iframe.js +++ b/client/checkout/woopay/express-button/express-checkout-iframe.js @@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { getConfig } from 'utils/checkout'; +import { getConfig } from 'wcpay/utils/checkout'; import request from 'wcpay/checkout/utils/request'; import { showErrorMessage } from 'wcpay/checkout/woopay/express-button/utils'; import { buildAjaxURL } from 'wcpay/utils/express-checkout'; diff --git a/client/checkout/woopay/express-button/index.js b/client/checkout/woopay/express-button/index.js index f6645b07518..b8d93ffff82 100644 --- a/client/checkout/woopay/express-button/index.js +++ b/client/checkout/woopay/express-button/index.js @@ -7,7 +7,7 @@ import ReactDOM from 'react-dom'; /** * Internal dependencies */ -import { getConfig } from 'utils/checkout'; +import { getConfig } from 'wcpay/utils/checkout'; import { WoopayExpressCheckoutButton } from './woopay-express-checkout-button'; import WCPayAPI from '../../api'; import request from '../../utils/request'; diff --git a/client/checkout/woopay/express-button/test/express-checkout-iframe.test.js b/client/checkout/woopay/express-button/test/express-checkout-iframe.test.js index bdf6f6775ed..f94dfaac141 100644 --- a/client/checkout/woopay/express-button/test/express-checkout-iframe.test.js +++ b/client/checkout/woopay/express-button/test/express-checkout-iframe.test.js @@ -8,9 +8,9 @@ import { waitFor } from '@testing-library/react'; */ import { expressCheckoutIframe } from '../express-checkout-iframe'; import WCPayAPI from 'wcpay/checkout/api'; -import { getConfig } from 'utils/checkout'; +import { getConfig } from 'wcpay/utils/checkout'; -jest.mock( 'utils/checkout', () => ( { +jest.mock( 'wcpay/utils/checkout', () => ( { getConfig: jest.fn(), } ) ); diff --git a/client/checkout/woopay/express-button/test/index.test.js b/client/checkout/woopay/express-button/test/index.test.js index b11d94bf1a7..8e76cfdbf0f 100644 --- a/client/checkout/woopay/express-button/test/index.test.js +++ b/client/checkout/woopay/express-button/test/index.test.js @@ -6,10 +6,10 @@ import { screen } from '@testing-library/react'; /** * Internal dependencies */ -import '../index'; -import { getConfig } from 'utils/checkout'; +import '..'; +import { getConfig } from 'wcpay/utils/checkout'; -jest.mock( 'utils/checkout', () => ( { +jest.mock( 'wcpay/utils/checkout', () => ( { getConfig: jest.fn(), } ) ); diff --git a/client/checkout/woopay/express-button/test/woopay-express-checkout-button.test.js b/client/checkout/woopay/express-button/test/woopay-express-checkout-button.test.js index d8993733f56..f576b9d9767 100644 --- a/client/checkout/woopay/express-button/test/woopay-express-checkout-button.test.js +++ b/client/checkout/woopay/express-button/test/woopay-express-checkout-button.test.js @@ -11,7 +11,7 @@ import { WoopayExpressCheckoutButton } from '../woopay-express-checkout-button'; import { expressCheckoutIframe } from '../express-checkout-iframe'; import WCPayAPI from 'wcpay/checkout/api'; import request from 'wcpay/checkout/utils/request'; -import { getConfig } from 'utils/checkout'; +import { getConfig } from 'wcpay/utils/checkout'; import useExpressCheckoutProductHandler from '../use-express-checkout-product-handler'; jest.mock( 'wcpay/checkout/utils/request', () => @@ -23,7 +23,7 @@ jest.mock( 'wcpay/checkout/woopay/express-button/utils', () => ( { jest.mock( 'wcpay/checkout/woopay/connect/woopay-connect-iframe', () => ( { WooPayConnectIframe: () => null, } ) ); -jest.mock( 'utils/checkout', () => ( { +jest.mock( 'wcpay/utils/checkout', () => ( { getConfig: jest.fn(), } ) ); diff --git a/client/components/account-balances/balance-block.tsx b/client/components/account-balances/balance-block.tsx index 6bc5eab3f87..b8ea159d986 100644 --- a/client/components/account-balances/balance-block.tsx +++ b/client/components/account-balances/balance-block.tsx @@ -7,7 +7,7 @@ import React from 'react'; * Internal dependencies */ import { formatCurrency } from 'multi-currency/interface/functions'; -import Loadable from 'components/loadable'; +import Loadable from 'wcpay/components/loadable'; /** * BalanceBlockProps diff --git a/client/components/account-balances/balance-tooltip.tsx b/client/components/account-balances/balance-tooltip.tsx index 2bf267856f6..abbe42c4ca4 100644 --- a/client/components/account-balances/balance-tooltip.tsx +++ b/client/components/account-balances/balance-tooltip.tsx @@ -9,9 +9,9 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { ClickTooltip } from 'components/tooltip'; +import { ClickTooltip } from 'wcpay/components/tooltip'; import { documentationUrls, fundLabelStrings } from './strings'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; type TotalBalanceTooltipProps = { balance: number; diff --git a/client/components/account-status/account-fees/expiration-bar.js b/client/components/account-status/account-fees/expiration-bar.js index 2d293e948c9..c6f7e4233e5 100644 --- a/client/components/account-status/account-fees/expiration-bar.js +++ b/client/components/account-status/account-fees/expiration-bar.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import ProgressBar from 'components/progress-bar'; +import ProgressBar from 'wcpay/components/progress-bar'; import { formatCurrency } from 'multi-currency/interface/functions'; const ExpirationBar = ( { diff --git a/client/components/account-status/account-fees/index.js b/client/components/account-status/account-fees/index.js index 0a43585f0ce..e137b336e26 100644 --- a/client/components/account-status/account-fees/index.js +++ b/client/components/account-status/account-fees/index.js @@ -18,7 +18,7 @@ import { formatAccountFeesDescription, getCurrentBaseFee, getTransactionsPaymentMethodName, -} from 'utils/account-fees'; +} from 'wcpay/utils/account-fees'; import { CardDivider } from 'wcpay/components/wp-components-wrapped'; import './styles.scss'; diff --git a/client/components/account-status/account-fees/test/index.js b/client/components/account-status/account-fees/test/index.js index 6dafb6fc16f..59ca0f38a44 100644 --- a/client/components/account-status/account-fees/test/index.js +++ b/client/components/account-status/account-fees/test/index.js @@ -7,7 +7,7 @@ import { render } from '@testing-library/react'; /** * Internal dependencies */ -import AccountFees from '../index'; +import AccountFees from '..'; describe( 'AccountFees', () => { const renderAccountFees = ( accountFees ) => { diff --git a/client/components/account-status/index.js b/client/components/account-status/index.js index dc6ab608ab8..4044ed0d3d6 100755 --- a/client/components/account-status/index.js +++ b/client/components/account-status/index.js @@ -18,8 +18,8 @@ import { __ } from '@wordpress/i18n'; */ import AccountFees from './account-fees'; import AccountStatusItem from './account-status-item'; -import DepositsStatus from 'components/deposits-status'; -import PaymentsStatus from 'components/payments-status'; +import DepositsStatus from 'wcpay/components/deposits-status'; +import PaymentsStatus from 'wcpay/components/payments-status'; import StatusChip from './status-chip'; import './style.scss'; import './shared.scss'; diff --git a/client/components/account-status/status-chip.js b/client/components/account-status/status-chip.js index 6bf4470fb63..4fa1cc14189 100644 --- a/client/components/account-status/status-chip.js +++ b/client/components/account-status/status-chip.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import Chip from 'components/chip'; +import Chip from 'wcpay/components/chip'; import './style.scss'; const StatusChip = ( props ) => { diff --git a/client/components/active-loan-summary/index.tsx b/client/components/active-loan-summary/index.tsx index 3371e0bdc07..4d44724962d 100755 --- a/client/components/active-loan-summary/index.tsx +++ b/client/components/active-loan-summary/index.tsx @@ -18,7 +18,7 @@ import { createInterpolateElement } from '@wordpress/element'; * Internal dependencies. */ import { formatExplicitCurrency } from 'multi-currency/interface/functions'; -import Loadable from 'components/loadable'; +import Loadable from 'wcpay/components/loadable'; import { useActiveLoanSummary } from 'wcpay/data'; import { getAdminUrl } from 'wcpay/utils'; diff --git a/client/components/deposit-status-chip/index.tsx b/client/components/deposit-status-chip/index.tsx index 34f73ea7512..75300d9462c 100644 --- a/client/components/deposit-status-chip/index.tsx +++ b/client/components/deposit-status-chip/index.tsx @@ -6,7 +6,7 @@ import React from 'react'; /** * Internal dependencies */ -import Chip, { ChipType } from 'components/chip'; +import Chip, { ChipType } from 'wcpay/components/chip'; import type { CachedDeposit, DepositStatus } from 'wcpay/types/deposits'; import { depositStatusLabels } from 'wcpay/deposits/strings'; diff --git a/client/components/deposits-overview/deposit-notices.tsx b/client/components/deposits-overview/deposit-notices.tsx index 28e1eafc3b6..c6dca4ff5ce 100644 --- a/client/components/deposits-overview/deposit-notices.tsx +++ b/client/components/deposits-overview/deposit-notices.tsx @@ -11,7 +11,7 @@ import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies */ -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { recordEvent } from 'wcpay/tracks'; /** diff --git a/client/components/deposits-overview/deposit-schedule.tsx b/client/components/deposits-overview/deposit-schedule.tsx index 11221606544..01c9a49835c 100644 --- a/client/components/deposits-overview/deposit-schedule.tsx +++ b/client/components/deposits-overview/deposit-schedule.tsx @@ -10,7 +10,7 @@ import HelpOutlineIcon from 'gridicons/dist/help-outline'; /** * Internal dependencies */ -import { ClickTooltip } from 'components/tooltip'; +import { ClickTooltip } from 'wcpay/components/tooltip'; import { hasAutomaticScheduledDeposits, getDepositMonthlyAnchorLabel, diff --git a/client/components/deposits-overview/index.tsx b/client/components/deposits-overview/index.tsx index 2b44b638113..f7a5c8eeee2 100644 --- a/client/components/deposits-overview/index.tsx +++ b/client/components/deposits-overview/index.tsx @@ -18,7 +18,7 @@ import { getHistory } from '@woocommerce/navigation'; import { getAdminUrl } from 'wcpay/utils'; import { formatExplicitCurrency } from 'multi-currency/interface/functions'; import { recordEvent } from 'tracks'; -import Loadable from 'components/loadable'; +import Loadable from 'wcpay/components/loadable'; import { useSelectedCurrencyOverview } from 'wcpay/overview/hooks'; import RecentDepositsList from './recent-deposits-list'; import DepositSchedule from './deposit-schedule'; diff --git a/client/components/deposits-overview/recent-deposits-list.tsx b/client/components/deposits-overview/recent-deposits-list.tsx index ac4e1e2d1ee..04a26c28d0d 100644 --- a/client/components/deposits-overview/recent-deposits-list.tsx +++ b/client/components/deposits-overview/recent-deposits-list.tsx @@ -17,8 +17,8 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies. */ import './style.scss'; -import DepositStatusChip from 'components/deposit-status-chip'; -import { getDepositDate } from 'deposits/utils'; +import DepositStatusChip from 'wcpay/components/deposit-status-chip'; +import { getDepositDate } from 'wcpay/deposits/utils'; import { CachedDeposit } from 'wcpay/types/deposits'; import { formatCurrency } from 'multi-currency/interface/functions'; import { getDetailsURL } from 'wcpay/components/details-link'; diff --git a/client/components/deposits-status/index.tsx b/client/components/deposits-status/index.tsx index 5cf9875bbf4..e3059631955 100644 --- a/client/components/deposits-status/index.tsx +++ b/client/components/deposits-status/index.tsx @@ -13,7 +13,7 @@ import React from 'react'; /** * Internal dependencies */ -import 'components/account-status/shared.scss'; +import 'wcpay/components/account-status/shared.scss'; import { ClickTooltip } from 'wcpay/components/tooltip'; import type { AccountStatus } from 'wcpay/types/account/account-status'; diff --git a/client/components/disputed-order-notice/test/index.test.js b/client/components/disputed-order-notice/test/index.test.js index 784092295f3..8fa4988b759 100644 --- a/client/components/disputed-order-notice/test/index.test.js +++ b/client/components/disputed-order-notice/test/index.test.js @@ -6,7 +6,7 @@ import { render, screen } from '@testing-library/react'; /** * Internal dependencies */ -import DisputedOrderNoticeHandler from '../index'; +import DisputedOrderNoticeHandler from '..'; import { useCharge } from 'wcpay/data'; jest.mock( 'wcpay/data', () => ( { diff --git a/client/components/file-upload/test/index.tsx b/client/components/file-upload/test/index.tsx index f2c6abcae94..4809da7ff26 100644 --- a/client/components/file-upload/test/index.tsx +++ b/client/components/file-upload/test/index.tsx @@ -10,7 +10,7 @@ import userEvent from '@testing-library/user-event'; /** * Internal dependencies */ -import { FileUploadControl } from 'components/file-upload'; +import { FileUploadControl } from 'wcpay/components/file-upload'; import type { FileUploadControlProps } from 'wcpay/types/disputes'; describe( 'FileUploadControl', () => { diff --git a/client/components/payments-status/index.tsx b/client/components/payments-status/index.tsx index d18db863911..8848ad55567 100644 --- a/client/components/payments-status/index.tsx +++ b/client/components/payments-status/index.tsx @@ -11,7 +11,7 @@ import React from 'react'; /** * Internal dependencies */ -import 'components/account-status/shared.scss'; +import 'wcpay/components/account-status/shared.scss'; import type { AccountStatus } from 'wcpay/types/account/account-status'; interface PaymentsStatusProps { diff --git a/client/components/sandbox-mode-switch-to-live-notice/modal/index.tsx b/client/components/sandbox-mode-switch-to-live-notice/modal/index.tsx index bf34a7e5393..a558725c072 100644 --- a/client/components/sandbox-mode-switch-to-live-notice/modal/index.tsx +++ b/client/components/sandbox-mode-switch-to-live-notice/modal/index.tsx @@ -10,8 +10,8 @@ import { Icon, currencyDollar } from '@wordpress/icons'; /** * Internal dependencies */ -import BlockEmbedIcon from 'components/icons/block-embed'; -import BlockPostAuthorIcon from 'components/icons/block-post-author'; +import BlockEmbedIcon from 'wcpay/components/icons/block-embed'; +import BlockPostAuthorIcon from 'wcpay/components/icons/block-post-author'; import './style.scss'; import { recordEvent } from 'wcpay/tracks'; diff --git a/client/components/sandbox-mode-switch-to-live-notice/modal/test/index.test.tsx b/client/components/sandbox-mode-switch-to-live-notice/modal/test/index.test.tsx index e2341aaa3a5..e6a087542ce 100644 --- a/client/components/sandbox-mode-switch-to-live-notice/modal/test/index.test.tsx +++ b/client/components/sandbox-mode-switch-to-live-notice/modal/test/index.test.tsx @@ -8,7 +8,7 @@ import user from '@testing-library/user-event'; /** * Internal dependencies */ -import SetupLivePaymentsModal from '../index'; +import SetupLivePaymentsModal from '..'; jest.mock( '@wordpress/data', () => ( { useDispatch: jest.fn().mockReturnValue( { updateOptions: jest.fn() } ), diff --git a/client/components/test-mode-notice/index.tsx b/client/components/test-mode-notice/index.tsx index 7b8ac27073d..da4bee4f2ee 100644 --- a/client/components/test-mode-notice/index.tsx +++ b/client/components/test-mode-notice/index.tsx @@ -7,7 +7,7 @@ import { __, _n, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ -import { getPaymentSettingsUrl, isInTestMode } from 'utils'; +import { getPaymentSettingsUrl, isInTestMode } from 'wcpay/utils'; import BannerNotice from '../banner-notice'; import interpolateComponents from '@automattic/interpolate-components'; import { Link } from '@woocommerce/components'; diff --git a/client/components/test-mode-notice/test/index.tsx b/client/components/test-mode-notice/test/index.tsx index 7dabdb3afc1..6cc333ca396 100644 --- a/client/components/test-mode-notice/test/index.tsx +++ b/client/components/test-mode-notice/test/index.tsx @@ -7,8 +7,8 @@ import { render } from '@testing-library/react'; /** * Internal dependencies */ -import { isInTestMode } from 'utils'; -import { TestModeNotice } from '../index'; +import { isInTestMode } from 'wcpay/utils'; +import { TestModeNotice } from '..'; declare const global: { wcSettings: { countries: Record< string, string > }; @@ -19,7 +19,7 @@ declare const global: { }; }; -jest.mock( 'utils', () => ( { +jest.mock( 'wcpay/utils', () => ( { isInTestMode: jest.fn(), getPaymentSettingsUrl: jest.fn().mockReturnValue( 'https://example.com/' ), } ) ); diff --git a/client/components/tip-box/index.tsx b/client/components/tip-box/index.tsx index 4281f1562aa..64ea0cd2626 100644 --- a/client/components/tip-box/index.tsx +++ b/client/components/tip-box/index.tsx @@ -7,7 +7,7 @@ import clsx from 'clsx'; /** * Internal dependencies */ -import LightbulbIcon from 'components/icons/lightbulb'; +import LightbulbIcon from 'wcpay/components/icons/lightbulb'; import './style.scss'; interface Props { diff --git a/client/components/transaction-status-pill/mappings.ts b/client/components/transaction-status-pill/mappings.ts index 975a5ab3f11..54ebf0de729 100644 --- a/client/components/transaction-status-pill/mappings.ts +++ b/client/components/transaction-status-pill/mappings.ts @@ -4,7 +4,7 @@ * External dependencies */ import { __ } from '@wordpress/i18n'; -import type { PillType } from 'components/pill'; +import type { PillType } from 'wcpay/components/pill'; export type TransactionStatus = 'allow' | 'review' | 'block'; type TransactionStatusMapping = Record< diff --git a/client/components/welcome/index.tsx b/client/components/welcome/index.tsx index e4dc657c929..333e6b748ae 100644 --- a/client/components/welcome/index.tsx +++ b/client/components/welcome/index.tsx @@ -12,7 +12,7 @@ import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ -import { useAllDepositsOverviews } from 'data'; +import { useAllDepositsOverviews } from 'wcpay/data'; import { useCurrentWpUser } from './hooks'; import { CurrencySelect } from './currency-select'; import './style.scss'; diff --git a/client/components/welcome/test/index.test.tsx b/client/components/welcome/test/index.test.tsx index d5bcd4681db..b092a4dc69e 100644 --- a/client/components/welcome/test/index.test.tsx +++ b/client/components/welcome/test/index.test.tsx @@ -10,7 +10,7 @@ import user from '@testing-library/user-event'; */ import Welcome from '..'; import { useCurrentWpUser } from '../hooks'; -import { useAllDepositsOverviews } from 'data'; +import { useAllDepositsOverviews } from 'wcpay/data'; import { useSelectedCurrency } from 'overview/hooks'; import type { Overview } from 'types/account-overview'; diff --git a/client/components/woopay/index.tsx b/client/components/woopay/index.tsx index b7a3a31eb35..fed7a71808d 100644 --- a/client/components/woopay/index.tsx +++ b/client/components/woopay/index.tsx @@ -9,7 +9,7 @@ import interpolateComponents from '@automattic/interpolate-components'; /** * Internal dependencies */ -import { getConfig } from 'utils/checkout'; +import { getConfig } from 'wcpay/utils/checkout'; interface apiResponse { url: Location; diff --git a/client/components/woopay/save-user/checkout-page-save-user.js b/client/components/woopay/save-user/checkout-page-save-user.js index 85043da5109..46d68b92031 100644 --- a/client/components/woopay/save-user/checkout-page-save-user.js +++ b/client/components/woopay/save-user/checkout-page-save-user.js @@ -16,8 +16,8 @@ import { * Internal dependencies */ import PhoneNumberInput from 'settings/phone-input'; -import { getConfig } from 'utils/checkout'; -import { buildAjaxURL } from 'utils/express-checkout'; +import { getConfig } from 'wcpay/utils/checkout'; +import { buildAjaxURL } from 'wcpay/utils/express-checkout'; import AdditionalInformation from './additional-information'; import Agreement from './agreement'; import Container from './container'; diff --git a/client/components/woopay/save-user/test/checkout-page-save-user.test.js b/client/components/woopay/save-user/test/checkout-page-save-user.test.js index a09b4249053..19f269085fc 100644 --- a/client/components/woopay/save-user/test/checkout-page-save-user.test.js +++ b/client/components/woopay/save-user/test/checkout-page-save-user.test.js @@ -14,7 +14,7 @@ import CheckoutPageSaveUser from '../checkout-page-save-user'; import useWooPayUser from '../../hooks/use-woopay-user'; import useSelectedPaymentMethod from '../../hooks/use-selected-payment-method'; import request from '../../../../checkout/utils/request'; -import { getConfig } from 'utils/checkout'; +import { getConfig } from 'wcpay/utils/checkout'; import { useDispatch } from '@wordpress/data'; const jQueryMock = ( selector ) => { @@ -43,7 +43,7 @@ const jQueryMock = ( selector ) => { jest.mock( '../../hooks/use-woopay-user', () => jest.fn() ); jest.mock( '../../hooks/use-selected-payment-method', () => jest.fn() ); -jest.mock( 'utils/checkout', () => ( { +jest.mock( 'wcpay/utils/checkout', () => ( { getConfig: jest.fn(), } ) ); jest.mock( diff --git a/client/components/woopay/test/index.test.js b/client/components/woopay/test/index.test.js index 77ad76d8381..c8e3929fe83 100644 --- a/client/components/woopay/test/index.test.js +++ b/client/components/woopay/test/index.test.js @@ -10,7 +10,7 @@ import userEvent from '@testing-library/user-event'; */ import { woopayPaymentMethod } from '..'; -jest.mock( 'utils/checkout', () => ( { +jest.mock( 'wcpay/utils/checkout', () => ( { getConfig: jest.fn(), } ) ); diff --git a/client/connect-account-page/incentive.tsx b/client/connect-account-page/incentive.tsx index 00b89a3fcc5..b6b025038d1 100644 --- a/client/connect-account-page/incentive.tsx +++ b/client/connect-account-page/incentive.tsx @@ -7,7 +7,7 @@ import React from 'react'; * Internal dependencies */ import strings from './strings'; -import { sanitizeHTML } from 'utils/sanitize'; +import { sanitizeHTML } from 'wcpay/utils/sanitize'; const Incentive: React.FC< NonNullable< typeof wcpaySettings.connectIncentive diff --git a/client/connect-account-page/index.tsx b/client/connect-account-page/index.tsx index 843ca8a5386..b21d87eba17 100644 --- a/client/connect-account-page/index.tsx +++ b/client/connect-account-page/index.tsx @@ -21,8 +21,8 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import { recordEvent } from 'tracks'; -import Page from 'components/page'; -import BannerNotice from 'components/banner-notice'; +import Page from 'wcpay/components/page'; +import BannerNotice from 'wcpay/components/banner-notice'; import Incentive from './incentive'; import InfoNotice from './info-notice-modal'; import OnboardingLocationCheckModal from './modal'; @@ -30,8 +30,8 @@ import LogoImg from 'assets/images/woopayments.svg?asset'; import SetupImg from 'assets/images/illustrations/setup.svg?asset'; import strings from './strings'; import './style.scss'; -import InlineNotice from 'components/inline-notice'; -import { WooPaymentsMethodsLogos } from 'components/payment-method-logos'; +import InlineNotice from 'wcpay/components/inline-notice'; +import { WooPaymentsMethodsLogos } from 'wcpay/components/payment-method-logos'; import WooLogo from 'assets/images/woo-logo.svg?asset'; import { sanitizeHTML } from 'wcpay/utils/sanitize'; import { isInTestModeOnboarding } from 'wcpay/utils'; diff --git a/client/connect-account-page/info-notice-modal.tsx b/client/connect-account-page/info-notice-modal.tsx index ce6f4223374..98ba46f162e 100644 --- a/client/connect-account-page/info-notice-modal.tsx +++ b/client/connect-account-page/info-notice-modal.tsx @@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import { recordEvent } from 'tracks'; -import TipBox from 'components/tip-box'; +import TipBox from 'wcpay/components/tip-box'; import strings from './strings'; import './style.scss'; diff --git a/client/connect-account-page/modal/test/index.js b/client/connect-account-page/modal/test/index.js index 37659bd9bc6..b1b713dc196 100644 --- a/client/connect-account-page/modal/test/index.js +++ b/client/connect-account-page/modal/test/index.js @@ -7,7 +7,7 @@ import user from '@testing-library/user-event'; /** * Internal dependencies */ -import OnboardingLocationCheckModal from '../index'; +import OnboardingLocationCheckModal from '..'; // Mocks, needed for invoking the modal rendering const countriesMock = [ diff --git a/client/data/authorizations/reducer.ts b/client/data/authorizations/reducer.ts index 1767ced506d..fbc096794fd 100644 --- a/client/data/authorizations/reducer.ts +++ b/client/data/authorizations/reducer.ts @@ -4,7 +4,7 @@ * Internal dependencies */ import TYPES from './action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { AuthorizationsState, SetErrorForAuthorizationsAction, diff --git a/client/data/authorizations/selectors.ts b/client/data/authorizations/selectors.ts index 3d02cc2b889..c2a419afbb9 100644 --- a/client/data/authorizations/selectors.ts +++ b/client/data/authorizations/selectors.ts @@ -8,7 +8,7 @@ import type { Query } from '@woocommerce/navigation'; /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { ApiError } from 'wcpay/types/errors'; import { AuthorizationsSummary, diff --git a/client/data/authorizations/test/reducer.test.ts b/client/data/authorizations/test/reducer.test.ts index 9df243a1847..78bbdc14865 100644 --- a/client/data/authorizations/test/reducer.test.ts +++ b/client/data/authorizations/test/reducer.test.ts @@ -9,7 +9,7 @@ import type { Query } from '@woocommerce/navigation'; */ import reducer from '../reducer'; import types from '../action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { Authorization } from 'wcpay/types/authorizations'; import authorizationsFixture from './authorizations.fixture.json'; import authorizationsSummaryFixture from './authorizations-summary.fixture.json'; diff --git a/client/data/authorizations/test/selectors.test.ts b/client/data/authorizations/test/selectors.test.ts index 7ae445b2331..3761153bd64 100644 --- a/client/data/authorizations/test/selectors.test.ts +++ b/client/data/authorizations/test/selectors.test.ts @@ -7,7 +7,7 @@ import type { Query } from '@woocommerce/navigation'; /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { getAuthorization, getAuthorizations, diff --git a/client/data/deposits/reducer.js b/client/data/deposits/reducer.js index f0742ba6a00..f9b4332dbc8 100644 --- a/client/data/deposits/reducer.js +++ b/client/data/deposits/reducer.js @@ -9,7 +9,7 @@ import { map, keyBy } from 'lodash'; * Internal dependencies */ import TYPES from './action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; const defaultState = { byId: {}, queries: {}, count: 0, instant: {} }; diff --git a/client/data/deposits/selectors.js b/client/data/deposits/selectors.js index b12951663fd..67a6e8d5e09 100644 --- a/client/data/deposits/selectors.js +++ b/client/data/deposits/selectors.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; /** * Retrieves the deposits state from the wp.data store if the state diff --git a/client/data/deposits/test/reducer.js b/client/data/deposits/test/reducer.js index a3be492bee9..e3a05d3f9d8 100644 --- a/client/data/deposits/test/reducer.js +++ b/client/data/deposits/test/reducer.js @@ -5,7 +5,7 @@ */ import reducer from '../reducer'; import types from '../action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; describe( 'Deposits reducer tests', () => { const mockQuery = { paged: '2', perPage: '50' }; diff --git a/client/data/deposits/test/selectors.js b/client/data/deposits/test/selectors.js index 455fe317fca..5fbbd252ba4 100644 --- a/client/data/deposits/test/selectors.js +++ b/client/data/deposits/test/selectors.js @@ -8,7 +8,7 @@ import { get } from 'lodash'; /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { getDeposit, getDeposits, diff --git a/client/data/disputes/reducer.js b/client/data/disputes/reducer.js index f6b88f90452..f3866fd3370 100644 --- a/client/data/disputes/reducer.js +++ b/client/data/disputes/reducer.js @@ -9,7 +9,7 @@ import { map, keyBy } from 'lodash'; * Internal dependencies */ import TYPES from './action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; const defaultState = { byId: {}, queries: {}, summary: {}, cached: {} }; diff --git a/client/data/disputes/selectors.js b/client/data/disputes/selectors.js index b592e518298..a539480401e 100644 --- a/client/data/disputes/selectors.js +++ b/client/data/disputes/selectors.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; /** * Retrieves the disputes state from the wp.data store if the state diff --git a/client/data/disputes/test/reducer.js b/client/data/disputes/test/reducer.js index b9dcb4d1dd6..28b2a522dad 100644 --- a/client/data/disputes/test/reducer.js +++ b/client/data/disputes/test/reducer.js @@ -5,7 +5,7 @@ */ import reducer from '../reducer'; import types from '../action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; describe( 'Disputes reducer tests', () => { const mockQuery = { paged: '2', perPage: '50' }; diff --git a/client/data/disputes/test/selectors.js b/client/data/disputes/test/selectors.js index 4221e5e2222..ffc2444668e 100644 --- a/client/data/disputes/test/selectors.js +++ b/client/data/disputes/test/selectors.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { getDispute, getDisputes, getDisputesSummary } from '../selectors'; // Sections in initial state are empty. diff --git a/client/data/documents/reducer.js b/client/data/documents/reducer.js index efddf1f67ef..e83c27db3fd 100644 --- a/client/data/documents/reducer.js +++ b/client/data/documents/reducer.js @@ -4,7 +4,7 @@ * Internal dependencies */ import TYPES from './action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; const defaultState = { summary: {} }; diff --git a/client/data/documents/selectors.js b/client/data/documents/selectors.js index 9c1f5f06773..223a8fb2387 100644 --- a/client/data/documents/selectors.js +++ b/client/data/documents/selectors.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; /** * Retrieves the documents state from the wp.data store if the state diff --git a/client/data/documents/test/reducer.js b/client/data/documents/test/reducer.js index 4f4f773b436..66940f4648c 100644 --- a/client/data/documents/test/reducer.js +++ b/client/data/documents/test/reducer.js @@ -5,7 +5,7 @@ */ import reducer from '../reducer'; import types from '../action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; describe( 'Documents reducer tests', () => { const mockQuery = { paged: '2', perPage: '50' }; diff --git a/client/data/documents/test/selectors.js b/client/data/documents/test/selectors.js index 9cf4f65a3ff..65363f6ee65 100644 --- a/client/data/documents/test/selectors.js +++ b/client/data/documents/test/selectors.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { getDocuments, getDocumentsError, diff --git a/client/data/transactions/reducer.js b/client/data/transactions/reducer.js index e7aefcec2fe..7dc5a70484c 100644 --- a/client/data/transactions/reducer.js +++ b/client/data/transactions/reducer.js @@ -4,7 +4,7 @@ * Internal dependencies */ import TYPES from './action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; const defaultState = { summary: {}, diff --git a/client/data/transactions/selectors.js b/client/data/transactions/selectors.js index de15e939042..657694992c3 100644 --- a/client/data/transactions/selectors.js +++ b/client/data/transactions/selectors.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; /** * Retrieves the transactions state from the wp.data store if the state diff --git a/client/data/transactions/test/reducer.js b/client/data/transactions/test/reducer.js index ebc411b7491..f35ba8f3304 100644 --- a/client/data/transactions/test/reducer.js +++ b/client/data/transactions/test/reducer.js @@ -5,7 +5,7 @@ */ import reducer from '../reducer'; import types from '../action-types'; -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; describe( 'Transactions reducer tests', () => { const mockQuery = { paged: '2', perPage: '50' }; diff --git a/client/data/transactions/test/selectors.js b/client/data/transactions/test/selectors.js index c8f4bec83aa..ebbf8139c7c 100644 --- a/client/data/transactions/test/selectors.js +++ b/client/data/transactions/test/selectors.js @@ -3,7 +3,7 @@ /** * Internal dependencies */ -import { getResourceId } from 'utils/data'; +import { getResourceId } from 'wcpay/utils/data'; import { getFraudOutcomeTransactions, getFraudOutcomeTransactionsError, diff --git a/client/deposits/details/index.tsx b/client/deposits/details/index.tsx index 687bafd854d..f1c047f6637 100644 --- a/client/deposits/details/index.tsx +++ b/client/deposits/details/index.tsx @@ -29,14 +29,14 @@ import clsx from 'clsx'; * Internal dependencies. */ import type { CachedDeposit } from 'types/deposits'; -import { useDeposit } from 'data'; +import { useDeposit } from 'wcpay/data'; import TransactionsList from 'transactions/list'; -import { CopyButton } from 'components/copy-button'; -import Page from 'components/page'; -import ErrorBoundary from 'components/error-boundary'; -import { TestModeNotice } from 'components/test-mode-notice'; -import BannerNotice from 'components/banner-notice'; -import InlineNotice from 'components/inline-notice'; +import { CopyButton } from 'wcpay/components/copy-button'; +import Page from 'wcpay/components/page'; +import ErrorBoundary from 'wcpay/components/error-boundary'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; +import BannerNotice from 'wcpay/components/banner-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { formatCurrency, formatExplicitCurrency, diff --git a/client/deposits/filters/config.js b/client/deposits/filters/config.js index ee5b198e7d5..851663f342c 100644 --- a/client/deposits/filters/config.js +++ b/client/deposits/filters/config.js @@ -7,7 +7,7 @@ import { getSetting } from '@woocommerce/settings'; /** * Internal dependencies */ -import { depositStatusLabels } from 'deposits/strings'; +import { depositStatusLabels } from 'wcpay/deposits/strings'; const depositStatusOptions = Object.entries( depositStatusLabels ) // Ignore the 'deducted' status, which is only a display status and not to be used in filters. diff --git a/client/deposits/index.tsx b/client/deposits/index.tsx index 9059b24cb1f..0946054a826 100644 --- a/client/deposits/index.tsx +++ b/client/deposits/index.tsx @@ -10,14 +10,13 @@ import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies. */ -import Page from 'components/page'; +import Page from 'wcpay/components/page'; import interpolateComponents from '@automattic/interpolate-components'; import { __ } from '@wordpress/i18n'; -import { TestModeNotice } from 'components/test-mode-notice'; -import BannerNotice from 'components/banner-notice'; -import DepositSchedule from 'components/deposits-overview/deposit-schedule'; -import { useAllDepositsOverviews } from 'data'; -import { useSettings } from 'wcpay/data'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; +import BannerNotice from 'wcpay/components/banner-notice'; +import DepositSchedule from 'wcpay/components/deposits-overview/deposit-schedule'; +import { useAllDepositsOverviews, useSettings } from 'wcpay/data'; import DepositsList from './list'; import { hasAutomaticScheduledDeposits } from 'wcpay/deposits/utils'; import { recordEvent } from 'wcpay/tracks'; diff --git a/client/deposits/list/index.tsx b/client/deposits/list/index.tsx index e346cd88220..9b3cc660ef0 100644 --- a/client/deposits/list/index.tsx +++ b/client/deposits/list/index.tsx @@ -21,17 +21,17 @@ import { formatExplicitCurrency, formatExportAmount, } from 'multi-currency/interface/functions'; -import DetailsLink, { getDetailsURL } from 'components/details-link'; -import ClickableCell from 'components/clickable-cell'; +import DetailsLink, { getDetailsURL } from 'wcpay/components/details-link'; +import ClickableCell from 'wcpay/components/clickable-cell'; import Page from '../../components/page'; import DepositsFilters from '../filters'; -import DownloadButton from 'components/download-button'; +import DownloadButton from 'wcpay/components/download-button'; import { getPayoutsCSVRequestURL, payoutsDownloadEndpoint, } from 'wcpay/data/deposits/resolvers'; -import { applyThousandSeparator } from '../../utils/index.js'; -import DepositStatusChip from 'components/deposit-status-chip'; +import { applyThousandSeparator } from '../../utils'; +import DepositStatusChip from 'wcpay/components/deposit-status-chip'; import { useReportExport } from 'wcpay/hooks/use-report-export'; import './style.scss'; diff --git a/client/disputes/evidence/index.js b/client/disputes/evidence/index.js index f0bdc423c9f..b9ad771c015 100644 --- a/client/disputes/evidence/index.js +++ b/client/disputes/evidence/index.js @@ -26,13 +26,16 @@ import { merge, some, flatten, isMatchWith } from 'lodash'; import '../style.scss'; import { useDisputeEvidence } from 'wcpay/data'; import evidenceFields from './fields'; -import { FileUploadControl, UploadedReadOnly } from 'components/file-upload'; -import { TestModeNotice } from 'components/test-mode-notice'; +import { + FileUploadControl, + UploadedReadOnly, +} from 'wcpay/components/file-upload'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; import Info from '../info'; -import Page from 'components/page'; -import ErrorBoundary from 'components/error-boundary'; -import Loadable, { LoadableBlock } from 'components/loadable'; -import useConfirmNavigation from 'utils/use-confirm-navigation'; +import Page from 'wcpay/components/page'; +import ErrorBoundary from 'wcpay/components/error-boundary'; +import Loadable, { LoadableBlock } from 'wcpay/components/loadable'; +import useConfirmNavigation from 'wcpay/utils/use-confirm-navigation'; import { recordEvent } from 'tracks'; import { getAdminUrl } from 'wcpay/utils'; diff --git a/client/disputes/index.tsx b/client/disputes/index.tsx index 1d95fd7a995..652ec65024f 100644 --- a/client/disputes/index.tsx +++ b/client/disputes/index.tsx @@ -16,28 +16,26 @@ import NoticeOutlineIcon from 'gridicons/dist/notice-outline'; /** * Internal dependencies. */ -import { useDisputes, useDisputesSummary } from 'data/index'; -import OrderLink from 'components/order-link'; -import DisputeStatusChip from 'components/dispute-status-chip'; -import ClickableCell from 'components/clickable-cell'; -import DetailsLink, { getDetailsURL } from 'components/details-link'; -import Page from 'components/page'; -import { TestModeNotice } from 'components/test-mode-notice'; +import { useDisputes, useDisputesSummary, useSettings } from 'wcpay/data'; +import OrderLink from 'wcpay/components/order-link'; +import DisputeStatusChip from 'wcpay/components/dispute-status-chip'; +import ClickableCell from 'wcpay/components/clickable-cell'; +import DetailsLink, { getDetailsURL } from 'wcpay/components/details-link'; +import Page from 'wcpay/components/page'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; import { reasons } from './strings'; -import { formatStringValue } from 'utils'; +import { formatStringValue, applyThousandSeparator } from 'wcpay/utils'; import { formatExplicitCurrency, formatExportAmount, } from 'multi-currency/interface/functions'; import DisputesFilters from './filters'; -import DownloadButton from 'components/download-button'; +import DownloadButton from 'wcpay/components/download-button'; import { CachedDispute, DisputesTableHeader } from 'wcpay/types/disputes'; import { getDisputesCSVRequestURL, disputesDownloadEndpoint, } from 'wcpay/data/disputes/resolvers'; -import { applyThousandSeparator } from 'wcpay/utils'; -import { useSettings } from 'wcpay/data'; import { isAwaitingResponse } from 'wcpay/disputes/utils'; import './style.scss'; import { formatDateTimeFromString } from 'wcpay/utils/date-time'; diff --git a/client/disputes/info/index.tsx b/client/disputes/info/index.tsx index 230b90dec7e..397d5df9c2c 100644 --- a/client/disputes/info/index.tsx +++ b/client/disputes/info/index.tsx @@ -10,13 +10,13 @@ import { Link } from '@woocommerce/components'; /** * Internal dependencies. */ -import OrderLink from 'components/order-link'; -import { getDetailsURL } from 'components/details-link'; +import OrderLink from 'wcpay/components/order-link'; +import { getDetailsURL } from 'wcpay/components/details-link'; import { reasons } from '../strings'; import { formatStringValue } from 'utils'; import { formatExplicitCurrency } from 'multi-currency/interface/functions'; import './style.scss'; -import Loadable from 'components/loadable'; +import Loadable from 'wcpay/components/loadable'; import { Dispute } from 'wcpay/types/disputes'; import { formatDateTimeFromTimestamp } from 'wcpay/utils/date-time'; diff --git a/client/disputes/new-evidence/index.tsx b/client/disputes/new-evidence/index.tsx index aebfc7c3fcb..3b14899ab7b 100644 --- a/client/disputes/new-evidence/index.tsx +++ b/client/disputes/new-evidence/index.tsx @@ -12,20 +12,20 @@ import { chevronLeft, chevronRight } from '@wordpress/icons'; /** * Internal dependencies. */ -import useConfirmNavigation from 'utils/use-confirm-navigation'; +import useConfirmNavigation from 'wcpay/utils/use-confirm-navigation'; import { recordEvent } from 'tracks'; -import { TestModeNotice } from 'components/test-mode-notice'; -import ErrorBoundary from 'components/error-boundary'; -import Paragraphs from 'components/paragraphs'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; +import ErrorBoundary from 'wcpay/components/error-boundary'; +import Paragraphs from 'wcpay/components/paragraphs'; import { reasons } from 'wcpay/disputes/strings'; -import OrderLink from 'components/order-link'; +import OrderLink from 'wcpay/components/order-link'; import DisputeNotice from 'payment-details/dispute-details/dispute-notice'; import DisputeDueByDate from 'payment-details/dispute-details/dispute-due-by-date'; -import { ClickTooltip } from 'components/tooltip'; -import { HorizontalList } from 'components/horizontal-list'; +import { ClickTooltip } from 'wcpay/components/tooltip'; +import { HorizontalList } from 'wcpay/components/horizontal-list'; import { formatExplicitCurrency } from 'multi-currency/interface/functions'; import { formatDateTimeFromTimestamp } from 'wcpay/utils/date-time'; -import { getBankName } from 'utils/charge'; +import { getBankName } from 'wcpay/utils/charge'; import { generateCoverLetter, getBusinessDetails, @@ -34,7 +34,7 @@ import { useGetSettings } from 'wcpay/data'; import CustomerDetails from './customer-details'; import ProductDetails from './product-details'; import RecommendedDocuments from './recommended-documents'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import ShippingDetails from './shipping-details'; import CoverLetter from './cover-letter'; import { Button, HorizontalRule } from 'wcpay/components/wp-components-wrapped'; diff --git a/client/disputes/redirect-to-transaction-details/index.tsx b/client/disputes/redirect-to-transaction-details/index.tsx index ea949acdf26..12ef6573f3b 100644 --- a/client/disputes/redirect-to-transaction-details/index.tsx +++ b/client/disputes/redirect-to-transaction-details/index.tsx @@ -13,8 +13,8 @@ import { /** * Internal dependencies. */ -import Page from 'components/page'; -import { useDispute } from 'data/index'; +import Page from 'wcpay/components/page'; +import { useDispute } from 'wcpay/data'; import { Charge } from 'wcpay/types/charges'; import { getAdminUrl } from 'wcpay/utils'; diff --git a/client/disputes/test/index.tsx b/client/disputes/test/index.tsx index 0be32870060..a8d84d3a38c 100644 --- a/client/disputes/test/index.tsx +++ b/client/disputes/test/index.tsx @@ -10,7 +10,7 @@ import { useUserPreferences } from '@woocommerce/data'; * Internal dependencies */ import DisputesList from '..'; -import { useDisputes, useDisputesSummary, useSettings } from 'data/index'; +import { useDisputes, useDisputesSummary, useSettings } from 'wcpay/data'; import React from 'react'; import { CachedDispute, @@ -35,7 +35,7 @@ jest.mock( '@wordpress/data', () => ( { withSelect: jest.fn( () => jest.fn() ), } ) ); -jest.mock( 'data/index', () => ( { +jest.mock( 'wcpay/data', () => ( { useDisputes: jest.fn(), useDisputesSummary: jest.fn(), useSettings: jest.fn(), diff --git a/client/documents/index.tsx b/client/documents/index.tsx index a322fc17961..cfb51c0766a 100644 --- a/client/documents/index.tsx +++ b/client/documents/index.tsx @@ -6,9 +6,9 @@ import React from 'react'; /** * Internal dependencies */ -import Page from 'components/page'; +import Page from 'wcpay/components/page'; import DocumentsList from './list'; -import { TestModeNotice } from 'components/test-mode-notice'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; import { MaybeShowMerchantFeedbackPrompt } from 'wcpay/merchant-feedback-prompt'; export const DocumentsPage = (): JSX.Element => { return ( diff --git a/client/documents/list/index.tsx b/client/documents/list/index.tsx index 20cd0fe753c..7ebb7ca0e3b 100644 --- a/client/documents/list/index.tsx +++ b/client/documents/list/index.tsx @@ -13,7 +13,7 @@ import { Button } from 'wcpay/components/wp-components-wrapped'; * Internal dependencies */ import { displayType } from 'documents/strings'; -import { Document, useDocuments, useDocumentsSummary } from 'data/index'; +import { Document, useDocuments, useDocumentsSummary } from 'wcpay/data'; import './style.scss'; import DocumentsFilters from '../filters'; import Page from '../../components/page'; diff --git a/client/documents/list/test/index.tsx b/client/documents/list/test/index.tsx index e02f48f847b..f6615cc0dd2 100644 --- a/client/documents/list/test/index.tsx +++ b/client/documents/list/test/index.tsx @@ -13,11 +13,11 @@ import { useUserPreferences } from '@woocommerce/data'; * Internal dependencies */ import { DocumentsList } from '../'; -import { useDocuments, useDocumentsSummary } from 'data/index'; -import type { Document } from 'data/documents/hooks'; +import { useDocuments, useDocumentsSummary } from 'wcpay/data'; +import type { Document } from 'wcpay/data/documents/hooks'; import VatForm from 'wcpay/vat/form'; -jest.mock( 'data/index', () => ( { +jest.mock( 'wcpay/data', () => ( { useDocuments: jest.fn(), useDocumentsSummary: jest.fn(), } ) ); diff --git a/client/express-checkout/blocks/components/express-checkout-preview.js b/client/express-checkout/blocks/components/express-checkout-preview.js index 815bbc7b051..225e07fe2de 100644 --- a/client/express-checkout/blocks/components/express-checkout-preview.js +++ b/client/express-checkout/blocks/components/express-checkout-preview.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { getDefaultBorderRadius } from 'wcpay/utils/express-checkout'; export const ExpressCheckoutPreviewComponent = ( { diff --git a/client/index.js b/client/index.js index ed01ce48f92..9d863890611 100644 --- a/client/index.js +++ b/client/index.js @@ -15,8 +15,8 @@ import 'wp-mediaelement'; */ import './style.scss'; import ConnectAccountPage from 'connect-account-page'; -import DepositsPage from 'deposits'; -import DepositDetailsPage from 'deposits/details'; +import DepositsPage from 'wcpay/deposits'; +import DepositDetailsPage from 'wcpay/deposits/details'; import TransactionsPage from 'transactions'; import PaymentDetailsPage from 'payment-details'; import DisputesPage from 'disputes'; diff --git a/client/merchant-feedback-prompt/test/index.test.tsx b/client/merchant-feedback-prompt/test/index.test.tsx index 17b2e458e9f..d401d1b7571 100644 --- a/client/merchant-feedback-prompt/test/index.test.tsx +++ b/client/merchant-feedback-prompt/test/index.test.tsx @@ -8,7 +8,7 @@ import { dispatch, select } from '@wordpress/data'; /** * Internal dependencies */ -import { MaybeShowMerchantFeedbackPrompt } from '../index'; +import { MaybeShowMerchantFeedbackPrompt } from '..'; import { recordEvent } from 'wcpay/tracks'; import { NegativeFeedbackModal } from '../negative-modal'; diff --git a/client/onboarding/form.tsx b/client/onboarding/form.tsx index 5aa80fe83c1..f27a8c0b54b 100644 --- a/client/onboarding/form.tsx +++ b/client/onboarding/form.tsx @@ -8,9 +8,9 @@ import { isEmpty, mapValues } from 'lodash'; /** * Internal dependencies */ -import { useStepperContext } from 'components/stepper'; -import { Item as SelectItem } from 'components/custom-select-control'; -import { ListItem as GroupedSelectItem } from 'components/grouped-select-control'; +import { useStepperContext } from 'wcpay/components/stepper'; +import { Item as SelectItem } from 'wcpay/components/custom-select-control'; +import { ListItem as GroupedSelectItem } from 'wcpay/components/grouped-select-control'; import { GroupedSelectField, GroupedSelectFieldProps, @@ -18,7 +18,7 @@ import { SelectFieldProps, TextField, TextFieldProps, -} from 'components/form/fields'; +} from 'wcpay/components/form/fields'; import { useOnboardingContext } from './context'; import { OnboardingFields } from './types'; import { useValidation } from './validation'; diff --git a/client/onboarding/index.tsx b/client/onboarding/index.tsx index 3953d3282ed..3e10ea39630 100644 --- a/client/onboarding/index.tsx +++ b/client/onboarding/index.tsx @@ -6,9 +6,9 @@ import React, { useEffect } from 'react'; /** * Internal dependencies */ -import Page from 'components/page'; +import Page from 'wcpay/components/page'; import { OnboardingContextProvider } from './context'; -import { Stepper } from 'components/stepper'; +import { Stepper } from 'wcpay/components/stepper'; import { getMccFromIndustry } from 'onboarding/utils'; import { OnboardingForm } from './form'; import Step from './step'; diff --git a/client/onboarding/kyc/index.tsx b/client/onboarding/kyc/index.tsx index b3d3c214c13..78f8cc98544 100644 --- a/client/onboarding/kyc/index.tsx +++ b/client/onboarding/kyc/index.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; * Internal dependencies */ import WooLogo from 'assets/images/woo-logo.svg'; -import Page from 'components/page'; +import Page from 'wcpay/components/page'; import { OnboardingContextProvider } from 'onboarding/context'; import EmbeddedKyc from 'onboarding/steps/embedded-kyc'; import { getConnectUrl } from 'utils'; diff --git a/client/onboarding/step.tsx b/client/onboarding/step.tsx index f81f06c93bd..2386580eb1c 100644 --- a/client/onboarding/step.tsx +++ b/client/onboarding/step.tsx @@ -6,7 +6,7 @@ import React from 'react'; /** * Internal dependencies */ -import { useStepperContext } from 'components/stepper'; +import { useStepperContext } from 'wcpay/components/stepper'; import { OnboardingSteps } from './types'; import { useTrackAbandoned } from './tracking'; import strings from './strings'; diff --git a/client/onboarding/steps/business-details.tsx b/client/onboarding/steps/business-details.tsx index 86dc4375aa5..20219f6d0ef 100644 --- a/client/onboarding/steps/business-details.tsx +++ b/client/onboarding/steps/business-details.tsx @@ -7,7 +7,7 @@ import React from 'react'; * Internal dependencies */ import { useOnboardingContext } from '../context'; -import { Item } from 'components/custom-select-control'; +import { Item } from 'wcpay/components/custom-select-control'; import { OnboardingFields } from '../types'; import { OnboardingGroupedSelectField, OnboardingSelectField } from '../form'; import { diff --git a/client/onboarding/steps/loading.tsx b/client/onboarding/steps/loading.tsx index 0c2ba75c43c..aa4cc21edbb 100644 --- a/client/onboarding/steps/loading.tsx +++ b/client/onboarding/steps/loading.tsx @@ -10,7 +10,7 @@ import { addQueryArgs } from '@wordpress/url'; import { useOnboardingContext } from '../context'; import { fromDotNotation } from '../utils'; import { trackRedirected, useTrackAbandoned } from '../tracking'; -import LoadBar from 'components/load-bar'; +import LoadBar from 'wcpay/components/load-bar'; import strings from '../strings'; const LoadingStep: React.FC = () => { diff --git a/client/onboarding/steps/test/loading.tsx b/client/onboarding/steps/test/loading.tsx index e1c4d4bbcce..425422fe062 100644 --- a/client/onboarding/steps/test/loading.tsx +++ b/client/onboarding/steps/test/loading.tsx @@ -29,7 +29,7 @@ jest.mock( '../../context', () => ( { } ) ), } ) ); -jest.mock( 'components/stepper', () => ( { +jest.mock( 'wcpay/components/stepper', () => ( { useStepperContext: jest.fn( () => ( { currentStep: 'loading', } ) ), diff --git a/client/onboarding/test/form.tsx b/client/onboarding/test/form.tsx index ff2cbf8a67b..be99543c8e5 100644 --- a/client/onboarding/test/form.tsx +++ b/client/onboarding/test/form.tsx @@ -44,7 +44,7 @@ jest.mock( '../context', () => ( { } ) ), } ) ); -jest.mock( 'components/stepper', () => ( { +jest.mock( 'wcpay/components/stepper', () => ( { useStepperContext: jest.fn( () => ( { nextStep, } ) ), diff --git a/client/onboarding/tracking.ts b/client/onboarding/tracking.ts index 96db58d2a91..9d7e44f44c5 100644 --- a/client/onboarding/tracking.ts +++ b/client/onboarding/tracking.ts @@ -7,7 +7,7 @@ import { useEffect } from 'react'; * Internal dependencies */ -import { useStepperContext } from 'components/stepper'; +import { useStepperContext } from 'wcpay/components/stepper'; import { useOnboardingContext } from './context'; import { OnboardingFields } from './types'; import { recordEvent } from 'tracks'; diff --git a/client/onboarding/utils.ts b/client/onboarding/utils.ts index c361cea6917..4d3f3c19e06 100644 --- a/client/onboarding/utils.ts +++ b/client/onboarding/utils.ts @@ -7,8 +7,8 @@ import apiFetch from '@wordpress/api-fetch'; /** * Internal dependencies */ -import { NAMESPACE } from 'data/constants'; -import { ListItem } from 'components/grouped-select-control'; +import { NAMESPACE } from 'wcpay/data/constants'; +import { ListItem } from 'wcpay/components/grouped-select-control'; import businessTypeDescriptionStrings from './translations/descriptions'; import { Country, FinalizeOnboardingResponse } from './types'; diff --git a/client/order/index.js b/client/order/index.js index 6255ea9c460..16f61195457 100644 --- a/client/order/index.js +++ b/client/order/index.js @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { getConfig } from 'utils/order'; +import { getConfig } from 'wcpay/utils/order'; import { isAwaitingResponse, isUnderReview } from 'wcpay/disputes/utils'; import TestModeNotice from './test-mode-notice'; import DisputedOrderNoticeHandler from 'wcpay/components/disputed-order-notice'; diff --git a/client/order/order-status-change-strategies/index.tsx b/client/order/order-status-change-strategies/index.tsx index 9a4fc135834..caecec0cbe6 100644 --- a/client/order/order-status-change-strategies/index.tsx +++ b/client/order/order-status-change-strategies/index.tsx @@ -10,7 +10,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import RefundConfirmationModal from '../refund-confirm-modal'; -import { getConfig } from 'utils/order'; +import { getConfig } from 'wcpay/utils/order'; import OrderStatusConfirmationModal from '../order-status-confirmation-modal'; import React from 'react'; diff --git a/client/overview/inbox-notifications/index.js b/client/overview/inbox-notifications/index.js index bbba6eefa64..f9b05542cd0 100644 --- a/client/overview/inbox-notifications/index.js +++ b/client/overview/inbox-notifications/index.js @@ -17,7 +17,7 @@ import { * Internal dependencies */ import { recordEvent } from 'tracks'; -import { updateWoocommerceUserMeta } from 'utils/update-woocommerce-user-meta'; +import { updateWoocommerceUserMeta } from 'wcpay/utils/update-woocommerce-user-meta'; import './index.scss'; const INBOX_QUERY = { diff --git a/client/overview/inbox-notifications/test/index.js b/client/overview/inbox-notifications/test/index.js index 4bcd0824222..ccb9c13e940 100644 --- a/client/overview/inbox-notifications/test/index.js +++ b/client/overview/inbox-notifications/test/index.js @@ -7,7 +7,7 @@ import { render } from '@testing-library/react'; /** * Internal dependencies */ -import { updateWoocommerceUserMeta } from 'utils/update-woocommerce-user-meta'; +import { updateWoocommerceUserMeta } from 'wcpay/utils/update-woocommerce-user-meta'; import InboxPanel from '..'; jest.mock( '@wordpress/data', () => ( { @@ -40,7 +40,7 @@ jest.mock( '@woocommerce/experimental', () => { }; } ); -jest.mock( 'utils/update-woocommerce-user-meta', () => ( { +jest.mock( 'wcpay/utils/update-woocommerce-user-meta', () => ( { __esModule: true, updateWoocommerceUserMeta: jest.fn(), } ) ); diff --git a/client/overview/index.js b/client/overview/index.js index 87a9c684c55..8e66a213c29 100644 --- a/client/overview/index.js +++ b/client/overview/index.js @@ -14,21 +14,21 @@ import { Link } from '@woocommerce/components'; /** * Internal dependencies. */ -import AccountBalances from 'components/account-balances'; -import AccountStatus from 'components/account-status'; -import ActiveLoanSummary from 'components/active-loan-summary'; +import AccountBalances from 'wcpay/components/account-balances'; +import AccountStatus from 'wcpay/components/account-status'; +import ActiveLoanSummary from 'wcpay/components/active-loan-summary'; import ConnectionSuccessModal from './modal/connection-success'; -import DepositsOverview from 'components/deposits-overview'; -import ErrorBoundary from 'components/error-boundary'; -import JetpackIdcNotice from 'components/jetpack-idc-notice'; -import Page from 'components/page'; -import Welcome from 'components/welcome'; -import { TestModeNotice } from 'components/test-mode-notice'; +import DepositsOverview from 'wcpay/components/deposits-overview'; +import ErrorBoundary from 'wcpay/components/error-boundary'; +import JetpackIdcNotice from 'wcpay/components/jetpack-idc-notice'; +import Page from 'wcpay/components/page'; +import Welcome from 'wcpay/components/welcome'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; import InboxNotifications from './inbox-notifications'; import ProgressiveOnboardingEligibilityModal from './modal/progressive-onboarding-eligibility'; import TaskList from './task-list'; import { getTasks, taskSort } from './task-list/tasks'; -import { useDisputes, useGetSettings, useSettings } from 'data'; +import { useDisputes, useGetSettings, useSettings } from 'wcpay/data'; import SandboxModeSwitchToLiveNotice from 'wcpay/components/sandbox-mode-switch-to-live-notice'; import './style.scss'; import BannerNotice from 'wcpay/components/banner-notice'; diff --git a/client/overview/modal/connection-success/test/index.test.tsx b/client/overview/modal/connection-success/test/index.test.tsx index bb328cda08a..2c13a3ef719 100644 --- a/client/overview/modal/connection-success/test/index.test.tsx +++ b/client/overview/modal/connection-success/test/index.test.tsx @@ -8,7 +8,7 @@ import user from '@testing-library/user-event'; /** * Internal dependencies */ -import ConnectionSuccessModal from '../index'; +import ConnectionSuccessModal from '..'; jest.mock( 'wcpay/data/settings/actions', () => ( { saveOption: jest.fn(), diff --git a/client/overview/modal/progressive-onboarding-eligibility/index.tsx b/client/overview/modal/progressive-onboarding-eligibility/index.tsx index 78b721122e1..14641bb789a 100644 --- a/client/overview/modal/progressive-onboarding-eligibility/index.tsx +++ b/client/overview/modal/progressive-onboarding-eligibility/index.tsx @@ -12,7 +12,7 @@ import interpolateComponents from '@automattic/interpolate-components'; * Internal dependencies */ import { trackEligibilityModalClosed } from 'onboarding/tracking'; -import ConfettiAnimation from 'components/confetti-animation'; +import ConfettiAnimation from 'wcpay/components/confetti-animation'; import { saveOption } from 'wcpay/data/settings/actions'; import './style.scss'; diff --git a/client/overview/modal/progressive-onboarding-eligibility/test/index.test.tsx b/client/overview/modal/progressive-onboarding-eligibility/test/index.test.tsx index 533497f38ad..6ccc214cfdb 100644 --- a/client/overview/modal/progressive-onboarding-eligibility/test/index.test.tsx +++ b/client/overview/modal/progressive-onboarding-eligibility/test/index.test.tsx @@ -8,7 +8,7 @@ import user from '@testing-library/user-event'; /** * Internal dependencies */ -import ProgressiveOnboardingEligibilityModal from '../index'; +import ProgressiveOnboardingEligibilityModal from '..'; jest.mock( 'wcpay/data/settings/actions', () => ( { saveOption: jest.fn(), diff --git a/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx b/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx index 39316d8c7b2..60c9bfbe472 100644 --- a/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx +++ b/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx @@ -36,7 +36,7 @@ import { InquirySteps, NotDefendableInquirySteps, } from './dispute-steps'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import WCPaySettingsContext from 'wcpay/settings/wcpay-settings-context'; import './style.scss'; diff --git a/client/payment-details/dispute-details/dispute-notice.tsx b/client/payment-details/dispute-details/dispute-notice.tsx index fc8b9123741..90466a6605c 100644 --- a/client/payment-details/dispute-details/dispute-notice.tsx +++ b/client/payment-details/dispute-details/dispute-notice.tsx @@ -11,7 +11,7 @@ import { createInterpolateElement } from '@wordpress/element'; * Internal dependencies */ import './style.scss'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { reasons } from 'wcpay/disputes/strings'; import { Dispute } from 'wcpay/types/disputes'; import { isInquiry } from 'wcpay/disputes/utils'; diff --git a/client/payment-details/dispute-details/dispute-steps.tsx b/client/payment-details/dispute-details/dispute-steps.tsx index 04927e91cfa..1ab9e801d25 100644 --- a/client/payment-details/dispute-details/dispute-steps.tsx +++ b/client/payment-details/dispute-details/dispute-steps.tsx @@ -16,7 +16,7 @@ import type { Dispute } from 'wcpay/types/disputes'; import { ChargeBillingDetails } from 'wcpay/types/charges'; import { formatExplicitCurrency } from 'multi-currency/interface/functions'; import { formatDateTimeFromTimestamp } from 'wcpay/utils/date-time'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { Accordion, AccordionBody, diff --git a/client/payment-details/order-details/test/index.test.tsx b/client/payment-details/order-details/test/index.test.tsx index 8a5632f0d61..f42a1d023ba 100644 --- a/client/payment-details/order-details/test/index.test.tsx +++ b/client/payment-details/order-details/test/index.test.tsx @@ -90,7 +90,7 @@ const chargeFromOrderMock = { status: 'pending', }; -jest.mock( 'data/index', () => ( { +jest.mock( 'wcpay/data', () => ( { useChargeFromOrder: jest.fn(), useAuthorization: jest.fn(), useTimeline: jest.fn(), diff --git a/client/payment-details/payment-method/detail.js b/client/payment-details/payment-method/detail.js index 4dc35130a32..1f395200adc 100644 --- a/client/payment-details/payment-method/detail.js +++ b/client/payment-details/payment-method/detail.js @@ -7,7 +7,7 @@ /** * Internal dependencies. */ -import Loadable from 'components/loadable'; +import Loadable from 'wcpay/components/loadable'; const PaymentDetailsPaymentMethodDetail = ( props ) => { const { label, children, isLoading } = props; diff --git a/client/payment-details/payment-method/index.js b/client/payment-details/payment-method/index.js index 0f34e09d2a9..6194e68d7ae 100644 --- a/client/payment-details/payment-method/index.js +++ b/client/payment-details/payment-method/index.js @@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies. */ -import Loadable from 'components/loadable'; +import Loadable from 'wcpay/components/loadable'; import BancontactDetails from './bancontact'; import BecsDetails from './becs'; import CardDetails from './card'; diff --git a/client/payment-details/readers/index.js b/client/payment-details/readers/index.js index 1a74b7dcd2e..b63374b182b 100644 --- a/client/payment-details/readers/index.js +++ b/client/payment-details/readers/index.js @@ -16,9 +16,9 @@ import { TableCard } from '@woocommerce/components'; * Internal dependencies */ import { useCardReaderStats } from 'wcpay/data'; -import { TestModeNotice } from 'components/test-mode-notice'; -import Page from 'components/page'; -import DownloadButton from 'components/download-button'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; +import Page from 'wcpay/components/page'; +import DownloadButton from 'wcpay/components/download-button'; import { formatExplicitCurrency, formatExportAmount, diff --git a/client/payment-details/summary/index.tsx b/client/payment-details/summary/index.tsx index 01791038661..9caabc084d2 100644 --- a/client/payment-details/summary/index.tsx +++ b/client/payment-details/summary/index.tsx @@ -30,21 +30,24 @@ import { getChargeChannel, isOnHoldByFraudTools, getBankName, -} from 'utils/charge'; -import isValueTruthy from 'utils/is-value-truthy'; -import PaymentStatusChip from 'components/payment-status-chip'; -import PaymentMethodDetails from 'components/payment-method-details'; -import { HorizontalList, HorizontalListItem } from 'components/horizontal-list'; -import Loadable, { LoadableBlock } from 'components/loadable'; -import riskMappings from 'components/risk-level/strings'; -import OrderLink from 'components/order-link'; +} from 'wcpay/utils/charge'; +import isValueTruthy from 'wcpay/utils/is-value-truthy'; +import PaymentStatusChip from 'wcpay/components/payment-status-chip'; +import PaymentMethodDetails from 'wcpay/components/payment-method-details'; +import { + HorizontalList, + HorizontalListItem, +} from 'wcpay/components/horizontal-list'; +import Loadable, { LoadableBlock } from 'wcpay/components/loadable'; +import riskMappings from 'wcpay/components/risk-level/strings'; +import OrderLink from 'wcpay/components/order-link'; import { formatCurrency, formatExplicitCurrency, } from 'multi-currency/interface/functions'; -import CustomerLink from 'components/customer-link'; -import { ClickTooltip } from 'components/tooltip'; -import DisputeStatusChip from 'components/dispute-status-chip'; +import CustomerLink from 'wcpay/components/customer-link'; +import { ClickTooltip } from 'wcpay/components/tooltip'; +import DisputeStatusChip from 'wcpay/components/dispute-status-chip'; import { getDisputeFeeFormatted, isAwaitingResponse, @@ -62,7 +65,7 @@ import { PaymentIntent } from '../../types/payment-intents'; import MissingOrderNotice from 'wcpay/payment-details/summary/missing-order-notice'; import DisputeAwaitingResponseDetails from '../dispute-details/dispute-awaiting-response-details'; import DisputeResolutionFooter from '../dispute-details/dispute-resolution-footer'; -import ErrorBoundary from 'components/error-boundary'; +import ErrorBoundary from 'wcpay/components/error-boundary'; import RefundModal from 'wcpay/payment-details/summary/refund-modal'; import { formatDateTimeFromString, diff --git a/client/payment-details/timeline/index.js b/client/payment-details/timeline/index.js index ac538a9f846..7cb3eb25f81 100644 --- a/client/payment-details/timeline/index.js +++ b/client/payment-details/timeline/index.js @@ -16,7 +16,7 @@ import { */ import { useTimeline } from 'wcpay/data'; import mapTimelineEvents from './map-events'; -import Loadable, { LoadableBlock } from 'components/loadable'; +import Loadable, { LoadableBlock } from 'wcpay/components/loadable'; import './style.scss'; diff --git a/client/payment-details/timeline/map-events.js b/client/payment-details/timeline/map-events.js index 18a2f6214b5..1b444085fd9 100644 --- a/client/payment-details/timeline/map-events.js +++ b/client/payment-details/timeline/map-events.js @@ -25,7 +25,7 @@ import { formatFX, formatExplicitCurrency, } from 'multi-currency/interface/functions'; -import { formatFee } from 'utils/fees'; +import { formatFee } from 'wcpay/utils/fees'; import { getAdminUrl } from 'wcpay/utils'; import { ShieldIcon } from 'wcpay/icons'; import { fraudOutcomeRulesetMapping, paymentFailureMapping } from './mappings'; diff --git a/client/payment-details/transaction-breakdown/index.tsx b/client/payment-details/transaction-breakdown/index.tsx index e2fa4908cb1..6b6aac18174 100644 --- a/client/payment-details/transaction-breakdown/index.tsx +++ b/client/payment-details/transaction-breakdown/index.tsx @@ -20,7 +20,7 @@ import { FlexItem, } from 'wcpay/components/wp-components-wrapped'; import { TimelineItem } from 'wcpay/data/timeline/types'; -import Loadable, { LoadableBlock } from 'components/loadable'; +import Loadable, { LoadableBlock } from 'wcpay/components/loadable'; import { formatCurrency } from 'multi-currency/interface/functions'; import { useTransactionAmounts } from './hooks'; import FeesBreakdown from './fees-breakdown'; diff --git a/client/settings/deposits/index.js b/client/settings/deposits/index.js index ff99898dd04..f34104571f3 100644 --- a/client/settings/deposits/index.js +++ b/client/settings/deposits/index.js @@ -29,8 +29,8 @@ import { } from '../../data'; import './style.scss'; import { recordEvent } from 'tracks'; -import InlineNotice from 'components/inline-notice'; -import { DepositFailureNotice } from 'components/deposits-overview/deposit-notices'; +import InlineNotice from 'wcpay/components/inline-notice'; +import { DepositFailureNotice } from 'wcpay/components/deposits-overview/deposit-notices'; const daysOfWeek = [ { label: __( 'Monday', 'woocommerce-payments' ), value: 'monday' }, diff --git a/client/settings/express-checkout-settings/__tests__/index.test.js b/client/settings/express-checkout-settings/__tests__/index.test.js index 1334386c1e9..e0522088143 100644 --- a/client/settings/express-checkout-settings/__tests__/index.test.js +++ b/client/settings/express-checkout-settings/__tests__/index.test.js @@ -52,7 +52,7 @@ jest.mock( '@stripe/stripe-js', () => ( { loadStripe: jest.fn().mockReturnValue( null ), } ) ); -jest.mock( 'utils/express-checkout', () => ( { +jest.mock( 'wcpay/utils/express-checkout', () => ( { getExpressCheckoutConfig: jest.fn().mockReturnValue( { publishableKey: '123', accountId: '0001', diff --git a/client/settings/express-checkout-settings/__tests__/payment-request-settings.test.js b/client/settings/express-checkout-settings/__tests__/payment-request-settings.test.js index 459ebf99a42..20982493bb0 100644 --- a/client/settings/express-checkout-settings/__tests__/payment-request-settings.test.js +++ b/client/settings/express-checkout-settings/__tests__/payment-request-settings.test.js @@ -36,7 +36,7 @@ jest.mock( '../../../data', () => ( { jest.mock( '../payment-request-button-preview' ); PaymentRequestButtonPreview.mockImplementation( () => '<>' ); -jest.mock( 'utils/express-checkout', () => ( { +jest.mock( 'wcpay/utils/express-checkout', () => ( { getExpressCheckoutConfig: jest.fn().mockReturnValue( { publishableKey: '123', accountId: '0001', diff --git a/client/settings/express-checkout-settings/general-payment-request-button-settings.js b/client/settings/express-checkout-settings/general-payment-request-button-settings.js index c31016ae3aa..bf8876e5560 100644 --- a/client/settings/express-checkout-settings/general-payment-request-button-settings.js +++ b/client/settings/express-checkout-settings/general-payment-request-button-settings.js @@ -24,7 +24,7 @@ import { useContext } from '@wordpress/element'; import CardBody from '../card-body'; import PaymentRequestButtonPreview from './payment-request-button-preview'; import interpolateComponents from '@automattic/interpolate-components'; -import { getExpressCheckoutConfig } from 'utils/express-checkout'; +import { getExpressCheckoutConfig } from 'wcpay/utils/express-checkout'; import WCPaySettingsContext from '../wcpay-settings-context'; import InlineNotice from 'wcpay/components/inline-notice'; import { diff --git a/client/settings/express-checkout-settings/payment-request-button-preview.js b/client/settings/express-checkout-settings/payment-request-button-preview.js index 0933e9f4a3a..c6a918ae978 100644 --- a/client/settings/express-checkout-settings/payment-request-button-preview.js +++ b/client/settings/express-checkout-settings/payment-request-button-preview.js @@ -10,7 +10,7 @@ import { useStripe } from '@stripe/react-stripe-js'; /** * Internal dependencies */ -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { WoopayExpressCheckoutButton } from 'wcpay/checkout/woopay/express-button/woopay-express-checkout-button'; import { usePaymentRequestButtonSize, diff --git a/client/settings/fraud-protection/advanced-settings/rule-card-notice.tsx b/client/settings/fraud-protection/advanced-settings/rule-card-notice.tsx index 6e567ccfceb..f67653cca39 100644 --- a/client/settings/fraud-protection/advanced-settings/rule-card-notice.tsx +++ b/client/settings/fraud-protection/advanced-settings/rule-card-notice.tsx @@ -8,7 +8,7 @@ import NoticeOutlineIcon from 'gridicons/dist/notice-outline'; * Internal dependencies */ import './../style.scss'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { TipIcon } from 'wcpay/icons'; const supportedTypes = [ 'error', 'warning', 'info' ] as const; diff --git a/client/settings/fraud-protection/components/fp-help-text/test/index.test.tsx b/client/settings/fraud-protection/components/fp-help-text/test/index.test.tsx index 917313e379a..964629ab10a 100644 --- a/client/settings/fraud-protection/components/fp-help-text/test/index.test.tsx +++ b/client/settings/fraud-protection/components/fp-help-text/test/index.test.tsx @@ -7,7 +7,7 @@ import { render } from '@testing-library/react'; /** * Internal dependencies */ -import FraudProtectionHelpText from '../index'; +import FraudProtectionHelpText from '..'; describe( 'FraudProtectionHelpText', () => { it( 'renders standard level help text when level prop equals standard', () => { diff --git a/client/settings/fraud-protection/components/protection-level-modal-notice/test/index.test.tsx b/client/settings/fraud-protection/components/protection-level-modal-notice/test/index.test.tsx index 66dc34eba3a..959c10742e1 100644 --- a/client/settings/fraud-protection/components/protection-level-modal-notice/test/index.test.tsx +++ b/client/settings/fraud-protection/components/protection-level-modal-notice/test/index.test.tsx @@ -7,7 +7,7 @@ import { render } from '@testing-library/react'; /** * Internal dependencies */ -import ProtectionLevelModalNotice from '../index'; +import ProtectionLevelModalNotice from '..'; describe( 'ProtectionLevelModalNotice', () => { it( 'renders the standard notice when the level prop is standard', () => { diff --git a/client/settings/fraud-protection/components/protection-levels/index.tsx b/client/settings/fraud-protection/components/protection-levels/index.tsx index ddaa5d8a562..36f6853a130 100644 --- a/client/settings/fraud-protection/components/protection-levels/index.tsx +++ b/client/settings/fraud-protection/components/protection-levels/index.tsx @@ -16,10 +16,10 @@ import { useSettings, useGetSettings, } from 'wcpay/data'; -import { FraudProtectionHelpText, BasicFraudProtectionModal } from '../index'; +import { FraudProtectionHelpText, BasicFraudProtectionModal } from '..'; import { getAdminUrl } from 'wcpay/utils'; import { ProtectionLevel } from '../../advanced-settings/constants'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; import { recordEvent } from 'tracks'; const ProtectionLevels: React.FC = () => { diff --git a/client/settings/fraud-protection/components/protection-levels/test/index.test.tsx b/client/settings/fraud-protection/components/protection-levels/test/index.test.tsx index d623b7d128a..24896be24ef 100644 --- a/client/settings/fraud-protection/components/protection-levels/test/index.test.tsx +++ b/client/settings/fraud-protection/components/protection-levels/test/index.test.tsx @@ -7,7 +7,7 @@ import { render } from '@testing-library/react'; /** * Internal dependencies */ -import ProtectionLevels from '../index'; +import ProtectionLevels from '..'; import { FraudProtectionRule } from 'wcpay/settings/fraud-protection/interfaces'; declare const global: { diff --git a/client/settings/payment-methods-list/payment-method.tsx b/client/settings/payment-methods-list/payment-method.tsx index 09448e293f6..ac220c914c8 100644 --- a/client/settings/payment-methods-list/payment-method.tsx +++ b/client/settings/payment-methods-list/payment-method.tsx @@ -10,7 +10,7 @@ import { CheckboxControl } from 'wcpay/components/wp-components-wrapped'; * Internal dependencies */ import { __, sprintf } from '@wordpress/i18n'; -import { HoverTooltip } from 'components/tooltip'; +import { HoverTooltip } from 'wcpay/components/tooltip'; import { FeeStructure } from 'wcpay/types/fees'; import { formatMethodFeesDescription, diff --git a/client/settings/transactions/manual-capture-control.tsx b/client/settings/transactions/manual-capture-control.tsx index b8935635cc6..66c17e07244 100644 --- a/client/settings/transactions/manual-capture-control.tsx +++ b/client/settings/transactions/manual-capture-control.tsx @@ -21,7 +21,7 @@ import { import './style.scss'; import ConfirmationModal from 'wcpay/components/confirmation-modal'; import interpolateComponents from '@automattic/interpolate-components'; -import InlineNotice from 'components/inline-notice'; +import InlineNotice from 'wcpay/components/inline-notice'; const ManualCaptureControl = (): JSX.Element => { const [ diff --git a/client/transactions/autocompleter.tsx b/client/transactions/autocompleter.tsx index 4f53b0d0044..927e837808b 100644 --- a/client/transactions/autocompleter.tsx +++ b/client/transactions/autocompleter.tsx @@ -10,7 +10,7 @@ import interpolateComponents from '@automattic/interpolate-components'; /** * Internal dependencies */ -import computeSuggestionMatch from 'utils/compute-suggestion-match'; +import computeSuggestionMatch from 'wcpay/utils/compute-suggestion-match'; /** * @typedef {Object} Completer diff --git a/client/transactions/blocked/index.tsx b/client/transactions/blocked/index.tsx index a7fca85cc7c..c3467746f46 100644 --- a/client/transactions/blocked/index.tsx +++ b/client/transactions/blocked/index.tsx @@ -27,7 +27,7 @@ import { FraudOutcomeTransaction, useFraudOutcomeTransactions, useFraudOutcomeTransactionsSummary, -} from 'data/index'; +} from 'wcpay/data'; import Page from '../../components/page'; import { recordEvent } from 'tracks'; import { diff --git a/client/transactions/fraud-protection/autocompleter.tsx b/client/transactions/fraud-protection/autocompleter.tsx index 301708fc0b4..f969e24adf3 100644 --- a/client/transactions/fraud-protection/autocompleter.tsx +++ b/client/transactions/fraud-protection/autocompleter.tsx @@ -8,7 +8,7 @@ import apiFetch from '@wordpress/api-fetch'; /** * Internal dependencies */ -import computeSuggestionMatch from 'utils/compute-suggestion-match'; +import computeSuggestionMatch from 'wcpay/utils/compute-suggestion-match'; /** * @typedef {Object} Completer diff --git a/client/transactions/index.tsx b/client/transactions/index.tsx index 0693326611f..ec5dbd3f081 100644 --- a/client/transactions/index.tsx +++ b/client/transactions/index.tsx @@ -11,9 +11,9 @@ import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ -import Page from 'components/page'; +import Page from 'wcpay/components/page'; import TransactionsList from './list'; -import { TestModeNotice } from 'components/test-mode-notice'; +import { TestModeNotice } from 'wcpay/components/test-mode-notice'; import Authorizations from './uncaptured'; import './style.scss'; import { diff --git a/client/transactions/list/deposit.tsx b/client/transactions/list/deposit.tsx index a2e3875e39d..691c7358d22 100644 --- a/client/transactions/list/deposit.tsx +++ b/client/transactions/list/deposit.tsx @@ -13,8 +13,8 @@ import InfoOutlineIcon from 'gridicons/dist/info-outline'; /** * Internal dependencies */ -import { getAdminUrl } from 'utils'; -import { ClickTooltip } from 'components/tooltip'; +import { getAdminUrl } from 'wcpay/utils'; +import { ClickTooltip } from 'wcpay/components/tooltip'; import { formatDateTimeFromString } from 'wcpay/utils/date-time'; interface DepositProps { diff --git a/client/transactions/list/test/index.tsx b/client/transactions/list/test/index.tsx index 19f8e599401..dc6647b441a 100644 --- a/client/transactions/list/test/index.tsx +++ b/client/transactions/list/test/index.tsx @@ -16,8 +16,8 @@ import { PAYMENT_METHOD_BRANDS } from 'wcpay/constants/payment-method'; */ import { getUserTimeZone } from 'jest-utils/timezone'; import { TransactionsList } from '..'; -import { useTransactions, useTransactionsSummary } from 'data'; -import type { Transaction } from 'data/transactions/hooks'; +import { useTransactions, useTransactionsSummary } from 'wcpay/data'; +import type { Transaction } from 'wcpay/data/transactions/hooks'; jest.mock( '@woocommerce/data', () => { const actualModule = jest.requireActual( '@woocommerce/data' ); @@ -46,7 +46,7 @@ jest.mock( '@wordpress/data', () => ( { withSelect: jest.fn( () => jest.fn() ), } ) ); -jest.mock( 'data/index', () => ( { +jest.mock( 'wcpay/data', () => ( { useTransactions: jest.fn(), useTransactionsSummary: jest.fn(), } ) ); diff --git a/client/transactions/risk-review/columns.tsx b/client/transactions/risk-review/columns.tsx index 007ee142c41..5d18f789d5d 100644 --- a/client/transactions/risk-review/columns.tsx +++ b/client/transactions/risk-review/columns.tsx @@ -9,8 +9,8 @@ import { Button } from 'wcpay/components/wp-components-wrapped'; /** * Internal dependencies */ -import { getDetailsURL } from 'components/details-link'; -import ClickableCell from 'components/clickable-cell'; +import { getDetailsURL } from 'wcpay/components/details-link'; +import ClickableCell from 'wcpay/components/clickable-cell'; import { formatExplicitCurrency } from 'multi-currency/interface/functions'; import { recordEvent } from 'tracks'; import TransactionStatusPill from 'wcpay/components/transaction-status-pill'; diff --git a/client/transactions/risk-review/index.tsx b/client/transactions/risk-review/index.tsx index 7101552e452..f568c6a8af3 100644 --- a/client/transactions/risk-review/index.tsx +++ b/client/transactions/risk-review/index.tsx @@ -27,7 +27,7 @@ import { FraudOutcomeTransaction, useFraudOutcomeTransactions, useFraudOutcomeTransactionsSummary, -} from 'data/index'; +} from 'wcpay/data'; import Page from '../../components/page'; import { recordEvent } from 'tracks'; import { diff --git a/client/transactions/test/index.tsx b/client/transactions/test/index.tsx index 7b915d64798..6b151ed4cd8 100644 --- a/client/transactions/test/index.tsx +++ b/client/transactions/test/index.tsx @@ -19,7 +19,7 @@ import { useSettings, useTransactions, useTransactionsSummary, -} from 'data/index'; +} from 'wcpay/data'; jest.mock( '@wordpress/api-fetch', () => jest.fn() ); @@ -39,7 +39,7 @@ jest.mock( '@wordpress/data', () => ( { withSelect: jest.fn( () => jest.fn() ), } ) ); -jest.mock( 'data/index', () => ( { +jest.mock( 'wcpay/data', () => ( { useTransactions: jest.fn(), useTransactionsSummary: jest.fn(), useFraudOutcomeTransactionsSummary: jest.fn(), diff --git a/client/transactions/uncaptured/index.tsx b/client/transactions/uncaptured/index.tsx index dad94b2f409..fbbaa164c88 100644 --- a/client/transactions/uncaptured/index.tsx +++ b/client/transactions/uncaptured/index.tsx @@ -12,12 +12,12 @@ import moment from 'moment'; /** * Internal dependencies */ -import { useAuthorizations, useAuthorizationsSummary } from 'data/index'; +import { useAuthorizations, useAuthorizationsSummary } from 'wcpay/data'; import Page from '../../components/page'; -import { getDetailsURL } from 'components/details-link'; -import ClickableCell from 'components/clickable-cell'; +import { getDetailsURL } from 'wcpay/components/details-link'; +import ClickableCell from 'wcpay/components/clickable-cell'; import { formatExplicitCurrency } from 'multi-currency/interface/functions'; -import RiskLevel, { calculateRiskMapping } from 'components/risk-level'; +import RiskLevel, { calculateRiskMapping } from 'wcpay/components/risk-level'; import { recordEvent } from 'tracks'; import CaptureAuthorizationButton from 'wcpay/components/capture-authorization-button'; import { formatDateTimeFromString } from 'wcpay/utils/date-time'; diff --git a/client/transactions/uncaptured/test/index.test.tsx b/client/transactions/uncaptured/test/index.test.tsx index 3dcd72f727e..19c47b00154 100644 --- a/client/transactions/uncaptured/test/index.test.tsx +++ b/client/transactions/uncaptured/test/index.test.tsx @@ -13,7 +13,7 @@ import { useUserPreferences } from '@woocommerce/data'; * Internal dependencies */ import Authorizations, { AuthorizationsList } from '..'; -import { useAuthorizations, useAuthorizationsSummary } from 'data/index'; +import { useAuthorizations, useAuthorizationsSummary } from 'wcpay/data'; import { Authorization } from 'wcpay/types/authorizations'; // Workaround for mocking @wordpress/data. @@ -31,7 +31,7 @@ jest.mock( '@wordpress/data', () => ( { withSelect: jest.fn( () => jest.fn() ), } ) ); -jest.mock( 'data/index', () => ( { +jest.mock( 'wcpay/data', () => ( { useAuthorizations: jest.fn(), useAuthorizationsSummary: jest.fn(), useAuthorization: jest.fn( () => ( { diff --git a/client/utils/account-fees.tsx b/client/utils/account-fees.tsx index 8ba7dddd1c0..f259a1be00c 100644 --- a/client/utils/account-fees.tsx +++ b/client/utils/account-fees.tsx @@ -11,7 +11,7 @@ import './account-fees.scss'; * Internal dependencies */ import { formatCurrency } from 'multi-currency/interface/functions'; -import { formatFee } from 'utils/fees'; +import { formatFee } from 'wcpay/utils/fees'; import React from 'react'; import { BaseFee, DiscountFee, FeeStructure } from 'wcpay/types/fees'; import { createInterpolateElement } from '@wordpress/element'; diff --git a/client/utils/fees/index.test.ts b/client/utils/fees/index.test.ts index a7c68aa1d46..acbb45e7045 100644 --- a/client/utils/fees/index.test.ts +++ b/client/utils/fees/index.test.ts @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import { formatFee } from 'utils/fees'; +import { formatFee } from 'wcpay/utils/fees'; describe( 'Fees utilities', () => { it.each( [ diff --git a/client/utils/test/index.js b/client/utils/test/index.js index 0d70f59dae1..ab18f45d783 100644 --- a/client/utils/test/index.js +++ b/client/utils/test/index.js @@ -7,7 +7,7 @@ import { getDocumentUrl, getPaymentMethodSettingsUrl, isVersionGreaterOrEqual, -} from '../index'; +} from '..'; describe( 'Utilities', () => { test( 'payment method settings link matches expected', () => { diff --git a/webpack/shared.js b/webpack/shared.js index 6b563242f51..430ce43ec78 100644 --- a/webpack/shared.js +++ b/webpack/shared.js @@ -112,7 +112,6 @@ module.exports = { resolve: { extensions: [ '.ts', '.tsx', '.json', '.js', '.jsx' ], modules: [ - path.join( process.cwd(), 'client' ), path.join( process.cwd(), 'includes/multi-currency/client' ), 'node_modules', ],