diff --git a/framework/spree/api/endpoints/checkout/index.ts b/framework/spree/api/endpoints/checkout/index.ts index 47b315728..57831789c 100644 --- a/framework/spree/api/endpoints/checkout/index.ts +++ b/framework/spree/api/endpoints/checkout/index.ts @@ -3,8 +3,8 @@ import type { CommerceAPI } from '@commerce/api' import type { GetAPISchema } from '@commerce/api' import checkoutEndpoint from '@commerce/api/endpoints/checkout' import type { CheckoutSchema } from '@commerce/types/checkout' -import type { SpreeApiProvider } from '@framework/api' import checkout from './checkout' +import { SpreeApiProvider } from '../..' export type CheckoutAPI = GetAPISchema< CommerceAPI, diff --git a/framework/spree/api/operations/get-all-product-paths.ts b/framework/spree/api/operations/get-all-product-paths.ts index 6ea081bb3..12ebd35f7 100644 --- a/framework/spree/api/operations/get-all-product-paths.ts +++ b/framework/spree/api/operations/get-all-product-paths.ts @@ -4,9 +4,9 @@ import type { } from '@commerce/api/operations' import type { Product } from '@commerce/types/product' import type { GetAllProductPathsOperation } from '@commerce/types/product' -import { requireConfigValue } from '@framework/isomorphic-config' -import type { IProductsSlugs, SpreeSdkVariables } from '@framework/types' -import getProductPath from '@framework/utils/get-product-path' +import { requireConfigValue } from '../../isomorphic-config' +import type { IProductsSlugs, SpreeSdkVariables } from '../../types' +import getProductPath from '../../utils/get-product-path' import type { SpreeApiConfig, SpreeApiProvider } from '..' export default function getAllProductPathsOperation({ diff --git a/framework/spree/api/operations/get-all-products.ts b/framework/spree/api/operations/get-all-products.ts index 3d03a6276..8ccfe81c2 100644 --- a/framework/spree/api/operations/get-all-products.ts +++ b/framework/spree/api/operations/get-all-products.ts @@ -7,7 +7,7 @@ import type { import type { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' import type { SpreeApiConfig, SpreeApiProvider } from '../index' import type { SpreeSdkVariables } from 'framework/spree/types' -import normalizeProduct from '@framework/utils/normalize-product' +import normalizeProduct from '../../utils/normalize-product' export default function getAllProductsOperation({ commerce, diff --git a/framework/spree/api/operations/get-product.ts b/framework/spree/api/operations/get-product.ts index a88ac479e..12419f8a8 100644 --- a/framework/spree/api/operations/get-product.ts +++ b/framework/spree/api/operations/get-product.ts @@ -7,7 +7,7 @@ import type { import type { IProduct } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' import type { SpreeSdkVariables } from 'framework/spree/types' import MissingSlugVariableError from 'framework/spree/errors/MissingSlugVariableError' -import normalizeProduct from '@framework/utils/normalize-product' +import normalizeProduct from '../../utils/normalize-product' export default function getProductOperation({ commerce, diff --git a/framework/spree/api/operations/get-site-info.ts b/framework/spree/api/operations/get-site-info.ts index 5b4ba4bf7..1ac83d46b 100644 --- a/framework/spree/api/operations/get-site-info.ts +++ b/framework/spree/api/operations/get-site-info.ts @@ -7,7 +7,7 @@ import type { ITaxons, TaxonAttr, } from '@spree/storefront-api-v2-sdk/types/interfaces/Taxon' -import { requireConfigValue } from '@framework/isomorphic-config' +import { requireConfigValue } from '../../isomorphic-config' import type { SpreeSdkVariables } from 'framework/spree/types' import type { SpreeApiConfig, SpreeApiProvider } from '..' diff --git a/framework/spree/api/utils/create-api-fetch.ts b/framework/spree/api/utils/create-api-fetch.ts index c4babcc83..e79537eab 100644 --- a/framework/spree/api/utils/create-api-fetch.ts +++ b/framework/spree/api/utils/create-api-fetch.ts @@ -1,17 +1,17 @@ import { SpreeApiConfig } from '..' import { errors, makeClient } from '@spree/storefront-api-v2-sdk' -import { requireConfigValue } from '@framework/isomorphic-config' -import convertSpreeErrorToGraphQlError from '@framework/utils/convert-spree-error-to-graph-ql-error' +import { requireConfigValue } from '../../isomorphic-config' +import convertSpreeErrorToGraphQlError from '../../utils/convert-spree-error-to-graph-ql-error' import type { ResultResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/ResultResponse' import type { JsonApiListResponse, JsonApiSingleResponse, } from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi' -import getSpreeSdkMethodFromEndpointPath from '@framework/utils/get-spree-sdk-method-from-endpoint-path' +import getSpreeSdkMethodFromEndpointPath from '../../utils/get-spree-sdk-method-from-endpoint-path' import { SpreeSdkVariables } from 'framework/spree/types' import SpreeSdkMethodFromEndpointPathError from 'framework/spree/errors/SpreeSdkMethodFromEndpointPathError' import { GraphQLFetcher, GraphQLFetcherResult } from '@commerce/api' -import createCustomizedFetchFetcher from '@framework/utils/create-customized-fetch-fetcher' +import createCustomizedFetchFetcher from '../../utils/create-customized-fetch-fetcher' import fetch, { Request } from 'node-fetch' const createApiFetch: ( diff --git a/framework/spree/cart/use-add-item.tsx b/framework/spree/cart/use-add-item.tsx index 8144baa06..7996e99a6 100644 --- a/framework/spree/cart/use-add-item.tsx +++ b/framework/spree/cart/use-add-item.tsx @@ -4,12 +4,12 @@ import type { MutationHook } from '@commerce/utils/types' import { useCallback } from 'react' import useCart from './use-cart' import type { AddItemHook } from '@commerce/types/cart' -import normalizeCart from '@framework/utils/normalize-cart' +import normalizeCart from '../utils/normalize-cart' import type { GraphQLFetcherResult } from '@commerce/api' import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' import type { AddItem } from '@spree/storefront-api-v2-sdk/types/interfaces/endpoints/CartClass' -import getCartToken from '@framework/utils/get-cart-token' +import getCartToken from '../utils/get-cart-token' export default useAddItem as UseAddItem diff --git a/framework/spree/cart/use-cart.tsx b/framework/spree/cart/use-cart.tsx index e51e01ffd..eb04d6334 100644 --- a/framework/spree/cart/use-cart.tsx +++ b/framework/spree/cart/use-cart.tsx @@ -3,11 +3,11 @@ import type { SWRHook } from '@commerce/utils/types' import useCart from '@commerce/cart/use-cart' import type { UseCart } from '@commerce/cart/use-cart' import type { GetCartHook } from '@commerce/types/cart' -import normalizeCart from '@framework/utils/normalize-cart' +import normalizeCart from '../utils/normalize-cart' import type { GraphQLFetcherResult } from '@commerce/api' import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' -import setCartToken from '@framework/utils/set-cart-token' +import setCartToken from '../utils/set-cart-token' import { FetcherError } from '@commerce/utils/errors' export default useCart as UseCart diff --git a/framework/spree/cart/use-remove-item.tsx b/framework/spree/cart/use-remove-item.tsx index eaa482727..627a693cc 100644 --- a/framework/spree/cart/use-remove-item.tsx +++ b/framework/spree/cart/use-remove-item.tsx @@ -4,11 +4,11 @@ import type { UseRemoveItem } from '@commerce/cart/use-remove-item' import type { RemoveItemHook } from '@commerce/types/cart' import useCart from './use-cart' import { useCallback } from 'react' -import normalizeCart from '@framework/utils/normalize-cart' +import normalizeCart from '../utils/normalize-cart' import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' import type { GraphQLFetcherResult } from '@commerce/api' import type { IQuery } from '@spree/storefront-api-v2-sdk/types/interfaces/Query' -import getCartToken from '@framework/utils/get-cart-token' +import getCartToken from '../utils/get-cart-token' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' export default useRemoveItem as UseRemoveItem diff --git a/framework/spree/cart/use-update-item.tsx b/framework/spree/cart/use-update-item.tsx index 0ae82b104..ccbd9dc71 100644 --- a/framework/spree/cart/use-update-item.tsx +++ b/framework/spree/cart/use-update-item.tsx @@ -6,10 +6,10 @@ import { useCallback } from 'react' import { ValidationError } from '@commerce/utils/errors' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' import type { SetQuantity } from '@spree/storefront-api-v2-sdk/types/interfaces/endpoints/CartClass' -import getCartToken from '@framework/utils/get-cart-token' +import getCartToken from '../utils/get-cart-token' import type { GraphQLFetcherResult } from '@commerce/api' import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' -import normalizeCart from '@framework/utils/normalize-cart' +import normalizeCart from '../utils/normalize-cart' import debounce from 'lodash.debounce' export default useUpdateItem as UseUpdateItem diff --git a/framework/spree/utils/get-cart-token.ts b/framework/spree/utils/get-cart-token.ts index 72fbe2618..b38337cb1 100644 --- a/framework/spree/utils/get-cart-token.ts +++ b/framework/spree/utils/get-cart-token.ts @@ -1,4 +1,4 @@ -import { requireConfigValue } from '@framework/isomorphic-config' +import { requireConfigValue } from '../isomorphic-config' import Cookies from 'js-cookie' const getCartToken = () => diff --git a/framework/spree/utils/get-product-path.ts b/framework/spree/utils/get-product-path.ts index ee5d0b0fe..b4c03096f 100644 --- a/framework/spree/utils/get-product-path.ts +++ b/framework/spree/utils/get-product-path.ts @@ -1,4 +1,4 @@ -import type { ProductSlugAttr } from '@framework/types' +import type { ProductSlugAttr } from '../types' const getProductPath = (partialSpreeProduct: ProductSlugAttr): string => { return `/${partialSpreeProduct.attributes.slug}` diff --git a/framework/spree/utils/normalize-cart.ts b/framework/spree/utils/normalize-cart.ts index 3d0f8f9eb..668fe70a0 100644 --- a/framework/spree/utils/normalize-cart.ts +++ b/framework/spree/utils/normalize-cart.ts @@ -4,8 +4,8 @@ import type { ProductVariant, SelectedOption, } from '@commerce/types/cart' -import MissingLineItemVariantError from '@framework/errors/MissingLineItemVariantError' -import { requireConfigValue } from '@framework/isomorphic-config' +import MissingLineItemVariantError from '../errors/MissingLineItemVariantError' +import { requireConfigValue } from '../isomorphic-config' import type { JsonApiListResponse, JsonApiSingleResponse, @@ -16,11 +16,7 @@ import type { RelationType } from '@spree/storefront-api-v2-sdk/types/interfaces import createGetAbsoluteImageUrl from './create-get-absolute-image-url' import getMediaGallery from './get-media-gallery' import { findIncluded, findIncludedOfType } from './find-json-api-documents' -import type { - LineItemAttr, - OptionTypeAttr, - VariantAttr, -} from '@framework/types' +import type { LineItemAttr, OptionTypeAttr, VariantAttr } from '../types' import type { Image } from '@commerce/types/common' const placeholderImage = requireConfigValue('lineItemPlaceholderImageUrl') as diff --git a/framework/spree/utils/normalize-product.ts b/framework/spree/utils/normalize-product.ts index 28325943e..d63b94d30 100644 --- a/framework/spree/utils/normalize-product.ts +++ b/framework/spree/utils/normalize-product.ts @@ -11,13 +11,13 @@ import type { } from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi' import type { ProductAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' import type { RelationType } from '@spree/storefront-api-v2-sdk/types/interfaces/Relationships' -import { requireConfigValue } from '@framework/isomorphic-config' +import { requireConfigValue } from '../isomorphic-config' import createGetAbsoluteImageUrl from './create-get-absolute-image-url' import expandOptions from './expand-options' import getMediaGallery from './get-media-gallery' import { findIncluded, findIncludedOfType } from './find-json-api-documents' import getProductPath from './get-product-path' -import MissingPrimaryVariantError from '@framework/errors/MissingPrimaryVariantError' +import MissingPrimaryVariantError from '../errors/MissingPrimaryVariantError' const placeholderImage = requireConfigValue('productPlaceholderImageUrl') as | string diff --git a/framework/spree/utils/set-cart-token.ts b/framework/spree/utils/set-cart-token.ts index 6cffc1e79..7463aea69 100644 --- a/framework/spree/utils/set-cart-token.ts +++ b/framework/spree/utils/set-cart-token.ts @@ -1,4 +1,4 @@ -import { requireConfigValue } from '@framework/isomorphic-config' +import { requireConfigValue } from '../isomorphic-config' import Cookies from 'js-cookie' const setCartToken = (cartToken: string) => {