Skip to content

update: ensure prefix in Webpack include path #10898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/update-webpack-include-path-ensure-wcpay-prefix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

update: ensure that the `wcpay` prefix is included in the Webpack include path
14 changes: 7 additions & 7 deletions client/capital/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/capital/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => ( {
Expand Down
2 changes: 1 addition & 1 deletion client/card-readers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion client/cart/blocks/product-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/checkout/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/checkout/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion client/checkout/upe-styles/test/index.js
Original file line number Diff line number Diff line change
@@ -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' );
Expand Down
2 changes: 1 addition & 1 deletion client/checkout/woopay/direct-checkout/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ global.$ = jest.fn( () => ( {
},
} ) );

require( '../index.js' );
require( '..' );

describe( 'WooPay direct checkout window "load" event listener', () => {
beforeEach( () => {
Expand Down
2 changes: 1 addition & 1 deletion client/checkout/woopay/email-input-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/checkout/woopay/express-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
} ) );

Expand Down
6 changes: 3 additions & 3 deletions client/checkout/woopay/express-button/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
} ) );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () =>
Expand All @@ -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(),
} ) );

Expand Down
2 changes: 1 addition & 1 deletion client/components/account-balances/balance-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions client/components/account-balances/balance-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ( {
Expand Down
2 changes: 1 addition & 1 deletion client/components/account-status/account-fees/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { render } from '@testing-library/react';
/**
* Internal dependencies
*/
import AccountFees from '../index';
import AccountFees from '..';

describe( 'AccountFees', () => {
const renderAccountFees = ( accountFees ) => {
Expand Down
4 changes: 2 additions & 2 deletions client/components/account-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/components/account-status/status-chip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) => {
Expand Down
2 changes: 1 addition & 1 deletion client/components/active-loan-summary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion client/components/deposit-status-chip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion client/components/deposits-overview/deposit-notices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down
2 changes: 1 addition & 1 deletion client/components/deposits-overview/deposit-schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion client/components/deposits-overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions client/components/deposits-overview/recent-deposits-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/components/deposits-status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion client/components/disputed-order-notice/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => ( {
Expand Down
2 changes: 1 addition & 1 deletion client/components/file-upload/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion client/components/payments-status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() } ),
Expand Down
2 changes: 1 addition & 1 deletion client/components/test-mode-notice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions client/components/test-mode-notice/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 > };
Expand All @@ -19,7 +19,7 @@ declare const global: {
};
};

jest.mock( 'utils', () => ( {
jest.mock( 'wcpay/utils', () => ( {
isInTestMode: jest.fn(),
getPaymentSettingsUrl: jest.fn().mockReturnValue( 'https://example.com/' ),
} ) );
Expand Down
2 changes: 1 addition & 1 deletion client/components/tip-box/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion client/components/transaction-status-pill/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down
2 changes: 1 addition & 1 deletion client/components/welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading
Loading