Skip to content

Commit

Permalink
feat(commerce): isolate core commerce controllers (#3540)
Browse files Browse the repository at this point in the history
isolate core commerce controllers
  • Loading branch information
Spuffynism authored Jan 24, 2024
1 parent a3db3e2 commit cc98717
Show file tree
Hide file tree
Showing 41 changed files with 43 additions and 43 deletions.
14 changes: 7 additions & 7 deletions packages/headless/src/commerce.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type {
Pagination,
PaginationState,
PaginationControllerState,
} from './controllers/commerce/pagination/core/headless-core-commerce-pagination';
} from './controllers/commerce/core/pagination/headless-core-commerce-pagination';
export {buildProductListingPagination} from './controllers/commerce/product-listing/pagination/headless-product-listing-pagination';
export {buildSearchPagination} from './controllers/commerce/search/pagination/headless-search-pagination';

Expand Down Expand Up @@ -84,20 +84,20 @@ export type {
SortInitialState,
Sort,
SortState,
} from './controllers/commerce/sort/core/headless-core-commerce-sort';
} from './controllers/commerce/core/sort/headless-core-commerce-sort';
export {
buildRelevanceSortCriterion,
buildFieldsSortCriterion,
SortBy,
SortDirection,
} from './controllers/commerce/sort/core/headless-core-commerce-sort';
} from './controllers/commerce/core/sort/headless-core-commerce-sort';

export {buildProductListingSort} from './controllers/commerce/product-listing/sort/headless-product-listing-sort';
export {buildSearchSort} from './controllers/commerce/search/sort/headless-search-sort';

export type {CommerceRegularFacet} from './controllers/commerce/facets/core/regular/headless-commerce-regular-facet';
export type {CommerceNumericFacet} from './controllers/commerce/facets/core/numeric/headless-commerce-numeric-facet';
export type {CommerceDateFacet} from './controllers/commerce/facets/core/date/headless-commerce-date-facet';
export type {CommerceRegularFacet} from './controllers/commerce/core/facets/regular/headless-commerce-regular-facet';
export type {CommerceNumericFacet} from './controllers/commerce/core/facets/numeric/headless-commerce-numeric-facet';
export type {CommerceDateFacet} from './controllers/commerce/core/facets/date/headless-commerce-date-facet';
export type {
FacetType,
FacetValueRequest,
Expand All @@ -106,7 +106,7 @@ export type {
NumericFacetValue,
DateRangeRequest,
DateFacetValue,
} from './controllers/commerce/facets/core/headless-core-commerce-facet';
} from './controllers/commerce/core/facets/headless-core-commerce-facet';
export type {ProductListingFacetGenerator} from './controllers/commerce/product-listing/facets/headless-product-listing-facet-generator';
export {buildProductListingFacetGenerator} from './controllers/commerce/product-listing/facets/headless-product-listing-facet-generator';
export type {SearchFacetGenerator} from './controllers/commerce/search/facets/headless-search-facet-generator';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {buildMockCommerceDateFacetResponse} from '../../../../test/mock-commerce
import {buildMockCommerceFacetSlice} from '../../../../test/mock-commerce-facet-slice';
import {buildMockCommerceDateFacetValue} from '../../../../test/mock-commerce-facet-value';
import {buildMockCommerceState} from '../../../../test/mock-commerce-state';
import {CommerceDateFacet} from '../../facets/core/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceDateFacet} from '../../core/facets/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {buildProductListingDateFacet} from './headless-product-listing-date-facet';

