Skip to content

Commit

Permalink
chore: correct the imports and exports of the cart model
Browse files Browse the repository at this point in the history
  • Loading branch information
YahiaElTai committed Jan 24, 2025
1 parent 07f7be2 commit 775a1b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion models/cart/src/cart/cart-draft/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
CompatCartModelBuilder,
} from './builders';
import * as modelPresets from './presets';
export * as constants from '../constants';

export const CartDraftRest = {
random: RestModelBuilder,
Expand Down
15 changes: 9 additions & 6 deletions models/cart/src/cart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ import {
GraphqlModelBuilder,
CompatCartModelBuilder,
} from './builders';
import * as constants from './constants';
import * as modelPresets from './presets';

export * as Cart from '.';

export * as constants from './constants';
export * from './types';

export const CartRest = {
random: RestModelBuilder,
Expand All @@ -23,5 +20,11 @@ export const CartGraphql = {
/**
* @deprecated Use `CartRest` or `CartGraphql` exported models instead of `Cart`.
*/
export const random = CompatCartModelBuilder;
export const presets = modelPresets.default;
export const Cart = {
random: CompatCartModelBuilder,
presets: modelPresets.default,
/**
* @deprecated Import `constants` directly from this package root instead of accessing them via the `Cart` model.
*/
constants,
};
2 changes: 1 addition & 1 deletion models/cart/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export * from './cart/types';
export * from './line-item/types';

// Export models
export * as Cart from './cart';
export * from './cart';
export * from './cart/cart-draft';
export * as CustomLineItem from './custom-line-item';
export * as CustomLineItemDraft from './custom-line-item/custom-line-item-draft';
Expand Down

0 comments on commit 775a1b6

Please sign in to comment.