mirror of
https://github.com/vercel/commerce.git
synced 2025-04-15 07:35:53 +00:00
changes breaking
This commit is contained in:
parent
7f70cfd868
commit
de0ba8cee8
@ -2,13 +2,14 @@ import { ChangeEvent, useEffect, useState } from 'react'
|
||||
import cn from 'classnames'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import s from './CartItem.module.css'
|
||||
import { Trash, Plus, Minus } from '@components/icons'
|
||||
import usePrice from '@framework/product/use-price'
|
||||
import useUpdateItem from '@framework/cart/use-update-item'
|
||||
import useRemoveItem from '@framework/cart/use-remove-item'
|
||||
import s from './CartItem.module.css'
|
||||
import { CartItem } from 'framework/types'
|
||||
|
||||
const CartItem = ({
|
||||
const Item = ({
|
||||
item,
|
||||
currencyCode,
|
||||
}: {
|
||||
@ -31,7 +32,7 @@ const CartItem = ({
|
||||
const val = Number(e.target.value)
|
||||
|
||||
if (Number.isInteger(val) && val >= 0) {
|
||||
setQuantity(e.target.value)
|
||||
setQuantity(Number(e.target.value))
|
||||
}
|
||||
}
|
||||
const handleBlur = () => {
|
||||
@ -124,4 +125,4 @@ const CartItem = ({
|
||||
)
|
||||
}
|
||||
|
||||
export default CartItem
|
||||
export default Item
|
||||
|
@ -2,7 +2,7 @@ import { FC } from 'react'
|
||||
import cn from 'classnames'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import type { Page } from '@framework/api/operations/get-all-pages'
|
||||
import type { Page } from '@framework/common/get-all-pages'
|
||||
import getSlug from '@lib/get-slug'
|
||||
import { Github, Vercel } from '@components/icons'
|
||||
import { Logo, Container } from '@components/ui'
|
||||
|
@ -11,7 +11,7 @@ import CartSidebarView from '@components/cart/CartSidebarView'
|
||||
|
||||
import LoginView from '@components/auth/LoginView'
|
||||
import { CommerceProvider } from '@framework'
|
||||
import type { Page } from '@framework/api/operations/get-all-pages'
|
||||
import type { Page } from '@framework/common/get-all-pages'
|
||||
|
||||
const Loading = () => (
|
||||
<div className="w-80 h-80 flex items-center text-center justify-center p-3">
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Product } from 'framework/types'
|
||||
import getAllProducts, { ProductEdge } from '../../operations/get-all-products'
|
||||
import getAllProducts, { ProductEdge } from '../../../product/get-all-products'
|
||||
import type { ProductsHandlers } from '../products'
|
||||
|
||||
const SORT: { [key: string]: string | undefined } = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FetcherError } from '@commerce/utils/errors'
|
||||
import login from '../../operations/login'
|
||||
import login from '../../../auth/login'
|
||||
import type { LoginHandlers } from '../login'
|
||||
|
||||
const invalidCredentials = /invalid credentials/i
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { BigcommerceApiError } from '../../utils/errors'
|
||||
import login from '../../operations/login'
|
||||
import login from '../../../auth/login'
|
||||
import { SignupHandlers } from '../signup'
|
||||
|
||||
const signup: SignupHandlers['signup'] = async ({
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ProductNode } from '../operations/get-all-products'
|
||||
import type { ProductNode } from '../../product/get-all-products'
|
||||
import type { RecursivePartial } from './types'
|
||||
|
||||
export default function setProductLocaleMeta(
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { WishlistHandlers } from '..'
|
||||
import getCustomerId from '../../operations/get-customer-id'
|
||||
import getCustomerWishlist from '../../operations/get-customer-wishlist'
|
||||
import getCustomerId from '../../../customer/get-customer-id'
|
||||
import getCustomerWishlist from '../../../customer/get-customer-wishlist'
|
||||
import { parseWishlistItem } from '../../utils/parse-item'
|
||||
|
||||
// Returns the wishlist of the signed customer
|
||||
|
@ -1,5 +1,5 @@
|
||||
import getCustomerId from '../../operations/get-customer-id'
|
||||
import getCustomerWishlist from '../../operations/get-customer-wishlist'
|
||||
import getCustomerId from '../../../customer/get-customer-id'
|
||||
import getCustomerWishlist from '../../../customer/get-customer-wishlist'
|
||||
import type { Wishlist, WishlistHandlers } from '..'
|
||||
|
||||
// Return wishlist info
|
||||
|
@ -1,7 +1,7 @@
|
||||
import getCustomerId from '../../operations/get-customer-id'
|
||||
import getCustomerId from '../../../customer/get-customer-id'
|
||||
import getCustomerWishlist, {
|
||||
Wishlist,
|
||||
} from '../../operations/get-customer-wishlist'
|
||||
} from '../../../customer/get-customer-wishlist'
|
||||
import type { WishlistHandlers } from '..'
|
||||
|
||||
// Return current wishlist info
|
||||
|
@ -7,7 +7,7 @@ import { BigcommerceApiError } from '../utils/errors'
|
||||
import type {
|
||||
Wishlist,
|
||||
WishlistItem,
|
||||
} from '../operations/get-customer-wishlist'
|
||||
} from '../../customer/get-customer-wishlist'
|
||||
import getWishlist from './handlers/get-wishlist'
|
||||
import addItem from './handlers/add-item'
|
||||
import removeItem from './handlers/remove-item'
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { ServerResponse } from 'http'
|
||||
import type { LoginMutation, LoginMutationVariables } from '../../schema'
|
||||
import type { RecursivePartial } from '../utils/types'
|
||||
import concatHeader from '../utils/concat-cookie'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import type { LoginMutation, LoginMutationVariables } from '../schema'
|
||||
import type { RecursivePartial } from '../api/utils/types'
|
||||
import concatHeader from '../api/utils/concat-cookie'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
|
||||
export const loginMutation = /* GraphQL */ `
|
||||
mutation login($email: String!, $password: String!) {
|
@ -1,6 +1,6 @@
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import { definitions } from '../definitions/store-content'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../api/utils/types'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
import { definitions } from '../api/definitions/store-content'
|
||||
|
||||
export type Page = definitions['page_Full']
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import { definitions } from '../definitions/store-content'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../api/utils/types'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
import { definitions } from '../api/definitions/store-content'
|
||||
|
||||
export type Page = definitions['page_Full']
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../../schema'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import filterEdges from '../utils/filter-edges'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import { categoryTreeItemFragment } from '../fragments/category-tree'
|
||||
import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../schema'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../api/utils/types'
|
||||
import filterEdges from '../api/utils/filter-edges'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
import { categoryTreeItemFragment } from '../api/fragments/category-tree'
|
||||
|
||||
// Get 3 levels of categories
|
||||
export const getSiteInfoQuery = /* GraphQL */ `
|
@ -1,5 +1,5 @@
|
||||
import { GetCustomerIdQuery } from '../../schema'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import { GetCustomerIdQuery } from '../schema'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
|
||||
export const getCustomerIdQuery = /* GraphQL */ `
|
||||
query getCustomerId {
|
@ -1,7 +1,7 @@
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import { definitions } from '../definitions/wishlist'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import getAllProducts, { ProductEdge } from './get-all-products'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../api/utils/types'
|
||||
import { definitions } from '../api/definitions/wishlist'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
import getAllProducts, { ProductEdge } from '../product/get-all-products'
|
||||
|
||||
export type Wishlist = Omit<definitions['wishlist_Full'], 'items'> & {
|
||||
items?: WishlistItem[]
|
@ -1,10 +1,10 @@
|
||||
import type {
|
||||
GetAllProductPathsQuery,
|
||||
GetAllProductPathsQueryVariables,
|
||||
} from '../../schema'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import filterEdges from '../utils/filter-edges'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
} from '../schema'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../api/utils/types'
|
||||
import filterEdges from '../api/utils/filter-edges'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
|
||||
export const getAllProductPathsQuery = /* GraphQL */ `
|
||||
query getAllProductPaths($first: Int = 100) {
|
@ -1,13 +1,13 @@
|
||||
import type {
|
||||
GetAllProductsQuery,
|
||||
GetAllProductsQueryVariables,
|
||||
} from '../../schema'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import filterEdges from '../utils/filter-edges'
|
||||
import setProductLocaleMeta from '../utils/set-product-locale-meta'
|
||||
import { productConnectionFragment } from '../fragments/product'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import { normalizeProduct } from '../../lib/normalize'
|
||||
} from '../schema'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../api/utils/types'
|
||||
import filterEdges from '../api/utils/filter-edges'
|
||||
import setProductLocaleMeta from '../api/utils/set-product-locale-meta'
|
||||
import { productConnectionFragment } from '../api/fragments/product'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
import { normalizeProduct } from '../lib/normalize'
|
||||
|
||||
export const getAllProductsQuery = /* GraphQL */ `
|
||||
query getAllProducts(
|
@ -1,7 +1,7 @@
|
||||
import type { GetProductQuery, GetProductQueryVariables } from '../../schema'
|
||||
import setProductLocaleMeta from '../utils/set-product-locale-meta'
|
||||
import { productInfoFragment } from '../fragments/product'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
import type { GetProductQuery, GetProductQueryVariables } from '../schema'
|
||||
import setProductLocaleMeta from '../api/utils/set-product-locale-meta'
|
||||
import { productInfoFragment } from '../api/fragments/product'
|
||||
import { BigcommerceConfig, getConfig } from '../api'
|
||||
import { normalizeProduct } from '@framework/lib/normalize'
|
||||
|
||||
export const getProductQuery = /* GraphQL */ `
|
@ -1,4 +1,4 @@
|
||||
export { default as usePrice } from './use-price'
|
||||
export { default as useSearch } from './use-search'
|
||||
export { default as getProduct } from '../api/operations/get-product'
|
||||
export { default as getAllProducts } from '../api/operations/get-all-products'
|
||||
export { default as getProduct } from './get-product'
|
||||
export { default as getAllProducts } from './get-all-products'
|
||||
|
@ -51,6 +51,7 @@
|
||||
"bowser": "^2.11.0",
|
||||
"classnames": "^2.2.6",
|
||||
"cookie": "^0.4.1",
|
||||
"dot-object": "^2.1.4",
|
||||
"email-validator": "^2.0.4",
|
||||
"js-cookie": "^2.2.1",
|
||||
"keen-slider": "^5.2.4",
|
||||
@ -100,8 +101,8 @@
|
||||
"resolutions": {
|
||||
"webpack": "5.11.1"
|
||||
},
|
||||
"node": {
|
||||
"net": "empty"
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ import { Layout } from '@components/common'
|
||||
import getSlug from '@lib/get-slug'
|
||||
import { missingLocaleInPages } from '@lib/usage-warns'
|
||||
import { getConfig } from '@framework/api'
|
||||
import getPage from '@framework/api/operations/get-page'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getPage from '@framework/common/get-page'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import { defaultPageProps } from '@lib/defaults'
|
||||
|
||||
export async function getStaticProps({
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import { Layout } from '@components/common'
|
||||
import { Container } from '@components/ui'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import useCart from '@framework/cart/use-cart'
|
||||
import usePrice from '@framework/product/use-price'
|
||||
import { Layout } from '@components/common'
|
||||
|
@ -5,9 +5,9 @@ import HomeAllProductsGrid from '@components/common/HomeAllProductsGrid'
|
||||
import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
||||
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllProducts from '@framework/api/operations/get-all-products'
|
||||
import getSiteInfo from '@framework/api/operations/get-site-info'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getAllProducts from '@framework/product/get-all-products'
|
||||
import getSiteInfo from '@framework/common/get-site-info'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
|
||||
export async function getStaticProps({
|
||||
preview,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import { Layout } from '@components/common'
|
||||
import { Container, Text } from '@components/ui'
|
||||
import { Bag } from '@components/icons'
|
||||
|
@ -8,9 +8,9 @@ import { Layout } from '@components/common'
|
||||
import { ProductView } from '@components/product'
|
||||
|
||||
import { getConfig } from '@framework/api'
|
||||
import getProduct from '@framework/api/operations/get-product'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getAllProductPaths from '@framework/api/operations/get-all-product-paths'
|
||||
import getProduct from '@framework/product/get-product'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import getAllProductPaths from '@framework/product/get-all-product-paths'
|
||||
|
||||
export async function getStaticProps({
|
||||
params,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import useCustomer from '@framework/customer/use-customer'
|
||||
import { Layout } from '@components/common'
|
||||
import { Container, Text } from '@components/ui'
|
||||
|
@ -9,9 +9,9 @@ import { ProductCard } from '@components/product'
|
||||
import { Container, Grid, Skeleton } from '@components/ui'
|
||||
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getSiteInfo from '@framework/api/operations/get-site-info'
|
||||
import useSearch from '@framework/product/use-search'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import getSiteInfo from '@framework/common/get-site-info'
|
||||
|
||||
import rangeMap from '@lib/range-map'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllPages from '@framework/api/operations/get-all-pages'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import useWishlist from '@framework/wishlist/use-wishlist'
|
||||
import { Layout } from '@components/common'
|
||||
import { Heart } from '@components/icons'
|
||||
|
@ -27,8 +27,8 @@
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"/framework/types.d.ts",
|
||||
"next-env.d.ts",
|
||||
"framework/types.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"**/*.js"
|
||||
|
15
yarn.lock
15
yarn.lock
@ -2346,6 +2346,11 @@ commander@^2.13.0, commander@^2.16.0, commander@^2.20.0, commander@^2.20.3, comm
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
||||
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
|
||||
|
||||
commander@^4.0.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
|
||||
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
|
||||
|
||||
commander@^5.0.0, commander@^5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
|
||||
@ -2982,6 +2987,14 @@ dot-case@^3.0.3:
|
||||
no-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
dot-object@^2.1.4:
|
||||
version "2.1.4"
|
||||
resolved "https://registry.yarnpkg.com/dot-object/-/dot-object-2.1.4.tgz#c6c54e9fca510b4d0ea4d65acf33726963843b5f"
|
||||
integrity sha512-7FXnyyCLFawNYJ+NhkqyP9Wd2yzuo+7n9pGiYpkmXCTYa8Ci2U0eUNDVg5OuO5Pm6aFXI2SWN8/N/w7SJWu1WA==
|
||||
dependencies:
|
||||
commander "^4.0.0"
|
||||
glob "^7.1.5"
|
||||
|
||||
dotenv@^8.2.0:
|
||||
version "8.2.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
|
||||
@ -3618,7 +3631,7 @@ glob@^6.0.1:
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.6:
|
||||
glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.5, glob@^7.1.6:
|
||||
version "7.1.6"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
|
||||
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
|
||||
|
Loading…
x
Reference in New Issue
Block a user