describe('ProductListingDateFacet', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {loadReducerError} from '../../../../utils/errors';
import {
CommerceDateFacet,
buildCommerceDateFacet,
} from '../../facets/core/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
} from '../../core/facets/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {loadProductListingReducer} from '../utils/load-product-listing-reducers';
import {commonOptions} from './headless-product-listing-facet-options';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {CommerceEngine} from '../../../../app/commerce-engine/commerce-engine';
import {
buildCommerceFacetGenerator,
CommerceFacetGenerator,
} from '../../facets/core/generator/headless-commerce-facet-generator';
} from '../../core/facets/generator/headless-commerce-facet-generator';
import {buildProductListingDateFacet} from './headless-product-listing-date-facet';
import {buildProductListingNumericFacet} from './headless-product-listing-numeric-facet';
import {buildProductListingRegularFacet} from './headless-product-listing-regular-facet';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
CommerceFacetSetSection,
ProductListingV2Section,
} from '../../../../state/state-sections';
import {CoreCommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CoreCommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';

const facetResponseSelector = (
state: ProductListingV2Section & CommerceFacetSetSection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {buildMockCommerceNumericFacetResponse} from '../../../../test/mock-comme
import {buildMockCommerceFacetSlice} from '../../../../test/mock-commerce-facet-slice';
import {buildMockCommerceNumericFacetValue} from '../../../../test/mock-commerce-facet-value';
import {buildMockCommerceState} from '../../../../test/mock-commerce-state';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceNumericFacet} from '../../facets/core/numeric/headless-commerce-numeric-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {CommerceNumericFacet} from '../../core/facets/numeric/headless-commerce-numeric-facet';
import {buildProductListingNumericFacet} from './headless-product-listing-numeric-facet';

describe('ProductListingNumericFacet', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {CommerceEngine} from '../../../../app/commerce-engine/commerce-engine';
import {loadReducerError} from '../../../../utils/errors';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {
CommerceNumericFacet,
buildCommerceNumericFacet,
} from '../../facets/core/numeric/headless-commerce-numeric-facet';
} from '../../core/facets/numeric/headless-commerce-numeric-facet';
import {loadProductListingReducer} from '../utils/load-product-listing-reducers';
import {commonOptions} from './headless-product-listing-facet-options';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {buildMockCommerceRegularFacetResponse} from '../../../../test/mock-comme
import {buildMockCommerceFacetSlice} from '../../../../test/mock-commerce-facet-slice';
import {buildMockCommerceRegularFacetValue} from '../../../../test/mock-commerce-facet-value';
import {buildMockCommerceState} from '../../../../test/mock-commerce-state';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {buildProductListingRegularFacet} from './headless-product-listing-regular-facet';

describe('ProductListingRegularFacet', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {CommerceEngine} from '../../../../app/commerce-engine/commerce-engine';
import {loadReducerError} from '../../../../utils/errors';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {
CommerceRegularFacet,
buildCommerceRegularFacet,
} from '../../facets/core/regular/headless-commerce-regular-facet';
} from '../../core/facets/regular/headless-commerce-regular-facet';
import {loadProductListingReducer} from '../utils/load-product-listing-reducers';
import {commonOptions} from './headless-product-listing-facet-options';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {fetchProductListing} from '../../../../features/commerce/product-listing/product-listing-actions';
import {productListingV2Reducer as productListing} from '../../../../features/commerce/product-listing/product-listing-slice';
import {buildMockCommerceEngine, MockCommerceEngine} from '../../../../test';
import {Pagination} from '../../pagination/core/headless-core-commerce-pagination';
import {Pagination} from '../../core/pagination/headless-core-commerce-pagination';
import {buildProductListingPagination} from './headless-product-listing-pagination';

describe('product listing pagination', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {loadReducerError} from '../../../../utils/errors';
import {
buildCorePagination,
Pagination,
} from '../../pagination/core/headless-core-commerce-pagination';
} from '../../core/pagination/headless-core-commerce-pagination';
import {loadProductListingReducer} from '../utils/load-product-listing-reducers';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {buildMockCommerceEngine, MockCommerceEngine} from '../../../../test';
import {
buildRelevanceSortCriterion,
Sort,
} from '../../sort/core/headless-core-commerce-sort';
} from '../../core/sort/headless-core-commerce-sort';
import {buildProductListingSort} from './headless-product-listing-sort';

describe('headless product listing sort', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Sort,
buildCoreSort,
SortProps,
} from '../../sort/core/headless-core-commerce-sort';
} from '../../core/sort/headless-core-commerce-sort';
import {loadProductListingReducer} from '../utils/load-product-listing-reducers';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {buildMockCommerceDateFacetResponse} from '../../../../test/mock-commerce
import {buildMockCommerceFacetSlice} from '../../../../test/mock-commerce-facet-slice';
import {buildMockCommerceDateFacetValue} from '../../../../test/mock-commerce-facet-value';
import {buildMockCommerceState} from '../../../../test/mock-commerce-state';
import {CommerceDateFacet} from '../../facets/core/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceDateFacet} from '../../core/facets/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {buildSearchDateFacet} from './headless-search-date-facet';

