diff --git a/framework/shopify/api/endpoints/checkout/index.ts b/framework/shopify/api/endpoints/checkout/index.ts index 863564697..64020810d 100644 --- a/framework/shopify/api/endpoints/checkout/index.ts +++ b/framework/shopify/api/endpoints/checkout/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import checkoutEndpoint from '@commerce/api/endpoints/checkout' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' import type { CheckoutSchema } from '../../../types/checkout' import type { ShopifyAPI } from '../..' import getCheckout from './get-checkout' diff --git a/framework/shopify/api/index.ts b/framework/shopify/api/index.ts index 28c7d34b3..7ae6a4206 100644 --- a/framework/shopify/api/index.ts +++ b/framework/shopify/api/index.ts @@ -2,7 +2,7 @@ import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi, -} from '@commerce/api' +} from '@vercel/commerce/api' import { API_URL, diff --git a/framework/shopify/api/operations/get-all-pages.ts b/framework/shopify/api/operations/get-all-pages.ts index 3e94264e7..2f6cc0916 100644 --- a/framework/shopify/api/operations/get-all-pages.ts +++ b/framework/shopify/api/operations/get-all-pages.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetAllPagesQuery, GetAllPagesQueryVariables, diff --git a/framework/shopify/api/operations/get-all-product-paths.ts b/framework/shopify/api/operations/get-all-product-paths.ts index 69182be43..e5a7d2d8e 100644 --- a/framework/shopify/api/operations/get-all-product-paths.ts +++ b/framework/shopify/api/operations/get-all-product-paths.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetAllProductPathsOperation } from '../../types/product' import { GetAllProductPathsQuery, diff --git a/framework/shopify/api/operations/get-all-products.ts b/framework/shopify/api/operations/get-all-products.ts index c3e33f6db..003e27204 100644 --- a/framework/shopify/api/operations/get-all-products.ts +++ b/framework/shopify/api/operations/get-all-products.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetAllProductsOperation } from '../../types/product' import { GetAllProductsQuery, diff --git a/framework/shopify/api/operations/get-page.ts b/framework/shopify/api/operations/get-page.ts index b20ab2a7d..2cea52194 100644 --- a/framework/shopify/api/operations/get-page.ts +++ b/framework/shopify/api/operations/get-page.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { normalizePage } from '../../utils' import type { ShopifyConfig, Provider } from '..' import { diff --git a/framework/shopify/api/operations/get-product.ts b/framework/shopify/api/operations/get-product.ts index 69128855c..1697b0feb 100644 --- a/framework/shopify/api/operations/get-product.ts +++ b/framework/shopify/api/operations/get-product.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetProductOperation } from '../../types/product' import { normalizeProduct, getProductQuery } from '../../utils' import type { ShopifyConfig, Provider } from '..' diff --git a/framework/shopify/api/operations/get-site-info.ts b/framework/shopify/api/operations/get-site-info.ts index 460eeb6fd..6bb6de4b0 100644 --- a/framework/shopify/api/operations/get-site-info.ts +++ b/framework/shopify/api/operations/get-site-info.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetSiteInfoQueryVariables } from '../../../schema' import type { ShopifyConfig, Provider } from '..' import { GetSiteInfoOperation } from '../../types/site' diff --git a/framework/shopify/api/operations/login.ts b/framework/shopify/api/operations/login.ts index 411fe304d..5fad769bd 100644 --- a/framework/shopify/api/operations/login.ts +++ b/framework/shopify/api/operations/login.ts @@ -1,5 +1,5 @@ import type { ServerResponse } from 'http' -import type { OperationContext } from '@commerce/api/operations' +import type { OperationContext } from '@vercel/commerce/api/operations' import type { LoginOperation } from '../../types/login' import type { ShopifyConfig, Provider } from '..' import { diff --git a/framework/shopify/api/utils/fetch-graphql-api.ts b/framework/shopify/api/utils/fetch-graphql-api.ts index c45d57e70..1970db572 100644 --- a/framework/shopify/api/utils/fetch-graphql-api.ts +++ b/framework/shopify/api/utils/fetch-graphql-api.ts @@ -1,4 +1,4 @@ -import type { GraphQLFetcher } from '@commerce/api' +import type { GraphQLFetcher } from '@vercel/commerce/api' import fetch from './fetch' import { API_URL, API_TOKEN } from '../../const' diff --git a/framework/shopify/auth/use-login.tsx b/framework/shopify/auth/use-login.tsx index c007ecbd2..840a007e9 100644 --- a/framework/shopify/auth/use-login.tsx +++ b/framework/shopify/auth/use-login.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useLogin, { UseLogin } from '@commerce/auth/use-login' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' import type { LoginHook } from '../types/login' import useCustomer from '../customer/use-customer' diff --git a/framework/shopify/auth/use-logout.tsx b/framework/shopify/auth/use-logout.tsx index fdba8df84..c37b0fcc9 100644 --- a/framework/shopify/auth/use-logout.tsx +++ b/framework/shopify/auth/use-logout.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import useLogout, { UseLogout } from '@commerce/auth/use-logout' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' import type { LogoutHook } from '../types/logout' import useCustomer from '../customer/use-customer' import customerAccessTokenDeleteMutation from '../utils/mutations/customer-access-token-delete' diff --git a/framework/shopify/auth/use-signup.tsx b/framework/shopify/auth/use-signup.tsx index d214ed252..0c2b691e5 100644 --- a/framework/shopify/auth/use-signup.tsx +++ b/framework/shopify/auth/use-signup.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useSignup, { UseSignup } from '@commerce/auth/use-signup' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' import type { SignupHook } from '../types/signup' import useCustomer from '../customer/use-customer' import { Mutation, MutationCustomerCreateArgs } from '../../schema' diff --git a/framework/shopify/cart/use-add-item.tsx b/framework/shopify/cart/use-add-item.tsx index 377de32d1..5460bd726 100644 --- a/framework/shopify/cart/use-add-item.tsx +++ b/framework/shopify/cart/use-add-item.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item' import type { AddItemHook } from '../types/cart' import useCart from './use-cart' diff --git a/framework/shopify/cart/use-cart.tsx b/framework/shopify/cart/use-cart.tsx index 0b8c6657b..2fe68beef 100644 --- a/framework/shopify/cart/use-cart.tsx +++ b/framework/shopify/cart/use-cart.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import useCommerceCart, { UseCart } from '@commerce/cart/use-cart' +import useCommerceCart, { UseCart } from '@vercel/commerce/cart/use-cart' -import { SWRHook } from '@commerce/utils/types' +import { SWRHook } from '@vercel/commerce/utils/types' import { checkoutToCart } from '../utils' import getCheckoutQuery from '../utils/queries/get-checkout-query' import { GetCartHook } from '../types/cart' diff --git a/framework/shopify/cart/use-remove-item.tsx b/framework/shopify/cart/use-remove-item.tsx index 5037c4999..d04c7c5d2 100644 --- a/framework/shopify/cart/use-remove-item.tsx +++ b/framework/shopify/cart/use-remove-item.tsx @@ -2,9 +2,11 @@ import { useCallback } from 'react' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' import type { Cart, LineItem, RemoveItemHook } from '../types/cart' import useCart from './use-cart' diff --git a/framework/shopify/cart/use-update-item.tsx b/framework/shopify/cart/use-update-item.tsx index 4e074abc4..0e8258a51 100644 --- a/framework/shopify/cart/use-update-item.tsx +++ b/framework/shopify/cart/use-update-item.tsx @@ -3,9 +3,11 @@ import debounce from 'lodash.debounce' import type { HookFetcherContext, MutationHookContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' import useCart from './use-cart' import { handler as removeItemHandler } from './use-remove-item' diff --git a/framework/shopify/checkout/use-checkout.tsx b/framework/shopify/checkout/use-checkout.tsx index 942f85b83..76997be73 100644 --- a/framework/shopify/checkout/use-checkout.tsx +++ b/framework/shopify/checkout/use-checkout.tsx @@ -1,5 +1,7 @@ -import { SWRHook } from '@commerce/utils/types' -import useCheckout, { UseCheckout } from '@commerce/checkout/use-checkout' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' export default useCheckout as UseCheckout<typeof handler> diff --git a/framework/shopify/customer/address/use-add-item.tsx b/framework/shopify/customer/address/use-add-item.tsx index ac9dcd5cf..4f85c8472 100644 --- a/framework/shopify/customer/address/use-add-item.tsx +++ b/framework/shopify/customer/address/use-add-item.tsx @@ -1,5 +1,7 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/address/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/shopify/customer/card/use-add-item.tsx b/framework/shopify/customer/card/use-add-item.tsx index 7e3afa9c5..77d149eff 100644 --- a/framework/shopify/customer/card/use-add-item.tsx +++ b/framework/shopify/customer/card/use-add-item.tsx @@ -1,5 +1,7 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/card/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/shopify/customer/use-customer.tsx b/framework/shopify/customer/use-customer.tsx index 2ddc748fa..6fc9a53a7 100644 --- a/framework/shopify/customer/use-customer.tsx +++ b/framework/shopify/customer/use-customer.tsx @@ -1,6 +1,8 @@ -import useCustomer, { UseCustomer } from '@commerce/customer/use-customer' +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' import type { CustomerHook } from '../types/customer' -import { SWRHook } from '@commerce/utils/types' +import { SWRHook } from '@vercel/commerce/utils/types' import { getCustomerQuery, getCustomerToken } from '../utils' import { GetCustomerQuery, GetCustomerQueryVariables } from '../../schema' diff --git a/framework/shopify/fetcher.ts b/framework/shopify/fetcher.ts index 9a8d2d8d5..64f492620 100644 --- a/framework/shopify/fetcher.ts +++ b/framework/shopify/fetcher.ts @@ -1,4 +1,4 @@ -import { Fetcher } from '@commerce/utils/types' +import { Fetcher } from '@vercel/commerce/utils/types' import { API_TOKEN, API_URL } from './const' import { handleFetchResponse } from './utils' diff --git a/framework/shopify/index.tsx b/framework/shopify/index.tsx index 6a8c6aa8b..51199bbe6 100644 --- a/framework/shopify/index.tsx +++ b/framework/shopify/index.tsx @@ -1,4 +1,7 @@ -import { getCommerceProvider, useCommerce as useCoreCommerce } from '@commerce' +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' import { shopifyProvider, ShopifyProvider } from './provider' export { shopifyProvider } diff --git a/framework/shopify/product/use-price.tsx b/framework/shopify/product/use-price.tsx index 0174faf5e..fd42d7033 100644 --- a/framework/shopify/product/use-price.tsx +++ b/framework/shopify/product/use-price.tsx @@ -1,2 +1,2 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/shopify/product/use-search.tsx b/framework/shopify/product/use-search.tsx index 2915ac9d2..582423e9f 100644 --- a/framework/shopify/product/use-search.tsx +++ b/framework/shopify/product/use-search.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' import { CollectionEdge, diff --git a/framework/shopify/types/cart.ts b/framework/shopify/types/cart.ts index 09410740a..243d369a5 100644 --- a/framework/shopify/types/cart.ts +++ b/framework/shopify/types/cart.ts @@ -1,6 +1,6 @@ -import * as Core from '@commerce/types/cart' +import * as Core from '@vercel/commerce/types/cart' -export * from '@commerce/types/cart' +export * from '@vercel/commerce/types/cart' export type ShopifyCart = {} diff --git a/framework/shopify/types/checkout.ts b/framework/shopify/types/checkout.ts index 4e2412ef6..d139db685 100644 --- a/framework/shopify/types/checkout.ts +++ b/framework/shopify/types/checkout.ts @@ -1 +1 @@ -export * from '@commerce/types/checkout' +export * from '@vercel/commerce/types/checkout' diff --git a/framework/shopify/types/common.ts b/framework/shopify/types/common.ts index b52c33a4d..23b8daa11 100644 --- a/framework/shopify/types/common.ts +++ b/framework/shopify/types/common.ts @@ -1 +1 @@ -export * from '@commerce/types/common' +export * from '@vercel/commerce/types/common' diff --git a/framework/shopify/types/customer.ts b/framework/shopify/types/customer.ts index 427bc0b03..6e66366be 100644 --- a/framework/shopify/types/customer.ts +++ b/framework/shopify/types/customer.ts @@ -1,5 +1,5 @@ -import * as Core from '@commerce/types/customer' +import * as Core from '@vercel/commerce/types/customer' -export * from '@commerce/types/customer' +export * from '@vercel/commerce/types/customer' export type CustomerSchema = Core.CustomerSchema diff --git a/framework/shopify/types/login.ts b/framework/shopify/types/login.ts index 2ebc5157e..ab99bf8cd 100644 --- a/framework/shopify/types/login.ts +++ b/framework/shopify/types/login.ts @@ -1,7 +1,7 @@ -import * as Core from '@commerce/types/login' +import * as Core from '@vercel/commerce/types/login' import type { CustomerAccessTokenCreateInput } from '../../schema' -export * from '@commerce/types/login' +export * from '@vercel/commerce/types/login' export type LoginOperation = Core.LoginOperation & { variables: CustomerAccessTokenCreateInput diff --git a/framework/shopify/types/logout.ts b/framework/shopify/types/logout.ts index 9f0a466af..1de06f8dc 100644 --- a/framework/shopify/types/logout.ts +++ b/framework/shopify/types/logout.ts @@ -1 +1 @@ -export * from '@commerce/types/logout' +export * from '@vercel/commerce/types/logout' diff --git a/framework/shopify/types/page.ts b/framework/shopify/types/page.ts index 2bccfade2..ccbc29f7b 100644 --- a/framework/shopify/types/page.ts +++ b/framework/shopify/types/page.ts @@ -1,5 +1,5 @@ -import * as Core from '@commerce/types/page' -export * from '@commerce/types/page' +import * as Core from '@vercel/commerce/types/page' +export * from '@vercel/commerce/types/page' export type Page = Core.Page diff --git a/framework/shopify/types/product.ts b/framework/shopify/types/product.ts index c776d58fa..72ca02f02 100644 --- a/framework/shopify/types/product.ts +++ b/framework/shopify/types/product.ts @@ -1 +1 @@ -export * from '@commerce/types/product' +export * from '@vercel/commerce/types/product' diff --git a/framework/shopify/types/signup.ts b/framework/shopify/types/signup.ts index 58543c6f6..3f0d1af5a 100644 --- a/framework/shopify/types/signup.ts +++ b/framework/shopify/types/signup.ts @@ -1 +1 @@ -export * from '@commerce/types/signup' +export * from '@vercel/commerce/types/signup' diff --git a/framework/shopify/types/site.ts b/framework/shopify/types/site.ts index bfef69cf9..96a2e476e 100644 --- a/framework/shopify/types/site.ts +++ b/framework/shopify/types/site.ts @@ -1 +1 @@ -export * from '@commerce/types/site' +export * from '@vercel/commerce/types/site' diff --git a/framework/shopify/types/wishlist.ts b/framework/shopify/types/wishlist.ts index 8907fbf82..af92d9f63 100644 --- a/framework/shopify/types/wishlist.ts +++ b/framework/shopify/types/wishlist.ts @@ -1 +1 @@ -export * from '@commerce/types/wishlist' +export * from '@vercel/commerce/types/wishlist' diff --git a/framework/shopify/utils/checkout-create.ts b/framework/shopify/utils/checkout-create.ts index dd5009561..2f681c95d 100644 --- a/framework/shopify/utils/checkout-create.ts +++ b/framework/shopify/utils/checkout-create.ts @@ -13,7 +13,7 @@ import { Mutation, MutationCheckoutCreateArgs, } from '../../schema' -import { FetcherOptions } from '@commerce/utils/types' +import { FetcherOptions } from '@vercel/commerce/utils/types' export const checkoutCreate = async ( fetch: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>, diff --git a/framework/shopify/utils/checkout-to-cart.ts b/framework/shopify/utils/checkout-to-cart.ts index ae5d318a1..97b3f0a21 100644 --- a/framework/shopify/utils/checkout-to-cart.ts +++ b/framework/shopify/utils/checkout-to-cart.ts @@ -1,5 +1,5 @@ import type { Cart } from '../types/cart' -import { CommerceError } from '@commerce/utils/errors' +import { CommerceError } from '@vercel/commerce/utils/errors' import { CheckoutLineItemsAddPayload, diff --git a/framework/shopify/utils/handle-account-activation.ts b/framework/shopify/utils/handle-account-activation.ts index 58f3a00c9..2519590c0 100644 --- a/framework/shopify/utils/handle-account-activation.ts +++ b/framework/shopify/utils/handle-account-activation.ts @@ -1,4 +1,4 @@ -import { FetcherOptions } from '@commerce/utils/types' +import { FetcherOptions } from '@vercel/commerce/utils/types' import throwUserErrors from './throw-user-errors' import { diff --git a/framework/shopify/utils/handle-fetch-response.ts b/framework/shopify/utils/handle-fetch-response.ts index 91d362d7d..927ab54f1 100644 --- a/framework/shopify/utils/handle-fetch-response.ts +++ b/framework/shopify/utils/handle-fetch-response.ts @@ -1,4 +1,4 @@ -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' export function getError(errors: any[] | null, status: number) { errors = errors ?? [{ message: 'Failed to fetch Shopify API' }] diff --git a/framework/shopify/utils/handle-login.ts b/framework/shopify/utils/handle-login.ts index a9da10c57..dda6f6ebe 100644 --- a/framework/shopify/utils/handle-login.ts +++ b/framework/shopify/utils/handle-login.ts @@ -1,4 +1,4 @@ -import { FetcherOptions } from '@commerce/utils/types' +import { FetcherOptions } from '@vercel/commerce/utils/types' import { CustomerAccessTokenCreateInput } from '../../schema' import { setCustomerToken } from './customer-token' import { customerAccessTokenCreateMutation } from './mutations' diff --git a/framework/shopify/utils/throw-user-errors.ts b/framework/shopify/utils/throw-user-errors.ts index 503894d0c..2173b2b40 100644 --- a/framework/shopify/utils/throw-user-errors.ts +++ b/framework/shopify/utils/throw-user-errors.ts @@ -1,4 +1,4 @@ -import { ValidationError } from '@commerce/utils/errors' +import { ValidationError } from '@vercel/commerce/utils/errors' import { CheckoutErrorCode, diff --git a/framework/shopify/wishlist/use-wishlist.tsx b/framework/shopify/wishlist/use-wishlist.tsx index 03d70dc61..c95195040 100644 --- a/framework/shopify/wishlist/use-wishlist.tsx +++ b/framework/shopify/wishlist/use-wishlist.tsx @@ -1,7 +1,7 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if // Shopify doesn't have a wishlist -import { HookFetcher } from '@commerce/utils/types' +import { HookFetcher } from '@vercel/commerce/utils/types' import { Product } from '../../schema' const defaultOpts = {} diff --git a/framework/spree/api/endpoints/checkout/index.ts b/framework/spree/api/endpoints/checkout/index.ts index 0a5ee9e72..2be2a5ded 100644 --- a/framework/spree/api/endpoints/checkout/index.ts +++ b/framework/spree/api/endpoints/checkout/index.ts @@ -1,7 +1,7 @@ -import { createEndpoint } from '@commerce/api' -import type { GetAPISchema, CommerceAPI } from '@commerce/api' -import checkoutEndpoint from '@commerce/api/endpoints/checkout' -import type { CheckoutSchema } from '@commerce/types/checkout' +import { createEndpoint } from '@vercel/commerce/api' +import type { GetAPISchema, CommerceAPI } from '@vercel/commerce/api' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' +import type { CheckoutSchema } from '@vercel/commerce/types/checkout' import getCheckout from './get-checkout' import type { SpreeApiProvider } from '../..' diff --git a/framework/spree/api/index.ts b/framework/spree/api/index.ts index d9ef79e1a..3971ed540 100644 --- a/framework/spree/api/index.ts +++ b/framework/spree/api/index.ts @@ -1,5 +1,5 @@ -import type { CommerceAPI, CommerceAPIConfig } from '@commerce/api' -import { getCommerceApi as commerceApi } from '@commerce/api' +import type { CommerceAPI, CommerceAPIConfig } from '@vercel/commerce/api' +import { getCommerceApi as commerceApi } from '@vercel/commerce/api' import createApiFetch from './utils/create-api-fetch' import getAllPages from './operations/get-all-pages' diff --git a/framework/spree/api/operations/get-all-pages.ts b/framework/spree/api/operations/get-all-pages.ts index 580a74999..b5fae62b1 100644 --- a/framework/spree/api/operations/get-all-pages.ts +++ b/framework/spree/api/operations/get-all-pages.ts @@ -1,8 +1,8 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import type { GetAllPagesOperation, Page } from '@commerce/types/page' +} from '@vercel/commerce/api/operations' +import type { GetAllPagesOperation, Page } from '@vercel/commerce/types/page' import { requireConfigValue } from '../../isomorphic-config' import normalizePage from '../../utils/normalizations/normalize-page' import type { IPages } from '@spree/storefront-api-v2-sdk/types/interfaces/Page' diff --git a/framework/spree/api/operations/get-all-product-paths.ts b/framework/spree/api/operations/get-all-product-paths.ts index 4795d1fdb..424f46c4c 100644 --- a/framework/spree/api/operations/get-all-product-paths.ts +++ b/framework/spree/api/operations/get-all-product-paths.ts @@ -1,9 +1,9 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import type { Product } from '@commerce/types/product' -import type { GetAllProductPathsOperation } from '@commerce/types/product' +} from '@vercel/commerce/api/operations' +import type { Product } from '@vercel/commerce/types/product' +import type { GetAllProductPathsOperation } from '@vercel/commerce/types/product' import { requireConfigValue } from '../../isomorphic-config' import type { IProductsSlugs, SpreeSdkVariables } from '../../types' import getProductPath from '../../utils/get-product-path' diff --git a/framework/spree/api/operations/get-all-products.ts b/framework/spree/api/operations/get-all-products.ts index a292e6097..2b718d929 100644 --- a/framework/spree/api/operations/get-all-products.ts +++ b/framework/spree/api/operations/get-all-products.ts @@ -1,9 +1,9 @@ -import type { Product } from '@commerce/types/product' -import type { GetAllProductsOperation } from '@commerce/types/product' +import type { Product } from '@vercel/commerce/types/product' +import type { GetAllProductsOperation } from '@vercel/commerce/types/product' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' import type { SpreeApiConfig, SpreeApiProvider } from '../index' import type { SpreeSdkVariables } from '../../types' diff --git a/framework/spree/api/operations/get-page.ts b/framework/spree/api/operations/get-page.ts index ecb02755d..711870e72 100644 --- a/framework/spree/api/operations/get-page.ts +++ b/framework/spree/api/operations/get-page.ts @@ -1,8 +1,8 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import type { GetPageOperation } from '@commerce/types/page' +} from '@vercel/commerce/api/operations' +import type { GetPageOperation } from '@vercel/commerce/types/page' import type { SpreeSdkVariables } from '../../types' import type { SpreeApiConfig, SpreeApiProvider } from '..' import type { IPage } from '@spree/storefront-api-v2-sdk/types/interfaces/Page' diff --git a/framework/spree/api/operations/get-product.ts b/framework/spree/api/operations/get-product.ts index 18e9643cd..bd93791de 100644 --- a/framework/spree/api/operations/get-product.ts +++ b/framework/spree/api/operations/get-product.ts @@ -1,9 +1,9 @@ import type { SpreeApiConfig, SpreeApiProvider } from '../index' -import type { GetProductOperation } from '@commerce/types/product' +import type { GetProductOperation } from '@vercel/commerce/types/product' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { IProduct } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' import type { SpreeSdkVariables } from '../../types' import MissingSlugVariableError from '../../errors/MissingSlugVariableError' diff --git a/framework/spree/api/operations/get-site-info.ts b/framework/spree/api/operations/get-site-info.ts index 4d9aaf0ad..13b11e4a4 100644 --- a/framework/spree/api/operations/get-site-info.ts +++ b/framework/spree/api/operations/get-site-info.ts @@ -1,8 +1,11 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import type { Category, GetSiteInfoOperation } from '@commerce/types/site' +} from '@vercel/commerce/api/operations' +import type { + Category, + GetSiteInfoOperation, +} from '@vercel/commerce/types/site' import type { ITaxons, TaxonAttr, diff --git a/framework/spree/api/utils/create-api-fetch.ts b/framework/spree/api/utils/create-api-fetch.ts index 0c7d51b0b..a82aaa581 100644 --- a/framework/spree/api/utils/create-api-fetch.ts +++ b/framework/spree/api/utils/create-api-fetch.ts @@ -5,7 +5,7 @@ import convertSpreeErrorToGraphQlError from '../../utils/convert-spree-error-to- import type { ResultResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/ResultResponse' import getSpreeSdkMethodFromEndpointPath from '../../utils/get-spree-sdk-method-from-endpoint-path' import SpreeSdkMethodFromEndpointPathError from '../../errors/SpreeSdkMethodFromEndpointPathError' -import { GraphQLFetcher, GraphQLFetcherResult } from '@commerce/api' +import { GraphQLFetcher, GraphQLFetcherResult } from '@vercel/commerce/api' import createCustomizedFetchFetcher, { fetchResponseKey, } from '../../utils/create-customized-fetch-fetcher' diff --git a/framework/spree/auth/use-login.tsx b/framework/spree/auth/use-login.tsx index 308ac6597..9e89aa3cc 100644 --- a/framework/spree/auth/use-login.tsx +++ b/framework/spree/auth/use-login.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import useLogin, { UseLogin } from '@commerce/auth/use-login' -import type { LoginHook } from '@commerce/types/login' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' +import type { LoginHook } from '@vercel/commerce/types/login' import type { AuthTokenAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Authentication' -import { FetcherError, ValidationError } from '@commerce/utils/errors' +import { FetcherError, ValidationError } from '@vercel/commerce/utils/errors' import useCustomer from '../customer/use-customer' import useCart from '../cart/use-cart' import useWishlist from '../wishlist/use-wishlist' @@ -60,25 +60,26 @@ export const handler: MutationHook<LoginHook> = { } }, useHook: ({ fetch }) => { - const useWrappedHook: ReturnType<MutationHook<LoginHook>['useHook']> = - () => { - const customer = useCustomer() - const cart = useCart() - const wishlist = useWishlist() + const useWrappedHook: ReturnType< + MutationHook<LoginHook>['useHook'] + > = () => { + const customer = useCustomer() + const cart = useCart() + const wishlist = useWishlist() - return useCallback( - async function login(input) { - const data = await fetch({ input }) + return useCallback( + async function login(input) { + const data = await fetch({ input }) - await customer.revalidate() - await cart.revalidate() - await wishlist.revalidate() + await customer.revalidate() + await cart.revalidate() + await wishlist.revalidate() - return data - }, - [customer, cart, wishlist] - ) - } + return data + }, + [customer, cart, wishlist] + ) + } return useWrappedHook }, diff --git a/framework/spree/auth/use-logout.tsx b/framework/spree/auth/use-logout.tsx index 0d8eb4bc9..8b2202123 100644 --- a/framework/spree/auth/use-logout.tsx +++ b/framework/spree/auth/use-logout.tsx @@ -1,6 +1,6 @@ -import { MutationHook } from '@commerce/utils/types' -import useLogout, { UseLogout } from '@commerce/auth/use-logout' -import type { LogoutHook } from '@commerce/types/logout' +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' +import type { LogoutHook } from '@vercel/commerce/types/logout' import { useCallback } from 'react' import useCustomer from '../customer/use-customer' import useCart from '../cart/use-cart' @@ -52,28 +52,29 @@ export const handler: MutationHook<LogoutHook> = { return null }, useHook: ({ fetch }) => { - const useWrappedHook: ReturnType<MutationHook<LogoutHook>['useHook']> = - () => { - const customer = useCustomer({ - swrOptions: { isPaused: () => true }, - }) - const cart = useCart({ - swrOptions: { isPaused: () => true }, - }) - const wishlist = useWishlist({ - swrOptions: { isPaused: () => true }, - }) + const useWrappedHook: ReturnType< + MutationHook<LogoutHook>['useHook'] + > = () => { + const customer = useCustomer({ + swrOptions: { isPaused: () => true }, + }) + const cart = useCart({ + swrOptions: { isPaused: () => true }, + }) + const wishlist = useWishlist({ + swrOptions: { isPaused: () => true }, + }) - return useCallback(async () => { - const data = await fetch() + return useCallback(async () => { + const data = await fetch() - await customer.mutate(null, false) - await cart.mutate(null, false) - await wishlist.mutate(null, false) + await customer.mutate(null, false) + await cart.mutate(null, false) + await wishlist.mutate(null, false) - return data - }, [customer, cart, wishlist]) - } + return data + }, [customer, cart, wishlist]) + } return useWrappedHook }, diff --git a/framework/spree/auth/use-signup.tsx b/framework/spree/auth/use-signup.tsx index 708668b9c..a3ba9a461 100644 --- a/framework/spree/auth/use-signup.tsx +++ b/framework/spree/auth/use-signup.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react' -import type { GraphQLFetcherResult } from '@commerce/api' -import type { MutationHook } from '@commerce/utils/types' -import useSignup, { UseSignup } from '@commerce/auth/use-signup' -import type { SignupHook } from '@commerce/types/signup' -import { ValidationError } from '@commerce/utils/errors' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' +import type { SignupHook } from '@vercel/commerce/types/signup' +import { ValidationError } from '@vercel/commerce/utils/errors' import type { IAccount } from '@spree/storefront-api-v2-sdk/types/interfaces/Account' import type { AuthTokenAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Authentication' import useCustomer from '../customer/use-customer' @@ -70,25 +70,26 @@ export const handler: MutationHook<SignupHook> = { return null }, useHook: ({ fetch }) => { - const useWrappedHook: ReturnType<MutationHook<SignupHook>['useHook']> = - () => { - const customer = useCustomer() - const cart = useCart() - const wishlist = useWishlist() + const useWrappedHook: ReturnType< + MutationHook<SignupHook>['useHook'] + > = () => { + const customer = useCustomer() + const cart = useCart() + const wishlist = useWishlist() - return useCallback( - async (input) => { - const data = await fetch({ input }) + return useCallback( + async (input) => { + const data = await fetch({ input }) - await customer.revalidate() - await cart.revalidate() - await wishlist.revalidate() + await customer.revalidate() + await cart.revalidate() + await wishlist.revalidate() - return data - }, - [customer, cart, wishlist] - ) - } + return data + }, + [customer, cart, wishlist] + ) + } return useWrappedHook }, diff --git a/framework/spree/cart/use-add-item.tsx b/framework/spree/cart/use-add-item.tsx index 74bdd633f..5f7d1f4d5 100644 --- a/framework/spree/cart/use-add-item.tsx +++ b/framework/spree/cart/use-add-item.tsx @@ -1,18 +1,18 @@ -import useAddItem from '@commerce/cart/use-add-item' -import type { UseAddItem } from '@commerce/cart/use-add-item' -import type { MutationHook } from '@commerce/utils/types' +import useAddItem from '@vercel/commerce/cart/use-add-item' +import type { UseAddItem } from '@vercel/commerce/cart/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' import { useCallback } from 'react' import useCart from './use-cart' -import type { AddItemHook } from '@commerce/types/cart' +import type { AddItemHook } from '@vercel/commerce/types/cart' import normalizeCart from '../utils/normalizations/normalize-cart' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/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 { setCartToken } from '../utils/tokens/cart-token' import ensureIToken from '../utils/tokens/ensure-itoken' import createEmptyCart from '../utils/create-empty-cart' -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' import isLoggedIn from '../utils/tokens/is-logged-in' export default useAddItem as UseAddItem<typeof handler> @@ -96,21 +96,22 @@ export const handler: MutationHook<AddItemHook> = { } }, useHook: ({ fetch }) => { - const useWrappedHook: ReturnType<MutationHook<AddItemHook>['useHook']> = - () => { - const { mutate } = useCart() + const useWrappedHook: ReturnType< + MutationHook<AddItemHook>['useHook'] + > = () => { + const { mutate } = useCart() - return useCallback( - async (input) => { - const data = await fetch({ input }) + return useCallback( + async (input) => { + const data = await fetch({ input }) - await mutate(data, false) + await mutate(data, false) - return data - }, - [mutate] - ) - } + return data + }, + [mutate] + ) + } return useWrappedHook }, diff --git a/framework/spree/cart/use-cart.tsx b/framework/spree/cart/use-cart.tsx index e700c27fa..d65a22acc 100644 --- a/framework/spree/cart/use-cart.tsx +++ b/framework/spree/cart/use-cart.tsx @@ -1,13 +1,13 @@ import { useMemo } from 'react' -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 type { SWRHook } from '@vercel/commerce/utils/types' +import useCart from '@vercel/commerce/cart/use-cart' +import type { UseCart } from '@vercel/commerce/cart/use-cart' +import type { GetCartHook } from '@vercel/commerce/types/cart' import normalizeCart from '../utils/normalizations/normalize-cart' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/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 { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' import { setCartToken } from '../utils/tokens/cart-token' import ensureIToken from '../utils/tokens/ensure-itoken' import isLoggedIn from '../utils/tokens/is-logged-in' diff --git a/framework/spree/cart/use-remove-item.tsx b/framework/spree/cart/use-remove-item.tsx index 42e7536a9..6bbecd32e 100644 --- a/framework/spree/cart/use-remove-item.tsx +++ b/framework/spree/cart/use-remove-item.tsx @@ -1,18 +1,18 @@ -import type { MutationHook } from '@commerce/utils/types' -import useRemoveItem from '@commerce/cart/use-remove-item' -import type { UseRemoveItem } from '@commerce/cart/use-remove-item' -import type { RemoveItemHook } from '@commerce/types/cart' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useRemoveItem from '@vercel/commerce/cart/use-remove-item' +import type { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item' +import type { RemoveItemHook } from '@vercel/commerce/types/cart' import useCart from './use-cart' import { useCallback } from 'react' import normalizeCart from '../utils/normalizations/normalize-cart' import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import type { IQuery } from '@spree/storefront-api-v2-sdk/types/interfaces/Query' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' import ensureIToken from '../utils/tokens/ensure-itoken' import createEmptyCart from '../utils/create-empty-cart' import { setCartToken } from '../utils/tokens/cart-token' -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' import isLoggedIn from '../utils/tokens/is-logged-in' export default useRemoveItem as UseRemoveItem<typeof handler> @@ -94,24 +94,25 @@ export const handler: MutationHook<RemoveItemHook> = { } }, useHook: ({ fetch }) => { - const useWrappedHook: ReturnType<MutationHook<RemoveItemHook>['useHook']> = - () => { - const { mutate } = useCart() + const useWrappedHook: ReturnType< + MutationHook<RemoveItemHook>['useHook'] + > = () => { + const { mutate } = useCart() - return useCallback( - async (input) => { - const data = await fetch({ input: { itemId: input.id } }) + return useCallback( + async (input) => { + const data = await fetch({ input: { itemId: input.id } }) - // Upon calling cart.removeItem, Spree returns the old version of the cart, - // with the already removed line item. Invalidate the useCart mutation - // to fetch the cart again. - await mutate(data, true) + // Upon calling cart.removeItem, Spree returns the old version of the cart, + // with the already removed line item. Invalidate the useCart mutation + // to fetch the cart again. + await mutate(data, true) - return data - }, - [mutate] - ) - } + return data + }, + [mutate] + ) + } return useWrappedHook }, diff --git a/framework/spree/cart/use-update-item.tsx b/framework/spree/cart/use-update-item.tsx index 86b8599fa..679d68ac7 100644 --- a/framework/spree/cart/use-update-item.tsx +++ b/framework/spree/cart/use-update-item.tsx @@ -1,12 +1,14 @@ -import type { MutationHook } from '@commerce/utils/types' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' -import type { UpdateItemHook } from '@commerce/types/cart' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' +import type { UpdateItemHook } from '@vercel/commerce/types/cart' import useCart from './use-cart' import { useMemo } from 'react' -import { FetcherError, ValidationError } from '@commerce/utils/errors' +import { FetcherError, ValidationError } from '@vercel/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 type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' import normalizeCart from '../utils/normalizations/normalize-cart' import debounce from 'lodash.debounce' @@ -103,42 +105,43 @@ export const handler: MutationHook<UpdateItemHook> = { } }, useHook: ({ fetch }) => { - const useWrappedHook: ReturnType<MutationHook<UpdateItemHook>['useHook']> = - (context) => { - const { mutate } = useCart() + const useWrappedHook: ReturnType< + MutationHook<UpdateItemHook>['useHook'] + > = (context) => { + const { mutate } = useCart() - return useMemo( - () => - debounce(async (input: UpdateItemHook['actionInput']) => { - const itemId = context?.item?.id - const productId = input.productId ?? context?.item?.productId - const variantId = input.variantId ?? context?.item?.variantId - const quantity = input.quantity + return useMemo( + () => + debounce(async (input: UpdateItemHook['actionInput']) => { + const itemId = context?.item?.id + const productId = input.productId ?? context?.item?.productId + const variantId = input.variantId ?? context?.item?.variantId + const quantity = input.quantity - if (!itemId || !productId || !variantId) { - throw new ValidationError({ - message: 'Invalid input used for this operation', - }) - } - - const data = await fetch({ - input: { - item: { - productId, - variantId, - quantity, - }, - itemId, - }, + if (!itemId || !productId || !variantId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', }) + } - await mutate(data, false) + const data = await fetch({ + input: { + item: { + productId, + variantId, + quantity, + }, + itemId, + }, + }) - return data - }, context?.wait ?? 500), - [mutate, context] - ) - } + await mutate(data, false) + + return data + }, context?.wait ?? 500), + [mutate, context] + ) + } return useWrappedHook }, diff --git a/framework/spree/checkout/use-checkout.tsx b/framework/spree/checkout/use-checkout.tsx index dfd7fe02f..bd8e3ac75 100644 --- a/framework/spree/checkout/use-checkout.tsx +++ b/framework/spree/checkout/use-checkout.tsx @@ -1,5 +1,7 @@ -import { SWRHook } from '@commerce/utils/types' -import useCheckout, { UseCheckout } from '@commerce/checkout/use-checkout' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' export default useCheckout as UseCheckout<typeof handler> diff --git a/framework/spree/customer/address/use-add-item.tsx b/framework/spree/customer/address/use-add-item.tsx index c2f645a16..63296809d 100644 --- a/framework/spree/customer/address/use-add-item.tsx +++ b/framework/spree/customer/address/use-add-item.tsx @@ -1,6 +1,6 @@ -import useAddItem from '@commerce/customer/address/use-add-item' -import type { UseAddItem } from '@commerce/customer/address/use-add-item' -import type { MutationHook } from '@commerce/utils/types' +import useAddItem from '@vercel/commerce/customer/address/use-add-item' +import type { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/spree/customer/card/use-add-item.tsx b/framework/spree/customer/card/use-add-item.tsx index a8bb3cd88..402811453 100644 --- a/framework/spree/customer/card/use-add-item.tsx +++ b/framework/spree/customer/card/use-add-item.tsx @@ -1,6 +1,6 @@ -import useAddItem from '@commerce/customer/address/use-add-item' -import type { UseAddItem } from '@commerce/customer/address/use-add-item' -import type { MutationHook } from '@commerce/utils/types' +import useAddItem from '@vercel/commerce/customer/address/use-add-item' +import type { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/spree/customer/use-customer.tsx b/framework/spree/customer/use-customer.tsx index 647645ac2..56f330d26 100644 --- a/framework/spree/customer/use-customer.tsx +++ b/framework/spree/customer/use-customer.tsx @@ -1,11 +1,11 @@ -import type { SWRHook } from '@commerce/utils/types' -import useCustomer from '@commerce/customer/use-customer' -import type { UseCustomer } from '@commerce/customer/use-customer' -import type { CustomerHook } from '@commerce/types/customer' +import type { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer from '@vercel/commerce/customer/use-customer' +import type { UseCustomer } from '@vercel/commerce/customer/use-customer' +import type { CustomerHook } from '@vercel/commerce/types/customer' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import type { IAccount } from '@spree/storefront-api-v2-sdk/types/interfaces/Account' -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' import normalizeUser from '../utils/normalizations/normalize-user' import isLoggedIn from '../utils/tokens/is-logged-in' import ensureIToken from '../utils/tokens/ensure-itoken' diff --git a/framework/spree/fetcher.ts b/framework/spree/fetcher.ts index c9505e4c9..7f95fa71b 100644 --- a/framework/spree/fetcher.ts +++ b/framework/spree/fetcher.ts @@ -1,8 +1,8 @@ -import type { Fetcher } from '@commerce/utils/types' +import type { Fetcher } from '@vercel/commerce/utils/types' import convertSpreeErrorToGraphQlError from './utils/convert-spree-error-to-graph-ql-error' import { makeClient, errors } from '@spree/storefront-api-v2-sdk' import type { ResultResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/ResultResponse' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import { requireConfigValue } from './isomorphic-config' import getSpreeSdkMethodFromEndpointPath from './utils/get-spree-sdk-method-from-endpoint-path' import SpreeSdkMethodFromEndpointPathError from './errors/SpreeSdkMethodFromEndpointPathError' diff --git a/framework/spree/index.tsx b/framework/spree/index.tsx index f7eff69e9..9291e2b16 100644 --- a/framework/spree/index.tsx +++ b/framework/spree/index.tsx @@ -4,12 +4,12 @@ import { CommerceProviderProps, CoreCommerceProvider, useCommerce as useCoreCommerce, -} from '@commerce' +} from '@vercel/commerce' import { spreeProvider } from './provider' import type { SpreeProvider } from './provider' import { SWRConfig } from 'swr' import handleTokenErrors from './utils/handle-token-errors' -import useLogout from '@commerce/auth/use-logout' +import useLogout from '@vercel/commerce/auth/use-logout' export { spreeProvider } export type { SpreeProvider } diff --git a/framework/spree/product/use-price.tsx b/framework/spree/product/use-price.tsx index 0174faf5e..fd42d7033 100644 --- a/framework/spree/product/use-price.tsx +++ b/framework/spree/product/use-price.tsx @@ -1,2 +1,2 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/spree/product/use-search.tsx b/framework/spree/product/use-search.tsx index 5912a72ca..7de5d8258 100644 --- a/framework/spree/product/use-search.tsx +++ b/framework/spree/product/use-search.tsx @@ -1,9 +1,12 @@ -import type { SWRHook } from '@commerce/utils/types' -import useSearch from '@commerce/product/use-search' -import type { Product, SearchProductsHook } from '@commerce/types/product' -import type { UseSearch } from '@commerce/product/use-search' +import type { SWRHook } from '@vercel/commerce/utils/types' +import useSearch from '@vercel/commerce/product/use-search' +import type { + Product, + SearchProductsHook, +} from '@vercel/commerce/types/product' +import type { UseSearch } from '@vercel/commerce/product/use-search' import normalizeProduct from '../utils/normalizations/normalize-product' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' import { requireConfigValue } from '../isomorphic-config' diff --git a/framework/spree/types/index.ts b/framework/spree/types/index.ts index 79b75c249..74ddeb52a 100644 --- a/framework/spree/types/index.ts +++ b/framework/spree/types/index.ts @@ -6,13 +6,13 @@ import type { } from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi' import type { ResultResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/ResultResponse' import type { Response } from '@vercel/fetch' -import type { ProductOption, Product } from '@commerce/types/product' +import type { ProductOption, Product } from '@vercel/commerce/types/product' import type { AddItemHook, RemoveItemHook, WishlistItemBody, WishlistTypes, -} from '@commerce/types/wishlist' +} from '@vercel/commerce/types/wishlist' export type UnknownObjectValues = Record<string, unknown> @@ -136,7 +136,7 @@ export type UserOAuthTokens = { // TODO: ExplicitCommerceWishlist is a temporary type // derived from tsx views. It will be removed once -// Wishlist in @commerce/types/wishlist is updated +// Wishlist in @vercel/commerce/types/wishlist is updated // to a more specific type than `any`. export type ExplicitCommerceWishlist = { id: string diff --git a/framework/spree/utils/convert-spree-error-to-graph-ql-error.ts b/framework/spree/utils/convert-spree-error-to-graph-ql-error.ts index def4920ba..f35a00da5 100644 --- a/framework/spree/utils/convert-spree-error-to-graph-ql-error.ts +++ b/framework/spree/utils/convert-spree-error-to-graph-ql-error.ts @@ -1,4 +1,4 @@ -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' import { errors } from '@spree/storefront-api-v2-sdk' const convertSpreeErrorToGraphQlError = ( diff --git a/framework/spree/utils/create-empty-cart.ts b/framework/spree/utils/create-empty-cart.ts index 0bf0aa522..efbd687f3 100644 --- a/framework/spree/utils/create-empty-cart.ts +++ b/framework/spree/utils/create-empty-cart.ts @@ -1,5 +1,5 @@ -import type { GraphQLFetcherResult } from '@commerce/api' -import type { HookFetcherContext } from '@commerce/utils/types' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { HookFetcherContext } from '@vercel/commerce/utils/types' 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 ensureIToken from './tokens/ensure-itoken' diff --git a/framework/spree/utils/expand-options.ts b/framework/spree/utils/expand-options.ts index 29b9d6760..382ea3b5a 100644 --- a/framework/spree/utils/expand-options.ts +++ b/framework/spree/utils/expand-options.ts @@ -1,4 +1,4 @@ -import type { ProductOptionValues } from '@commerce/types/product' +import type { ProductOptionValues } from '@vercel/commerce/types/product' import type { JsonApiDocument, JsonApiResponse, diff --git a/framework/spree/utils/get-media-gallery.ts b/framework/spree/utils/get-media-gallery.ts index da939c82b..dd2dacb29 100644 --- a/framework/spree/utils/get-media-gallery.ts +++ b/framework/spree/utils/get-media-gallery.ts @@ -1,6 +1,6 @@ // Based on https://github.com/spark-solutions/spree2vuestorefront/blob/d88d85ae1bcd2ec99b13b81cd2e3c25600a0216e/src/utils/index.ts -import type { ProductImage } from '@commerce/types/product' +import type { ProductImage } from '@vercel/commerce/types/product' import type { SpreeProductImage } from '../types' const getMediaGallery = ( diff --git a/framework/spree/utils/login.ts b/framework/spree/utils/login.ts index 3894b7952..13555664a 100644 --- a/framework/spree/utils/login.ts +++ b/framework/spree/utils/login.ts @@ -1,5 +1,5 @@ -import type { GraphQLFetcherResult } from '@commerce/api' -import type { HookFetcherContext } from '@commerce/utils/types' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { HookFetcherContext } from '@vercel/commerce/utils/types' import type { AuthTokenAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Authentication' import type { AssociateCart } from '@spree/storefront-api-v2-sdk/types/interfaces/endpoints/CartClass' import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' diff --git a/framework/spree/utils/normalizations/normalize-cart.ts b/framework/spree/utils/normalizations/normalize-cart.ts index a1751eaec..c5597fd89 100644 --- a/framework/spree/utils/normalizations/normalize-cart.ts +++ b/framework/spree/utils/normalizations/normalize-cart.ts @@ -3,12 +3,12 @@ import type { LineItem, ProductVariant, SelectedOption, -} from '@commerce/types/cart' +} from '@vercel/commerce/types/cart' import MissingLineItemVariantError from '../../errors/MissingLineItemVariantError' import { requireConfigValue } from '../../isomorphic-config' import type { OrderAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' import type { ProductAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' -import type { Image } from '@commerce/types/common' +import type { Image } from '@vercel/commerce/types/common' import { jsonApi } from '@spree/storefront-api-v2-sdk' import createGetAbsoluteImageUrl from '../create-get-absolute-image-url' import getMediaGallery from '../get-media-gallery' diff --git a/framework/spree/utils/normalizations/normalize-page.ts b/framework/spree/utils/normalizations/normalize-page.ts index c49d862d1..a2464ffd9 100644 --- a/framework/spree/utils/normalizations/normalize-page.ts +++ b/framework/spree/utils/normalizations/normalize-page.ts @@ -1,4 +1,4 @@ -import { Page } from '@commerce/types/page' +import { Page } from '@vercel/commerce/types/page' import type { PageAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Page' import { SpreeSdkResponse } from '../../types' diff --git a/framework/spree/utils/normalizations/normalize-product.ts b/framework/spree/utils/normalizations/normalize-product.ts index e70bd34b4..6965f0197 100644 --- a/framework/spree/utils/normalizations/normalize-product.ts +++ b/framework/spree/utils/normalizations/normalize-product.ts @@ -3,7 +3,7 @@ import type { ProductImage, ProductPrice, ProductVariant, -} from '@commerce/types/product' +} from '@vercel/commerce/types/product' 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 { jsonApi } from '@spree/storefront-api-v2-sdk' diff --git a/framework/spree/utils/normalizations/normalize-user.ts b/framework/spree/utils/normalizations/normalize-user.ts index 897b1c59b..8b738fbaf 100644 --- a/framework/spree/utils/normalizations/normalize-user.ts +++ b/framework/spree/utils/normalizations/normalize-user.ts @@ -1,4 +1,4 @@ -import type { Customer } from '@commerce/types/customer' +import type { Customer } from '@vercel/commerce/types/customer' import type { AccountAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Account' import type { SpreeSdkResponse } from '../../types' diff --git a/framework/spree/utils/tokens/revoke-user-tokens.ts b/framework/spree/utils/tokens/revoke-user-tokens.ts index 9c603a884..82133542f 100644 --- a/framework/spree/utils/tokens/revoke-user-tokens.ts +++ b/framework/spree/utils/tokens/revoke-user-tokens.ts @@ -1,5 +1,5 @@ -import type { GraphQLFetcherResult } from '@commerce/api' -import type { HookFetcherContext } from '@commerce/utils/types' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { HookFetcherContext } from '@vercel/commerce/utils/types' import TokensNotRejectedError from '../../errors/TokensNotRejectedError' import type { UserOAuthTokens } from '../../types' import type { EmptyObjectResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/EmptyObject' diff --git a/framework/spree/wishlist/use-add-item.tsx b/framework/spree/wishlist/use-add-item.tsx index dac003ddc..ff5e8fe6b 100644 --- a/framework/spree/wishlist/use-add-item.tsx +++ b/framework/spree/wishlist/use-add-item.tsx @@ -1,17 +1,17 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import useAddItem from '@commerce/wishlist/use-add-item' -import type { UseAddItem } from '@commerce/wishlist/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useAddItem from '@vercel/commerce/wishlist/use-add-item' +import type { UseAddItem } from '@vercel/commerce/wishlist/use-add-item' import useWishlist from './use-wishlist' import type { ExplicitWishlistAddItemHook } from '../types' import type { WishedItem, WishlistsAddWishedItem, } from '@spree/storefront-api-v2-sdk/types/interfaces/WishedItem' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import ensureIToken from '../utils/tokens/ensure-itoken' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' -import type { AddItemHook } from '@commerce/types/wishlist' +import type { AddItemHook } from '@vercel/commerce/types/wishlist' import isLoggedIn from '../utils/tokens/is-logged-in' export default useAddItem as UseAddItem<typeof handler> @@ -55,32 +55,33 @@ export const handler: MutationHook<ExplicitWishlistAddItemHook> = { return null }, useHook: ({ fetch }) => { - const useWrappedHook: ReturnType<MutationHook<AddItemHook>['useHook']> = - () => { - const wishlist = useWishlist() + const useWrappedHook: ReturnType< + MutationHook<AddItemHook>['useHook'] + > = () => { + const wishlist = useWishlist() - return useCallback( - async (item) => { - if (!wishlist.data) { - return null - } + return useCallback( + async (item) => { + if (!wishlist.data) { + return null + } - const data = await fetch({ - input: { - item: { - ...item, - wishlistToken: wishlist.data.token, - }, + const data = await fetch({ + input: { + item: { + ...item, + wishlistToken: wishlist.data.token, }, - }) + }, + }) - await wishlist.revalidate() + await wishlist.revalidate() - return data - }, - [wishlist] - ) - } + return data + }, + [wishlist] + ) + } return useWrappedHook }, diff --git a/framework/spree/wishlist/use-remove-item.tsx b/framework/spree/wishlist/use-remove-item.tsx index 3b92b029f..255d3858b 100644 --- a/framework/spree/wishlist/use-remove-item.tsx +++ b/framework/spree/wishlist/use-remove-item.tsx @@ -1,13 +1,13 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import useRemoveItem from '@commerce/wishlist/use-remove-item' -import type { UseRemoveItem } from '@commerce/wishlist/use-remove-item' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useRemoveItem from '@vercel/commerce/wishlist/use-remove-item' +import type { UseRemoveItem } from '@vercel/commerce/wishlist/use-remove-item' import useWishlist from './use-wishlist' import type { ExplicitWishlistRemoveItemHook } from '../types' import isLoggedIn from '../utils/tokens/is-logged-in' import ensureIToken from '../utils/tokens/ensure-itoken' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import type { WishedItem } from '@spree/storefront-api-v2-sdk/types/interfaces/WishedItem' export default useRemoveItem as UseRemoveItem<typeof handler> diff --git a/framework/spree/wishlist/use-wishlist.tsx b/framework/spree/wishlist/use-wishlist.tsx index 0292d4096..9f258625e 100644 --- a/framework/spree/wishlist/use-wishlist.tsx +++ b/framework/spree/wishlist/use-wishlist.tsx @@ -1,10 +1,10 @@ import { useMemo } from 'react' -import type { SWRHook } from '@commerce/utils/types' -import useWishlist from '@commerce/wishlist/use-wishlist' -import type { UseWishlist } from '@commerce/wishlist/use-wishlist' -import type { GetWishlistHook } from '@commerce/types/wishlist' +import type { SWRHook } from '@vercel/commerce/utils/types' +import useWishlist from '@vercel/commerce/wishlist/use-wishlist' +import type { UseWishlist } from '@vercel/commerce/wishlist/use-wishlist' +import type { GetWishlistHook } from '@vercel/commerce/types/wishlist' import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' -import type { GraphQLFetcherResult } from '@commerce/api' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' import type { Wishlist } from '@spree/storefront-api-v2-sdk/types/interfaces/Wishlist' import ensureIToken from '../utils/tokens/ensure-itoken' import normalizeWishlist from '../utils/normalizations/normalize-wishlist' diff --git a/framework/swell/api/endpoints/checkout/index.ts b/framework/swell/api/endpoints/checkout/index.ts index 1d521a6b6..2695ea385 100644 --- a/framework/swell/api/endpoints/checkout/index.ts +++ b/framework/swell/api/endpoints/checkout/index.ts @@ -1,7 +1,7 @@ -import { CommerceAPI, createEndpoint, GetAPISchema } from '@commerce/api' -import { CheckoutSchema } from '@commerce/types/checkout' +import { CommerceAPI, createEndpoint, GetAPISchema } from '@vercel/commerce/api' +import { CheckoutSchema } from '@vercel/commerce/types/checkout' import { SWELL_CHECKOUT_URL_COOKIE } from '../../../const' -import checkoutEndpoint from '@commerce/api/endpoints/checkout' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, diff --git a/framework/swell/api/index.ts b/framework/swell/api/index.ts index 463c42fae..589acae4e 100644 --- a/framework/swell/api/index.ts +++ b/framework/swell/api/index.ts @@ -2,7 +2,7 @@ import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi, -} from '@commerce/api' +} from '@vercel/commerce/api' import { SWELL_CHECKOUT_ID_COOKIE, SWELL_CUSTOMER_TOKEN_COOKIE, diff --git a/framework/swell/api/operations/get-all-pages.ts b/framework/swell/api/operations/get-all-pages.ts index e157c0138..7097d6859 100644 --- a/framework/swell/api/operations/get-all-pages.ts +++ b/framework/swell/api/operations/get-all-pages.ts @@ -1,5 +1,5 @@ import { Provider, SwellConfig } from '..' -import type { OperationContext } from '@commerce/api/operations' +import type { OperationContext } from '@vercel/commerce/api/operations' import type { Page } from '../../types/page' export type GetAllPagesResult<T extends { pages: any[] } = { pages: Page[] }> = diff --git a/framework/swell/api/operations/get-all-product-paths.ts b/framework/swell/api/operations/get-all-product-paths.ts index 4d95253e8..1e5088608 100644 --- a/framework/swell/api/operations/get-all-product-paths.ts +++ b/framework/swell/api/operations/get-all-product-paths.ts @@ -1,7 +1,10 @@ import { SwellProduct } from '../../types' import { SwellConfig, Provider } from '..' -import { OperationContext, OperationOptions } from '@commerce/api/operations' -import { GetAllProductPathsOperation } from '@commerce/types/product' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { GetAllProductPathsOperation } from '@vercel/commerce/types/product' export default function getAllProductPathsOperation({ commerce, diff --git a/framework/swell/api/operations/get-all-products.ts b/framework/swell/api/operations/get-all-products.ts index 7e8e99a5c..6527fb986 100644 --- a/framework/swell/api/operations/get-all-products.ts +++ b/framework/swell/api/operations/get-all-products.ts @@ -1,8 +1,8 @@ import { normalizeProduct } from '../../utils/normalize' import { SwellProduct } from '../../types' -import { Product } from '@commerce/types/product' +import { Product } from '@vercel/commerce/types/product' import { Provider, SwellConfig } from '../' -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' export type ProductVariables = { first?: number } diff --git a/framework/swell/api/operations/get-page.ts b/framework/swell/api/operations/get-page.ts index 60d40e03b..7e71f7575 100644 --- a/framework/swell/api/operations/get-page.ts +++ b/framework/swell/api/operations/get-page.ts @@ -1,6 +1,9 @@ import { Page } from '../../../schema' import { SwellConfig, Provider } from '..' -import { OperationContext, OperationOptions } from '@commerce/api/operations' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' import { GetPageOperation } from '../../types/page' export type GetPageResult<T extends { page?: any } = { page?: Page }> = T diff --git a/framework/swell/api/operations/get-product.ts b/framework/swell/api/operations/get-product.ts index c9a3d6f1d..fff62570f 100644 --- a/framework/swell/api/operations/get-product.ts +++ b/framework/swell/api/operations/get-product.ts @@ -1,7 +1,7 @@ import { normalizeProduct } from '../../utils' -import { Product } from '@commerce/types/product' -import { OperationContext } from '@commerce/api/operations' +import { Product } from '@vercel/commerce/types/product' +import { OperationContext } from '@vercel/commerce/api/operations' import { Provider, SwellConfig } from '../' export default function getProductOperation({ diff --git a/framework/swell/api/operations/get-site-info.ts b/framework/swell/api/operations/get-site-info.ts index ffb0c1542..88386ad3e 100644 --- a/framework/swell/api/operations/get-site-info.ts +++ b/framework/swell/api/operations/get-site-info.ts @@ -1,8 +1,8 @@ import getCategories from '../../utils/get-categories' import getVendors, { Brands } from '../../utils/get-vendors' import { Provider, SwellConfig } from '../' -import type { OperationContext } from '@commerce/api/operations' -import type { Category } from '@commerce/types/site' +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { Category } from '@vercel/commerce/types/site' export type GetSiteInfoResult< T extends { categories: any[]; brands: any[] } = { diff --git a/framework/swell/api/operations/login.ts b/framework/swell/api/operations/login.ts index 33e1e2948..44ff37a53 100644 --- a/framework/swell/api/operations/login.ts +++ b/framework/swell/api/operations/login.ts @@ -2,7 +2,7 @@ import type { ServerResponse } from 'http' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { LoginOperation } from '../../types/login' import { Provider, SwellConfig } from '..' diff --git a/framework/swell/auth/use-login.tsx b/framework/swell/auth/use-login.tsx index 6c6eeb61b..12426989d 100644 --- a/framework/swell/auth/use-login.tsx +++ b/framework/swell/auth/use-login.tsx @@ -1,13 +1,13 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError, ValidationError } from '@commerce/utils/errors' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError, ValidationError } from '@vercel/commerce/utils/errors' import useCustomer from '../customer/use-customer' import { CustomerUserError, Mutation, MutationCheckoutCreateArgs, } from '../../schema' -import useLogin, { UseLogin } from '@commerce/auth/use-login' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' import { LoginHook } from '../types/login' import { setCustomerToken } from '../utils' diff --git a/framework/swell/auth/use-logout.tsx b/framework/swell/auth/use-logout.tsx index 0e08ce9c6..08eec0bac 100644 --- a/framework/swell/auth/use-logout.tsx +++ b/framework/swell/auth/use-logout.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import useLogout, { UseLogout } from '@commerce/auth/use-logout' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' import useCustomer from '../customer/use-customer' import { getCustomerToken, setCustomerToken } from '../utils/customer-token' import { LogoutHook } from '../types/logout' diff --git a/framework/swell/auth/use-signup.tsx b/framework/swell/auth/use-signup.tsx index 246285ece..89931e927 100644 --- a/framework/swell/auth/use-signup.tsx +++ b/framework/swell/auth/use-signup.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useSignup, { UseSignup } from '@commerce/auth/use-signup' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' import useCustomer from '../customer/use-customer' import { SignupHook } from '../types/signup' import handleLogin from '../utils/handle-login' diff --git a/framework/swell/cart/use-add-item.tsx b/framework/swell/cart/use-add-item.tsx index dac4fb9bb..048a1f45d 100644 --- a/framework/swell/cart/use-add-item.tsx +++ b/framework/swell/cart/use-add-item.tsx @@ -1,6 +1,6 @@ -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item' import useCart from './use-cart' import { checkoutToCart } from './utils' import { getCheckoutId } from '../utils' diff --git a/framework/swell/cart/use-cart.tsx b/framework/swell/cart/use-cart.tsx index 7dc48b052..5842d1e95 100644 --- a/framework/swell/cart/use-cart.tsx +++ b/framework/swell/cart/use-cart.tsx @@ -1,9 +1,9 @@ -import useCart, { UseCart } from '@commerce/cart/use-cart' -import { SWRHook } from '@commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' +import { SWRHook } from '@vercel/commerce/utils/types' import { useMemo } from 'react' import { normalizeCart } from '../utils/normalize' import { checkoutCreate, checkoutToCart } from './utils' -import type { GetCartHook } from '@commerce/types/cart' +import type { GetCartHook } from '@vercel/commerce/types/cart' export default useCart as UseCart<typeof handler> diff --git a/framework/swell/cart/use-remove-item.tsx b/framework/swell/cart/use-remove-item.tsx index fe1ee24ca..6e511656b 100644 --- a/framework/swell/cart/use-remove-item.tsx +++ b/framework/swell/cart/use-remove-item.tsx @@ -2,10 +2,16 @@ import { useCallback } from 'react' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' +} from '@vercel/commerce/utils/types' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' -import type { Cart, LineItem, RemoveItemHook } from '@commerce/types/cart' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' +import type { + Cart, + LineItem, + RemoveItemHook, +} from '@vercel/commerce/types/cart' import useCart from './use-cart' import { checkoutToCart } from './utils' diff --git a/framework/swell/cart/use-update-item.tsx b/framework/swell/cart/use-update-item.tsx index 5d705c5e5..c741250c2 100644 --- a/framework/swell/cart/use-update-item.tsx +++ b/framework/swell/cart/use-update-item.tsx @@ -4,16 +4,18 @@ import type { HookFetcherContext, MutationHook, MutationHookContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' // import useUpdateItem, { // UpdateItemInput as UpdateItemInputBase, // UseUpdateItem, -// } from '@commerce/cart/use-update-item' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' +// } from '@vercel/commerce/cart/use-update-item' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' import useCart from './use-cart' import { handler as removeItemHandler } from './use-remove-item' -import { CartItemBody, LineItem } from '@commerce/types/cart' +import { CartItemBody, LineItem } from '@vercel/commerce/types/cart' import { checkoutToCart } from './utils' import { UpdateItemHook } from '../types/cart' // export type UpdateItemInput<T = any> = T extends LineItem diff --git a/framework/swell/cart/utils/checkout-to-cart.ts b/framework/swell/cart/utils/checkout-to-cart.ts index dc31d9429..c9becb104 100644 --- a/framework/swell/cart/utils/checkout-to-cart.ts +++ b/framework/swell/cart/utils/checkout-to-cart.ts @@ -1,5 +1,5 @@ import { Cart } from '../../types' -import { CommerceError } from '@commerce/utils/errors' +import { CommerceError } from '@vercel/commerce/utils/errors' import { CheckoutLineItemsAddPayload, diff --git a/framework/swell/checkout/use-checkout.tsx b/framework/swell/checkout/use-checkout.tsx index 942f85b83..76997be73 100644 --- a/framework/swell/checkout/use-checkout.tsx +++ b/framework/swell/checkout/use-checkout.tsx @@ -1,5 +1,7 @@ -import { SWRHook } from '@commerce/utils/types' -import useCheckout, { UseCheckout } from '@commerce/checkout/use-checkout' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' export default useCheckout as UseCheckout<typeof handler> diff --git a/framework/swell/customer/address/use-add-item.tsx b/framework/swell/customer/address/use-add-item.tsx index ac9dcd5cf..4f85c8472 100644 --- a/framework/swell/customer/address/use-add-item.tsx +++ b/framework/swell/customer/address/use-add-item.tsx @@ -1,5 +1,7 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/address/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/swell/customer/card/use-add-item.tsx b/framework/swell/customer/card/use-add-item.tsx index 7e3afa9c5..77d149eff 100644 --- a/framework/swell/customer/card/use-add-item.tsx +++ b/framework/swell/customer/card/use-add-item.tsx @@ -1,5 +1,7 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/card/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/swell/customer/use-customer.tsx b/framework/swell/customer/use-customer.tsx index 3371db89c..0875310fd 100644 --- a/framework/swell/customer/use-customer.tsx +++ b/framework/swell/customer/use-customer.tsx @@ -1,5 +1,7 @@ -import useCustomer, { UseCustomer } from '@commerce/customer/use-customer' -import { SWRHook } from '@commerce/utils/types' +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' +import { SWRHook } from '@vercel/commerce/utils/types' import { normalizeCustomer } from '../utils/normalize' import type { CustomerHook } from '../types/customer' diff --git a/framework/swell/fetcher.ts b/framework/swell/fetcher.ts index 655e4da25..1d50bf5a7 100644 --- a/framework/swell/fetcher.ts +++ b/framework/swell/fetcher.ts @@ -1,5 +1,5 @@ -import { Fetcher } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' +import { Fetcher } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' import { handleFetchResponse } from './utils' import swell from './swell' diff --git a/framework/swell/index.tsx b/framework/swell/index.tsx index b64df6d48..d88d75c31 100644 --- a/framework/swell/index.tsx +++ b/framework/swell/index.tsx @@ -1,4 +1,7 @@ -import { getCommerceProvider, useCommerce as useCoreCommerce } from '@commerce' +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' import { swellProvider, SwellProvider } from './provider' export { swellProvider } diff --git a/framework/swell/product/use-price.tsx b/framework/swell/product/use-price.tsx index 0174faf5e..fd42d7033 100644 --- a/framework/swell/product/use-price.tsx +++ b/framework/swell/product/use-price.tsx @@ -1,2 +1,2 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/swell/product/use-search.tsx b/framework/swell/product/use-search.tsx index 62f813368..b996099a4 100644 --- a/framework/swell/product/use-search.tsx +++ b/framework/swell/product/use-search.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' import { normalizeProduct } from '../utils' import { SwellProduct } from '../types' import type { SearchProductsHook } from '../types/product' diff --git a/framework/swell/provider.ts b/framework/swell/provider.ts index 062f1c32c..afe07dcfd 100644 --- a/framework/swell/provider.ts +++ b/framework/swell/provider.ts @@ -1,4 +1,4 @@ -import { Provider } from '@commerce' +import { Provider } from '@vercel/commerce' import { SWELL_CHECKOUT_ID_COOKIE } from './const' import { handler as useCart } from './cart/use-cart' diff --git a/framework/swell/types.ts b/framework/swell/types.ts index ad8ee3b68..bf5de0d0c 100644 --- a/framework/swell/types.ts +++ b/framework/swell/types.ts @@ -1,5 +1,5 @@ -import * as Core from '@commerce/types/cart' -import { Customer } from '@commerce/types' +import * as Core from '@vercel/commerce/types/cart' +import { Customer } from '@vercel/commerce/types' import { CheckoutLineItem } from './schema' export type SwellImage = { diff --git a/framework/swell/types/cart.ts b/framework/swell/types/cart.ts index 6ed5c6c64..e6838fb45 100644 --- a/framework/swell/types/cart.ts +++ b/framework/swell/types/cart.ts @@ -1 +1 @@ -export * from '@commerce/types/cart' +export * from '@vercel/commerce/types/cart' diff --git a/framework/swell/types/checkout.ts b/framework/swell/types/checkout.ts index 4e2412ef6..d139db685 100644 --- a/framework/swell/types/checkout.ts +++ b/framework/swell/types/checkout.ts @@ -1 +1 @@ -export * from '@commerce/types/checkout' +export * from '@vercel/commerce/types/checkout' diff --git a/framework/swell/types/common.ts b/framework/swell/types/common.ts index b52c33a4d..23b8daa11 100644 --- a/framework/swell/types/common.ts +++ b/framework/swell/types/common.ts @@ -1 +1 @@ -export * from '@commerce/types/common' +export * from '@vercel/commerce/types/common' diff --git a/framework/swell/types/customer.ts b/framework/swell/types/customer.ts index 87c9afcc4..c637055b9 100644 --- a/framework/swell/types/customer.ts +++ b/framework/swell/types/customer.ts @@ -1 +1 @@ -export * from '@commerce/types/customer' +export * from '@vercel/commerce/types/customer' diff --git a/framework/swell/types/login.ts b/framework/swell/types/login.ts index ab11a420a..44b017dcd 100644 --- a/framework/swell/types/login.ts +++ b/framework/swell/types/login.ts @@ -1,7 +1,7 @@ -import * as Core from '@commerce/types/login' -import { LoginBody, LoginTypes } from '@commerce/types/login' +import * as Core from '@vercel/commerce/types/login' +import { LoginBody, LoginTypes } from '@vercel/commerce/types/login' -export * from '@commerce/types/login' +export * from '@vercel/commerce/types/login' export type LoginHook<T extends LoginTypes = LoginTypes> = { data: null diff --git a/framework/swell/types/logout.ts b/framework/swell/types/logout.ts index 9f0a466af..1de06f8dc 100644 --- a/framework/swell/types/logout.ts +++ b/framework/swell/types/logout.ts @@ -1 +1 @@ -export * from '@commerce/types/logout' +export * from '@vercel/commerce/types/logout' diff --git a/framework/swell/types/page.ts b/framework/swell/types/page.ts index 20ec8ea38..12f6b02d7 100644 --- a/framework/swell/types/page.ts +++ b/framework/swell/types/page.ts @@ -1 +1 @@ -export * from '@commerce/types/page' +export * from '@vercel/commerce/types/page' diff --git a/framework/swell/types/product.ts b/framework/swell/types/product.ts index c776d58fa..72ca02f02 100644 --- a/framework/swell/types/product.ts +++ b/framework/swell/types/product.ts @@ -1 +1 @@ -export * from '@commerce/types/product' +export * from '@vercel/commerce/types/product' diff --git a/framework/swell/types/signup.ts b/framework/swell/types/signup.ts index 58543c6f6..3f0d1af5a 100644 --- a/framework/swell/types/signup.ts +++ b/framework/swell/types/signup.ts @@ -1 +1 @@ -export * from '@commerce/types/signup' +export * from '@vercel/commerce/types/signup' diff --git a/framework/swell/types/site.ts b/framework/swell/types/site.ts index bfef69cf9..96a2e476e 100644 --- a/framework/swell/types/site.ts +++ b/framework/swell/types/site.ts @@ -1 +1 @@ -export * from '@commerce/types/site' +export * from '@vercel/commerce/types/site' diff --git a/framework/swell/types/wishlist.ts b/framework/swell/types/wishlist.ts index 8907fbf82..af92d9f63 100644 --- a/framework/swell/types/wishlist.ts +++ b/framework/swell/types/wishlist.ts @@ -1 +1 @@ -export * from '@commerce/types/wishlist' +export * from '@vercel/commerce/types/wishlist' diff --git a/framework/swell/utils/handle-fetch-response.ts b/framework/swell/utils/handle-fetch-response.ts index 2688c9c70..d120cab13 100644 --- a/framework/swell/utils/handle-fetch-response.ts +++ b/framework/swell/utils/handle-fetch-response.ts @@ -1,4 +1,4 @@ -import { CommerceError } from '@commerce/utils/errors' +import { CommerceError } from '@vercel/commerce/utils/errors' type SwellFetchResponse = { error: { diff --git a/framework/swell/utils/handle-login.ts b/framework/swell/utils/handle-login.ts index 77b6873e3..8628262ca 100644 --- a/framework/swell/utils/handle-login.ts +++ b/framework/swell/utils/handle-login.ts @@ -1,4 +1,4 @@ -import { ValidationError } from '@commerce/utils/errors' +import { ValidationError } from '@vercel/commerce/utils/errors' import { setCustomerToken } from './customer-token' const getErrorMessage = ({ diff --git a/framework/swell/wishlist/use-wishlist.tsx b/framework/swell/wishlist/use-wishlist.tsx index 7f50cdeb4..0506ae9d4 100644 --- a/framework/swell/wishlist/use-wishlist.tsx +++ b/framework/swell/wishlist/use-wishlist.tsx @@ -1,7 +1,7 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if // Swell doesn't have a wishlist -import { HookFetcher } from '@commerce/utils/types' +import { HookFetcher } from '@vercel/commerce/utils/types' import { Product } from '../../schema' const defaultOpts = {} diff --git a/framework/vendure/api/endpoints/checkout/index.ts b/framework/vendure/api/endpoints/checkout/index.ts index 7a3cd03ec..e063dbf58 100644 --- a/framework/vendure/api/endpoints/checkout/index.ts +++ b/framework/vendure/api/endpoints/checkout/index.ts @@ -1,7 +1,7 @@ import { NextApiHandler } from 'next' -import { CommerceAPI, createEndpoint, GetAPISchema } from '@commerce/api' -import { CheckoutSchema } from '@commerce/types/checkout' -import checkoutEndpoint from '@commerce/api/endpoints/checkout' +import { CommerceAPI, createEndpoint, GetAPISchema } from '@vercel/commerce/api' +import { CheckoutSchema } from '@vercel/commerce/types/checkout' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, diff --git a/framework/vendure/api/index.ts b/framework/vendure/api/index.ts index 6762ee6aa..393752710 100644 --- a/framework/vendure/api/index.ts +++ b/framework/vendure/api/index.ts @@ -1,5 +1,8 @@ -import type { APIProvider, CommerceAPIConfig } from '@commerce/api' -import { CommerceAPI, getCommerceApi as commerceApi } from '@commerce/api' +import type { APIProvider, CommerceAPIConfig } from '@vercel/commerce/api' +import { + CommerceAPI, + getCommerceApi as commerceApi, +} from '@vercel/commerce/api' import fetchGraphqlApi from './utils/fetch-graphql-api' import login from './operations/login' diff --git a/framework/vendure/api/operations/get-all-pages.ts b/framework/vendure/api/operations/get-all-pages.ts index f76b7390f..86975788e 100644 --- a/framework/vendure/api/operations/get-all-pages.ts +++ b/framework/vendure/api/operations/get-all-pages.ts @@ -1,5 +1,5 @@ import { VendureConfig } from '../' -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' import { Provider } from '../../../bigcommerce/api' export type Page = any diff --git a/framework/vendure/api/operations/get-all-product-paths.ts b/framework/vendure/api/operations/get-all-product-paths.ts index cff932d40..97434202f 100644 --- a/framework/vendure/api/operations/get-all-product-paths.ts +++ b/framework/vendure/api/operations/get-all-product-paths.ts @@ -1,8 +1,11 @@ -import { OperationContext, OperationOptions } from '@commerce/api/operations' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' import type { GetAllProductPathsQuery } from '../../../schema' import { Provider } from '../index' import { getAllProductPathsQuery } from '../../utils/queries/get-all-product-paths-query' -import { GetAllProductPathsOperation } from '@commerce/types/product' +import { GetAllProductPathsOperation } from '@vercel/commerce/types/product' import { BigcommerceConfig } from '../../../bigcommerce/api' export type GetAllProductPathsResult = { diff --git a/framework/vendure/api/operations/get-all-products.ts b/framework/vendure/api/operations/get-all-products.ts index 25d2cdd17..f609ac805 100644 --- a/framework/vendure/api/operations/get-all-products.ts +++ b/framework/vendure/api/operations/get-all-products.ts @@ -1,9 +1,9 @@ -import { Product } from '@commerce/types/product' +import { Product } from '@vercel/commerce/types/product' import { Provider, VendureConfig } from '../' import { GetAllProductsQuery } from '../../../schema' import { normalizeSearchResult } from '../../utils/normalize' import { getAllProductsQuery } from '../../utils/queries/get-all-products-query' -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' export type ProductVariables = { first?: number } diff --git a/framework/vendure/api/operations/get-customer-wishlist.ts b/framework/vendure/api/operations/get-customer-wishlist.ts index 0040ef36d..35fca53c7 100644 --- a/framework/vendure/api/operations/get-customer-wishlist.ts +++ b/framework/vendure/api/operations/get-customer-wishlist.ts @@ -1,4 +1,4 @@ -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' import { Provider, VendureConfig } from '../' export default function getCustomerWishlistOperation({ diff --git a/framework/vendure/api/operations/get-page.ts b/framework/vendure/api/operations/get-page.ts index 59717dc84..909277b48 100644 --- a/framework/vendure/api/operations/get-page.ts +++ b/framework/vendure/api/operations/get-page.ts @@ -1,5 +1,5 @@ import { VendureConfig, Provider } from '../' -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' export type Page = any diff --git a/framework/vendure/api/operations/get-product.ts b/framework/vendure/api/operations/get-product.ts index 27162b4ae..6b58e9694 100644 --- a/framework/vendure/api/operations/get-product.ts +++ b/framework/vendure/api/operations/get-product.ts @@ -1,5 +1,5 @@ -import { Product } from '@commerce/types/product' -import { OperationContext } from '@commerce/api/operations' +import { Product } from '@vercel/commerce/types/product' +import { OperationContext } from '@vercel/commerce/api/operations' import { Provider, VendureConfig } from '../' import { GetProductQuery } from '../../../schema' import { getProductQuery } from '../../utils/queries/get-product-query' diff --git a/framework/vendure/api/operations/get-site-info.ts b/framework/vendure/api/operations/get-site-info.ts index a8d17db99..ce2f5fa3f 100644 --- a/framework/vendure/api/operations/get-site-info.ts +++ b/framework/vendure/api/operations/get-site-info.ts @@ -2,8 +2,8 @@ import { Provider, VendureConfig } from '../' import { GetCollectionsQuery } from '../../../schema' import { arrayToTree } from '../../utils/array-to-tree' import { getCollectionsQuery } from '../../utils/queries/get-collections-query' -import { OperationContext } from '@commerce/api/operations' -import { Category } from '@commerce/types/site' +import { OperationContext } from '@vercel/commerce/api/operations' +import { Category } from '@vercel/commerce/types/site' export type GetSiteInfoResult< T extends { categories: any[]; brands: any[] } = { diff --git a/framework/vendure/api/operations/login.ts b/framework/vendure/api/operations/login.ts index f18c64b7b..07ee5fa1d 100644 --- a/framework/vendure/api/operations/login.ts +++ b/framework/vendure/api/operations/login.ts @@ -2,8 +2,8 @@ import type { ServerResponse } from 'http' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import { ValidationError } from '@commerce/utils/errors' +} from '@vercel/commerce/api/operations' +import { ValidationError } from '@vercel/commerce/utils/errors' import type { LoginOperation } from '../../types/login' import type { LoginMutation } from '../../../schema' import { Provider, VendureConfig } from '..' diff --git a/framework/vendure/api/utils/fetch-graphql-api.ts b/framework/vendure/api/utils/fetch-graphql-api.ts index 64a02dde5..7c0fbc792 100644 --- a/framework/vendure/api/utils/fetch-graphql-api.ts +++ b/framework/vendure/api/utils/fetch-graphql-api.ts @@ -1,5 +1,5 @@ -import { FetcherError } from '@commerce/utils/errors' -import type { GraphQLFetcher } from '@commerce/api' +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' import { getCommerceApi } from '../' import fetch from './fetch' diff --git a/framework/vendure/auth/use-login.tsx b/framework/vendure/auth/use-login.tsx index 4b3d09f8e..22f9bd5cb 100644 --- a/framework/vendure/auth/use-login.tsx +++ b/framework/vendure/auth/use-login.tsx @@ -1,8 +1,8 @@ import { useCallback } from 'react' -import { MutationHook } from '@commerce/utils/types' -import useLogin, { UseLogin } from '@commerce/auth/use-login' +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' import { LoginHook } from '../types/login' -import { CommerceError, ValidationError } from '@commerce/utils/errors' +import { CommerceError, ValidationError } from '@vercel/commerce/utils/errors' import useCustomer from '../customer/use-customer' import { LoginMutation, LoginMutationVariables } from '../../schema' import { loginMutation } from '../utils/mutations/log-in-mutation' diff --git a/framework/vendure/auth/use-logout.tsx b/framework/vendure/auth/use-logout.tsx index b01e2b8f9..8a099cf77 100644 --- a/framework/vendure/auth/use-logout.tsx +++ b/framework/vendure/auth/use-logout.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { MutationHook } from '@commerce/utils/types' -import useLogout, { UseLogout } from '@commerce/auth/use-logout' +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' import useCustomer from '../customer/use-customer' import { LogoutMutation } from '../../schema' import { logoutMutation } from '../utils/mutations/log-out-mutation' diff --git a/framework/vendure/auth/use-signup.tsx b/framework/vendure/auth/use-signup.tsx index 9705d0450..523974a80 100644 --- a/framework/vendure/auth/use-signup.tsx +++ b/framework/vendure/auth/use-signup.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import { MutationHook } from '@commerce/utils/types' -import { CommerceError, ValidationError } from '@commerce/utils/errors' -import useSignup, { UseSignup } from '@commerce/auth/use-signup' +import { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError, ValidationError } from '@vercel/commerce/utils/errors' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' import useCustomer from '../customer/use-customer' import { RegisterCustomerInput, diff --git a/framework/vendure/cart/use-add-item.tsx b/framework/vendure/cart/use-add-item.tsx index 15424c160..d7bb0bf66 100644 --- a/framework/vendure/cart/use-add-item.tsx +++ b/framework/vendure/cart/use-add-item.tsx @@ -1,6 +1,6 @@ -import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item' -import { CommerceError } from '@commerce/utils/errors' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item' +import { CommerceError } from '@vercel/commerce/utils/errors' +import { MutationHook } from '@vercel/commerce/utils/types' import { useCallback } from 'react' import useCart from './use-cart' import { AddItemToOrderMutation } from '../../schema' diff --git a/framework/vendure/cart/use-cart.tsx b/framework/vendure/cart/use-cart.tsx index e053f1fb3..750f11040 100644 --- a/framework/vendure/cart/use-cart.tsx +++ b/framework/vendure/cart/use-cart.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useCart, { UseCart } from '@commerce/cart/use-cart' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' import { ActiveOrderQuery, CartFragment } from '../../schema' import { normalizeCart } from '../utils/normalize' import { useMemo } from 'react' diff --git a/framework/vendure/cart/use-remove-item.tsx b/framework/vendure/cart/use-remove-item.tsx index deba7e096..2aa316505 100644 --- a/framework/vendure/cart/use-remove-item.tsx +++ b/framework/vendure/cart/use-remove-item.tsx @@ -4,10 +4,12 @@ import { MutationHook, MutationHookContext, SWRHook, -} from '@commerce/utils/types' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' -import { CommerceError } from '@commerce/utils/errors' -import { Cart } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' +import { CommerceError } from '@vercel/commerce/utils/errors' +import { Cart } from '@vercel/commerce/types/cart' import useCart from './use-cart' import { RemoveOrderLineMutation, diff --git a/framework/vendure/cart/use-update-item.tsx b/framework/vendure/cart/use-update-item.tsx index 8aa02efd7..2f3c8d47b 100644 --- a/framework/vendure/cart/use-update-item.tsx +++ b/framework/vendure/cart/use-update-item.tsx @@ -3,10 +3,12 @@ import { HookFetcherContext, MutationHook, MutationHookContext, -} from '@commerce/utils/types' -import { CommerceError, ValidationError } from '@commerce/utils/errors' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' -import { CartItemBody, LineItem } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import { CommerceError, ValidationError } from '@vercel/commerce/utils/errors' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' +import { CartItemBody, LineItem } from '@vercel/commerce/types/cart' import useCart from './use-cart' import { AdjustOrderLineMutation, diff --git a/framework/vendure/checkout/use-checkout.tsx b/framework/vendure/checkout/use-checkout.tsx index 942f85b83..76997be73 100644 --- a/framework/vendure/checkout/use-checkout.tsx +++ b/framework/vendure/checkout/use-checkout.tsx @@ -1,5 +1,7 @@ -import { SWRHook } from '@commerce/utils/types' -import useCheckout, { UseCheckout } from '@commerce/checkout/use-checkout' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' export default useCheckout as UseCheckout<typeof handler> diff --git a/framework/vendure/customer/address/use-add-item.tsx b/framework/vendure/customer/address/use-add-item.tsx index ac9dcd5cf..4f85c8472 100644 --- a/framework/vendure/customer/address/use-add-item.tsx +++ b/framework/vendure/customer/address/use-add-item.tsx @@ -1,5 +1,7 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/address/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/vendure/customer/card/use-add-item.tsx b/framework/vendure/customer/card/use-add-item.tsx index 7e3afa9c5..77d149eff 100644 --- a/framework/vendure/customer/card/use-add-item.tsx +++ b/framework/vendure/customer/card/use-add-item.tsx @@ -1,5 +1,7 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/card/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem<typeof handler> diff --git a/framework/vendure/customer/use-customer.tsx b/framework/vendure/customer/use-customer.tsx index ed901d956..80da077ff 100644 --- a/framework/vendure/customer/use-customer.tsx +++ b/framework/vendure/customer/use-customer.tsx @@ -1,5 +1,7 @@ -import { SWRHook } from '@commerce/utils/types' -import useCustomer, { UseCustomer } from '@commerce/customer/use-customer' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' import { ActiveCustomerQuery } from '../../schema' import { activeCustomerQuery } from '../utils/queries/active-customer-query' import { CustomerHook } from '../types/customer' diff --git a/framework/vendure/fetcher.ts b/framework/vendure/fetcher.ts index 48b041801..ad0d4bc66 100644 --- a/framework/vendure/fetcher.ts +++ b/framework/vendure/fetcher.ts @@ -1,5 +1,5 @@ -import { Fetcher } from '@commerce/utils/types' -import { FetcherError } from '@commerce/utils/errors' +import { Fetcher } from '@vercel/commerce/utils/types' +import { FetcherError } from '@vercel/commerce/utils/errors' async function getText(res: Response) { try { diff --git a/framework/vendure/index.tsx b/framework/vendure/index.tsx index 086940c54..14d0d4c3a 100644 --- a/framework/vendure/index.tsx +++ b/framework/vendure/index.tsx @@ -1,4 +1,7 @@ -import { getCommerceProvider, useCommerce as useCoreCommerce } from '@commerce' +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' import { vendureProvider, VendureProvider } from './provider' export { vendureProvider } diff --git a/framework/vendure/product/use-price.tsx b/framework/vendure/product/use-price.tsx index 0174faf5e..fd42d7033 100644 --- a/framework/vendure/product/use-price.tsx +++ b/framework/vendure/product/use-price.tsx @@ -1,2 +1,2 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/vendure/product/use-search.tsx b/framework/vendure/product/use-search.tsx index adbe2af6b..86c6467d1 100644 --- a/framework/vendure/product/use-search.tsx +++ b/framework/vendure/product/use-search.tsx @@ -1,6 +1,6 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' -import { Product } from '@commerce/types/product' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' +import { Product } from '@vercel/commerce/types/product' import { SearchQuery, SearchQueryVariables } from '../../schema' import { normalizeSearchResult } from '../utils/normalize' import { searchQuery } from '../utils/queries/search-query' diff --git a/framework/vendure/types/cart.ts b/framework/vendure/types/cart.ts index 6ed5c6c64..e6838fb45 100644 --- a/framework/vendure/types/cart.ts +++ b/framework/vendure/types/cart.ts @@ -1 +1 @@ -export * from '@commerce/types/cart' +export * from '@vercel/commerce/types/cart' diff --git a/framework/vendure/types/checkout.ts b/framework/vendure/types/checkout.ts index 4e2412ef6..d139db685 100644 --- a/framework/vendure/types/checkout.ts +++ b/framework/vendure/types/checkout.ts @@ -1 +1 @@ -export * from '@commerce/types/checkout' +export * from '@vercel/commerce/types/checkout' diff --git a/framework/vendure/types/common.ts b/framework/vendure/types/common.ts index b52c33a4d..23b8daa11 100644 --- a/framework/vendure/types/common.ts +++ b/framework/vendure/types/common.ts @@ -1 +1 @@ -export * from '@commerce/types/common' +export * from '@vercel/commerce/types/common' diff --git a/framework/vendure/types/customer.ts b/framework/vendure/types/customer.ts index 87c9afcc4..c637055b9 100644 --- a/framework/vendure/types/customer.ts +++ b/framework/vendure/types/customer.ts @@ -1 +1 @@ -export * from '@commerce/types/customer' +export * from '@vercel/commerce/types/customer' diff --git a/framework/vendure/types/login.ts b/framework/vendure/types/login.ts index 7d7531572..283a5751c 100644 --- a/framework/vendure/types/login.ts +++ b/framework/vendure/types/login.ts @@ -1,8 +1,8 @@ -import * as Core from '@commerce/types/login' +import * as Core from '@vercel/commerce/types/login' import type { LoginMutationVariables } from '../../schema' -import { LoginBody, LoginTypes } from '@commerce/types/login' +import { LoginBody, LoginTypes } from '@vercel/commerce/types/login' -export * from '@commerce/types/login' +export * from '@vercel/commerce/types/login' export type LoginHook<T extends LoginTypes = LoginTypes> = { data: null diff --git a/framework/vendure/types/logout.ts b/framework/vendure/types/logout.ts index 9f0a466af..1de06f8dc 100644 --- a/framework/vendure/types/logout.ts +++ b/framework/vendure/types/logout.ts @@ -1 +1 @@ -export * from '@commerce/types/logout' +export * from '@vercel/commerce/types/logout' diff --git a/framework/vendure/types/page.ts b/framework/vendure/types/page.ts index 20ec8ea38..12f6b02d7 100644 --- a/framework/vendure/types/page.ts +++ b/framework/vendure/types/page.ts @@ -1 +1 @@ -export * from '@commerce/types/page' +export * from '@vercel/commerce/types/page' diff --git a/framework/vendure/types/product.ts b/framework/vendure/types/product.ts index c776d58fa..72ca02f02 100644 --- a/framework/vendure/types/product.ts +++ b/framework/vendure/types/product.ts @@ -1 +1 @@ -export * from '@commerce/types/product' +export * from '@vercel/commerce/types/product' diff --git a/framework/vendure/types/signup.ts b/framework/vendure/types/signup.ts index 58543c6f6..3f0d1af5a 100644 --- a/framework/vendure/types/signup.ts +++ b/framework/vendure/types/signup.ts @@ -1 +1 @@ -export * from '@commerce/types/signup' +export * from '@vercel/commerce/types/signup' diff --git a/framework/vendure/types/site.ts b/framework/vendure/types/site.ts index bfef69cf9..96a2e476e 100644 --- a/framework/vendure/types/site.ts +++ b/framework/vendure/types/site.ts @@ -1 +1 @@ -export * from '@commerce/types/site' +export * from '@vercel/commerce/types/site' diff --git a/framework/vendure/types/wishlist.ts b/framework/vendure/types/wishlist.ts index 8907fbf82..af92d9f63 100644 --- a/framework/vendure/types/wishlist.ts +++ b/framework/vendure/types/wishlist.ts @@ -1 +1 @@ -export * from '@commerce/types/wishlist' +export * from '@vercel/commerce/types/wishlist' diff --git a/framework/vendure/utils/normalize.ts b/framework/vendure/utils/normalize.ts index 77d31a77c..adde43674 100644 --- a/framework/vendure/utils/normalize.ts +++ b/framework/vendure/utils/normalize.ts @@ -1,5 +1,5 @@ -import { Product } from '@commerce/types/product' -import { Cart } from '@commerce/types/cart' +import { Product } from '@vercel/commerce/types/product' +import { Cart } from '@vercel/commerce/types/cart' import { CartFragment, SearchResultFragment } from '../../schema' export function normalizeSearchResult(item: SearchResultFragment): Product { diff --git a/framework/vendure/wishlist/use-wishlist.tsx b/framework/vendure/wishlist/use-wishlist.tsx index a4c2e87fb..ab4192171 100644 --- a/framework/vendure/wishlist/use-wishlist.tsx +++ b/framework/vendure/wishlist/use-wishlist.tsx @@ -1,7 +1,7 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if // Vendure doesn't have a built-in wishlist -import { HookFetcher } from '@commerce/utils/types' +import { HookFetcher } from '@vercel/commerce/utils/types' import { Product } from '../../schema' const defaultOpts = {}