Updated imports and deps

This commit is contained in:
Luis Alvarez 2020-12-29 20:04:26 -05:00
parent bedc6cd317
commit cf359cb774
34 changed files with 85 additions and 102 deletions

View File

@ -31,7 +31,6 @@ Next.js Commerce integrates out-of-the-box with BigCommerce. We plan to support
If you wish to work on a new cms/headless ecommerce provider, please check this repo https://github.com/vercel/commerce-framework and open a PR with your functions and utilities under the standard mentioned in the README.
## Troubleshoot
<details>
@ -69,15 +68,6 @@ After Email confirmation, Checkout should be manually enabled through BigCommerc
BigCommerce team has been notified and they plan to add more detailed about this subject.
</details>
<details>
<summary>I have issues with BigCommerce data hooks</summary>
<br>
Report issue with Data Hooks here: https://github.com/bigcommerce/storefront-data-hooks
</details>
## Contribute
Our commitment to Open Source can be found [here](https://vercel.com/oss).

View File

@ -1,6 +1,6 @@
import { FC, useEffect, useState, useCallback } from 'react'
import { Logo, Button, Input } from '@components/ui'
import useLogin from '@bigcommerce/storefront-data-hooks/use-login'
import useLogin from '@framework/use-login'
import { useUI } from '@components/ui/context'
import { validate } from 'email-validator'

View File

@ -3,7 +3,7 @@ import { validate } from 'email-validator'
import { Info } from '@components/icons'
import { useUI } from '@components/ui/context'
import { Logo, Button, Input } from '@components/ui'
import useSignup from '@bigcommerce/storefront-data-hooks/use-signup'
import useSignup from '@framework/use-signup'
interface Props {}

View File

@ -3,9 +3,9 @@ import cn from 'classnames'
import Image from 'next/image'
import Link from 'next/link'
import { Trash, Plus, Minus } from '@components/icons'
import usePrice from '@bigcommerce/storefront-data-hooks/use-price'
import useUpdateItem from '@bigcommerce/storefront-data-hooks/cart/use-update-item'
import useRemoveItem from '@bigcommerce/storefront-data-hooks/cart/use-remove-item'
import usePrice from '@framework/use-price'
import useUpdateItem from '@framework/cart/use-update-item'
import useRemoveItem from '@framework/cart/use-remove-item'
import s from './CartItem.module.css'
const CartItem = ({

View File

@ -4,8 +4,8 @@ import { UserNav } from '@components/common'
import { Button } from '@components/ui'
import { Bag, Cross, Check } from '@components/icons'
import { useUI } from '@components/ui/context'
import useCart from '@bigcommerce/storefront-data-hooks/cart/use-cart'
import usePrice from '@bigcommerce/storefront-data-hooks/use-price'
import useCart from '@framework/cart/use-cart'
import usePrice from '@framework/use-price'
import CartItem from '../CartItem'
import s from './CartSidebarView.module.css'

View File

@ -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 '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import type { Page } from '@framework/api/operations/get-all-pages'
import getSlug from '@lib/get-slug'
import { Github, Vercel } from '@components/icons'
import { Logo, Container } from '@components/ui'
@ -101,8 +101,16 @@ const Footer: FC<Props> = ({ className, pages }) => {
</div>
<div className="flex items-center text-primary">
<span className="text-primary">Crafted by</span>
<a href="https://vercel.com" aria-label="Vercel.com Link" target="_blank" className="text-primary">
<Vercel className="inline-block h-6 ml-4 text-primary" alt="Vercel.com Logo" />
<a
href="https://vercel.com"
aria-label="Vercel.com Link"
target="_blank"
className="text-primary"
>
<Vercel
className="inline-block h-6 ml-4 text-primary"
alt="Vercel.com Logo"
/>
</a>
</div>
</div>

View File

@ -9,8 +9,8 @@ import { useAcceptCookies } from '@lib/hooks/useAcceptCookies'
import { Sidebar, Button, Modal, LoadingDots } from '@components/ui'
import { CartSidebarView } from '@components/cart'
import { CommerceProvider } from '@bigcommerce/storefront-data-hooks'
import type { Page } from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import { CommerceProvider } from '@framework'
import type { Page } from '@framework/api/operations/get-all-pages'
const Loading = () => (
<div className="w-80 h-80 flex items-center text-center justify-center p-3">

View File

@ -15,7 +15,7 @@ import {
clearAllBodyScrollLocks,
} from 'body-scroll-lock'
import useLogout from '@bigcommerce/storefront-data-hooks/use-logout'
import useLogout from '@framework/use-logout'
interface DropdownMenuProps {
open?: boolean

View File

@ -1,8 +1,8 @@
import { FC } from 'react'
import Link from 'next/link'
import cn from 'classnames'
import useCart from '@bigcommerce/storefront-data-hooks/cart/use-cart'
import useCustomer from '@bigcommerce/storefront-data-hooks/use-customer'
import useCart from '@framework/cart/use-cart'
import useCustomer from '@framework/use-customer'
import { Heart, Bag } from '@components/icons'
import { useUI } from '@components/ui/context'
import DropdownMenu from './DropdownMenu'

View File

@ -5,8 +5,8 @@ import type { FC } from 'react'
import s from './ProductCard.module.css'
import WishlistButton from '@components/wishlist/WishlistButton'
import usePrice from '@bigcommerce/storefront-data-hooks/use-price'
import type { ProductNode } from '@bigcommerce/storefront-data-hooks/api/operations/get-all-products'
import usePrice from '@framework/use-price'
import type { ProductNode } from '@framework/api/operations/get-all-products'
interface Props {
className?: string

View File

@ -8,9 +8,9 @@ import { useUI } from '@components/ui/context'
import { Swatch, ProductSlider } from '@components/product'
import { Button, Container, Text } from '@components/ui'
import usePrice from '@bigcommerce/storefront-data-hooks/use-price'
import useAddItem from '@bigcommerce/storefront-data-hooks/cart/use-add-item'
import type { ProductNode } from '@bigcommerce/storefront-data-hooks/api/operations/get-product'
import usePrice from '@framework/use-price'
import useAddItem from '@framework/cart/use-add-item'
import type { ProductNode } from '@framework/api/operations/get-product'
import {
getCurrentVariant,
getProductOptions,

View File

@ -1,4 +1,4 @@
import type { ProductNode } from '@bigcommerce/storefront-data-hooks/api/operations/get-product'
import type { ProductNode } from '@framework/api/operations/get-product'
export type SelectedOptions = {
size: string | null

View File

@ -1,10 +1,10 @@
import React, { FC, useState } from 'react'
import cn from 'classnames'
import type { ProductNode } from '@bigcommerce/storefront-data-hooks/api/operations/get-all-products'
import useAddItem from '@bigcommerce/storefront-data-hooks/wishlist/use-add-item'
import useRemoveItem from '@bigcommerce/storefront-data-hooks/wishlist/use-remove-item'
import useWishlist from '@bigcommerce/storefront-data-hooks/wishlist/use-wishlist'
import useCustomer from '@bigcommerce/storefront-data-hooks/use-customer'
import type { ProductNode } from '@framework/api/operations/get-all-products'
import useAddItem from '@framework/wishlist/use-add-item'
import useRemoveItem from '@framework/wishlist/use-remove-item'
import useWishlist from '@framework/wishlist/use-wishlist'
import useCustomer from '@framework/use-customer'
import { Heart } from '@components/icons'
import { useUI } from '@components/ui/context'

View File

@ -2,10 +2,10 @@ import { FC, useState } from 'react'
import cn from 'classnames'
import Link from 'next/link'
import Image from 'next/image'
import type { WishlistItem } from '@bigcommerce/storefront-data-hooks/api/wishlist'
import usePrice from '@bigcommerce/storefront-data-hooks/use-price'
import useRemoveItem from '@bigcommerce/storefront-data-hooks/wishlist/use-remove-item'
import useAddItem from '@bigcommerce/storefront-data-hooks/cart/use-add-item'
import type { WishlistItem } from '@framework/api/wishlist'
import usePrice from '@framework/use-price'
import useRemoveItem from '@framework/wishlist/use-remove-item'
import useAddItem from '@framework/cart/use-add-item'
import { useUI } from '@components/ui/context'
import { Button, Text } from '@components/ui'
import { Trash } from '@components/icons'

View File

@ -6,7 +6,9 @@
"build": "next build",
"start": "next start",
"analyze": "BUNDLE_ANALYZE=both yarn build",
"find:unused": "next-unused"
"find:unused": "next-unused",
"generate": "graphql-codegen",
"generate:definitions": "node framework/bigcommerce/scripts/generate-definitions.js"
},
"prettier": {
"semi": false,
@ -42,7 +44,6 @@
]
},
"dependencies": {
"@bigcommerce/storefront-data-hooks": "^1.0.2",
"@reach/portal": "^0.11.2",
"@tailwindcss/ui": "^0.6.2",
"@vercel/fetch": "^6.1.0",

View File

@ -7,9 +7,9 @@ import getSlug from '@lib/get-slug'
import { missingLocaleInPages } from '@lib/usage-warns'
import { Layout } from '@components/common'
import { Text } from '@components/ui'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getPage from '@bigcommerce/storefront-data-hooks/api/operations/get-page'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import { getConfig } from '@framework/api'
import getPage from '@framework/api/operations/get-page'
import getAllPages from '@framework/api/operations/get-all-pages'
import { defatultPageProps } from '@lib/defaults'
export async function getStaticProps({

View File

@ -1,3 +1,3 @@
import cartApi from '@bigcommerce/storefront-data-hooks/api/cart'
import cartApi from '@framework/api/cart'
export default cartApi()

View File

@ -1,3 +1,3 @@
import catalogProductsApi from '@bigcommerce/storefront-data-hooks/api/catalog/products'
import catalogProductsApi from '@framework/api/catalog/products'
export default catalogProductsApi()

View File

@ -1,3 +1,3 @@
import checkoutApi from '@bigcommerce/storefront-data-hooks/api/checkout'
import checkoutApi from '@framework/api/checkout'
export default checkoutApi()

View File

@ -1,3 +1,3 @@
import customersApi from '@bigcommerce/storefront-data-hooks/api/customers'
import customersApi from '@framework/api/customers'
export default customersApi()

View File

@ -1,3 +1,3 @@
import loginApi from '@bigcommerce/storefront-data-hooks/api/customers/login'
import loginApi from '@framework/api/customers/login'
export default loginApi()

View File

@ -1,3 +1,3 @@
import logoutApi from '@bigcommerce/storefront-data-hooks/api/customers/logout'
import logoutApi from '@framework/api/customers/logout'
export default logoutApi()

View File

@ -1,3 +1,3 @@
import signupApi from '@bigcommerce/storefront-data-hooks/api/customers/signup'
import signupApi from '@framework/api/customers/signup'
export default signupApi()

View File

@ -1,3 +1,3 @@
import wishlistApi from '@bigcommerce/storefront-data-hooks/api/wishlist'
import wishlistApi from '@framework/api/wishlist'
export default wishlistApi()

View File

@ -1,6 +1,6 @@
import type { GetStaticPropsContext } from 'next'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import { getConfig } from '@framework/api'
import getAllPages from '@framework/api/operations/get-all-pages'
import { Layout } from '@components/common'
import { Container } from '@components/ui'

View File

@ -1,8 +1,8 @@
import type { GetStaticPropsContext } from 'next'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import useCart from '@bigcommerce/storefront-data-hooks/cart/use-cart'
import usePrice from '@bigcommerce/storefront-data-hooks/use-price'
import { getConfig } from '@framework/api'
import getAllPages from '@framework/api/operations/get-all-pages'
import useCart from '@framework/cart/use-cart'
import usePrice from '@framework/use-price'
import { Layout } from '@components/common'
import { Button } from '@components/ui'
import { Bag, Cross, Check } from '@components/icons'

View File

@ -5,10 +5,10 @@ import { Grid, Marquee, Hero } from '@components/ui'
import HomeAllProductsGrid from '@components/common/HomeAllProductsGrid'
import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getAllProducts from '@bigcommerce/storefront-data-hooks/api/operations/get-all-products'
import getSiteInfo from '@bigcommerce/storefront-data-hooks/api/operations/get-site-info'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
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'
export async function getStaticProps({
preview,

View File

@ -1,6 +1,6 @@
import type { GetStaticPropsContext } from 'next'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import { getConfig } from '@framework/api'
import getAllPages from '@framework/api/operations/get-all-pages'
import { Layout } from '@components/common'
import { Container, Text } from '@components/ui'
import { Bag } from '@components/icons'

View File

@ -9,10 +9,10 @@ import { ProductView } from '@components/product'
// Data
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getProduct from '@bigcommerce/storefront-data-hooks/api/operations/get-product'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import getAllProductPaths from '@bigcommerce/storefront-data-hooks/api/operations/get-all-product-paths'
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'
export async function getStaticProps({
params,

View File

@ -1,7 +1,7 @@
import type { GetStaticPropsContext } from 'next'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import useCustomer from '@bigcommerce/storefront-data-hooks/use-customer'
import { getConfig } from '@framework/api'
import getAllPages from '@framework/api/operations/get-all-pages'
import useCustomer from '@framework/use-customer'
import { Layout } from '@components/common'
import { Container, Text } from '@components/ui'

View File

@ -3,10 +3,10 @@ import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
import Link from 'next/link'
import { useState } from 'react'
import { useRouter } from 'next/router'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import getSiteInfo from '@bigcommerce/storefront-data-hooks/api/operations/get-site-info'
import useSearch from '@bigcommerce/storefront-data-hooks/products/use-search'
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/products/use-search'
import { Layout } from '@components/common'
import { ProductCard } from '@components/product'
import { Container, Grid, Skeleton } from '@components/ui'

View File

@ -1,7 +1,7 @@
import type { GetStaticPropsContext } from 'next'
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
import useWishlist from '@bigcommerce/storefront-data-hooks/wishlist/use-wishlist'
import { getConfig } from '@framework/api'
import getAllPages from '@framework/api/operations/get-all-pages'
import useWishlist from '@framework/wishlist/use-wishlist'
import { Layout } from '@components/common'
import { Heart } from '@components/icons'
import { Text, Container } from '@components/ui'

View File

@ -21,7 +21,9 @@
"@components/*": ["components/*"],
"@utils/*": ["utils/*"],
"@commerce/*": ["framework/commerce/*"],
"@framework/*": ["framework/bigcommerce/*"]
"@commerce": ["framework/commerce"],
"@framework/*": ["framework/bigcommerce/*"],
"@framework": ["framework/bigcommerce"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],

View File

@ -538,17 +538,6 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"
"@bigcommerce/storefront-data-hooks@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@bigcommerce/storefront-data-hooks/-/storefront-data-hooks-1.0.2.tgz#2d9f0dca4f297324f853ba9f09bf09a269c8ff64"
integrity sha512-uqbL5Wn2iGtBRhOxu+lhqGRAnXoaDVbyRQN+BFP1ClbpdUUWDtXmmLKbK0lpo52OSnj0i7Eu1RYXkZIy3EJofg==
dependencies:
"@vercel/fetch" "6.1.0"
cookie "0.4.1"
js-cookie "2.2.1"
lodash.debounce "4.0.8"
swr "0.3.6"
"@csstools/convert-colors@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7"
@ -1305,7 +1294,7 @@
async-retry "^1.3.1"
debug "^3.1.0"
"@vercel/fetch@6.1.0", "@vercel/fetch@^6.1.0":
"@vercel/fetch@^6.1.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@vercel/fetch/-/fetch-6.1.0.tgz#4959cd264d25e811b46491818a9d9ca5d752a2a9"
integrity sha512-xR0GQggKhPvwEWrqcrobsQFjyR/bDDbX24BkSaRyLzW+8SydKhkBc/mBCUV8h4SBZSlJMJnqhrxjFCZ1uJcqNg==
@ -2476,7 +2465,7 @@ cookie@0.4.0:
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba"
integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==
cookie@0.4.1, cookie@^0.4.1:
cookie@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1"
integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==
@ -4428,7 +4417,7 @@ jest-worker@^26.6.1:
merge-stream "^2.0.0"
supports-color "^7.0.0"
js-cookie@2.2.1, js-cookie@^2.2.1:
js-cookie@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8"
integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==
@ -4715,7 +4704,7 @@ lodash._reinterpolate@^3.0.0:
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=
lodash.debounce@4.0.8, lodash.debounce@^4.0.8:
lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
@ -7293,13 +7282,6 @@ supports-color@^7.0.0, supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"
swr@0.3.6:
version "0.3.6"
resolved "https://registry.yarnpkg.com/swr/-/swr-0.3.6.tgz#b1d59439e5114fdf95bb408e1c628ff48f967aac"
integrity sha512-LHbX9vVQSW8Kgyr86zz2fVVKmmT13qxB61uXuUAg6NT4cGu6afzAzT2SVCGEh8pJAD2o8NTZMgclIUxIAbvk7Q==
dependencies:
dequal "2.0.2"
swr@^0.3.11:
version "0.3.11"
resolved "https://registry.yarnpkg.com/swr/-/swr-0.3.11.tgz#f7f50ed26c06afea4249482cec504768a2272664"