describe('SearchDateFacet', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {loadReducerError} from '../../../../utils/errors';
import {
CommerceDateFacet,
buildCommerceDateFacet,
} from '../../facets/core/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
} from '../../core/facets/date/headless-commerce-date-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {loadSearchReducer} from '../utils/load-search-reducers';
import {commonOptions} from './headless-search-facet-options';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {CommerceEngine} from '../../../../app/commerce-engine/commerce-engine';
import {
buildCommerceFacetGenerator,
CommerceFacetGenerator,
} from '../../facets/core/generator/headless-commerce-facet-generator';
} from '../../core/facets/generator/headless-commerce-facet-generator';
import {buildSearchDateFacet} from './headless-search-date-facet';
import {buildSearchNumericFacet} from './headless-search-numeric-facet';
import {buildSearchRegularFacet} from './headless-search-regular-facet';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
CommerceFacetSetSection,
CommerceSearchSection,
} from '../../../../state/state-sections';
import {CoreCommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CoreCommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';

const facetResponseSelector = (
state: CommerceSearchSection & CommerceFacetSetSection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {buildMockCommerceNumericFacetResponse} from '../../../../test/mock-comme
import {buildMockCommerceFacetSlice} from '../../../../test/mock-commerce-facet-slice';
import {buildMockCommerceNumericFacetValue} from '../../../../test/mock-commerce-facet-value';
import {buildMockCommerceState} from '../../../../test/mock-commerce-state';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceNumericFacet} from '../../facets/core/numeric/headless-commerce-numeric-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {CommerceNumericFacet} from '../../core/facets/numeric/headless-commerce-numeric-facet';
import {buildSearchNumericFacet} from './headless-search-numeric-facet';

describe('SearchNumericFacet', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {CommerceEngine} from '../../../../app/commerce-engine/commerce-engine';
import {loadReducerError} from '../../../../utils/errors';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {
CommerceNumericFacet,
buildCommerceNumericFacet,
} from '../../facets/core/numeric/headless-commerce-numeric-facet';
} from '../../core/facets/numeric/headless-commerce-numeric-facet';
import {loadSearchReducer} from '../utils/load-search-reducers';
import {commonOptions} from './headless-search-facet-options';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {buildMockCommerceRegularFacetResponse} from '../../../../test/mock-comme
import {buildMockCommerceFacetSlice} from '../../../../test/mock-commerce-facet-slice';
import {buildMockCommerceRegularFacetValue} from '../../../../test/mock-commerce-facet-value';
import {buildMockCommerceState} from '../../../../test/mock-commerce-state';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {buildSearchRegularFacet} from './headless-search-regular-facet';

describe('SearchRegularFacet', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {CommerceEngine} from '../../../../app/commerce-engine/commerce-engine';
import {loadReducerError} from '../../../../utils/errors';
import {CommerceFacetOptions} from '../../facets/core/headless-core-commerce-facet';
import {CommerceFacetOptions} from '../../core/facets/headless-core-commerce-facet';
import {
CommerceRegularFacet,
buildCommerceRegularFacet,
} from '../../facets/core/regular/headless-commerce-regular-facet';
} from '../../core/facets/regular/headless-commerce-regular-facet';
import {loadSearchReducer} from '../utils/load-search-reducers';
import {commonOptions} from './headless-search-facet-options';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {executeSearch} from '../../../../features/commerce/search/search-actions';
import {commerceSearchReducer as commerceSearch} from '../../../../features/commerce/search/search-slice';
import {buildMockCommerceEngine, MockCommerceEngine} from '../../../../test';
import {Pagination} from '../../pagination/core/headless-core-commerce-pagination';
import {Pagination} from '../../core/pagination/headless-core-commerce-pagination';
import {buildSearchPagination} from './headless-search-pagination';

describe('search pagination', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {loadReducerError} from '../../../../utils/errors';
import {
buildCorePagination,
Pagination,
} from '../../pagination/core/headless-core-commerce-pagination';
} from '../../core/pagination/headless-core-commerce-pagination';
import {loadSearchReducer} from '../utils/load-search-reducers';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {buildMockCommerceEngine, MockCommerceEngine} from '../../../../test';
import {
buildRelevanceSortCriterion,
Sort,
} from '../../sort/core/headless-core-commerce-sort';
} from '../../core/sort/headless-core-commerce-sort';
import {buildSearchSort} from './headless-search-sort';

describe('commerce search sort', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Sort,
buildCoreSort,
SortProps,
} from '../../sort/core/headless-core-commerce-sort';
} from '../../core/sort/headless-core-commerce-sort';
import {loadSearchReducer} from '../utils/load-search-reducers';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
DateRangeRequest,
FacetValueRequest,
NumericRangeRequest,
} from '../../../../controllers/commerce/facets/core/headless-core-commerce-facet';
} from '../../../../controllers/commerce/core/facets/headless-core-commerce-facet';
import {buildMockCommerceFacetRequest} from '../../../../test/mock-commerce-facet-request';
import {
buildMockCommerceDateFacetResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DateRangeRequest,
FacetValueRequest,
NumericRangeRequest,
} from '../../../../controllers/commerce/facets/core/headless-core-commerce-facet';
} from '../../../../controllers/commerce/core/facets/headless-core-commerce-facet';
import {deselectAllBreadcrumbs} from '../../../breadcrumb/breadcrumb-actions';
import {
toggleExcludeFacetValue,
Expand Down

0 comments on commit cc98717

Please sign in to comment.