diff --git a/.changeset/eslint-ignore-rest-siblings.md b/.changeset/eslint-ignore-rest-siblings.md new file mode 100644 index 00000000000..ae1dfa2ba2b --- /dev/null +++ b/.changeset/eslint-ignore-rest-siblings.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/eslint-config-pwa': patch +--- + +Added `ignoreRestSiblings` and `argsIgnorePattern: '^_'` to `@typescript-eslint/no-unused-vars`. A component can take a prop out of `...rest` without using it, and a parameter that starts with `_` can stay unused. diff --git a/.changeset/image-no-next-ui.md b/.changeset/image-no-next-ui.md new file mode 100644 index 00000000000..40fa021aa8e --- /dev/null +++ b/.changeset/image-no-next-ui.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/image': patch +--- + +Removed the import of `@graphcommerce/next-ui` from `@graphcommerce/image`, because `@graphcommerce/next-ui` depends on `@graphcommerce/image`. diff --git a/.changeset/import-type.md b/.changeset/import-type.md new file mode 100644 index 00000000000..60067b9be2e --- /dev/null +++ b/.changeset/import-type.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/misc': patch +--- + +Changed the imports that only import types to `import type`. diff --git a/.changeset/remove-unused-vars.md b/.changeset/remove-unused-vars.md new file mode 100644 index 00000000000..c690eb22621 --- /dev/null +++ b/.changeset/remove-unused-vars.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/misc': patch +--- + +Removed unused imports, variables and parameters. diff --git a/examples/magento-graphcms/components/Blog/BlogAuthor.tsx b/examples/magento-graphcms/components/Blog/BlogAuthor.tsx index 5c964c91cc9..69354357429 100644 --- a/examples/magento-graphcms/components/Blog/BlogAuthor.tsx +++ b/examples/magento-graphcms/components/Blog/BlogAuthor.tsx @@ -1,5 +1,5 @@ import { BlogAuthor as NextBlogAuthor } from '@graphcommerce/next-ui' -import { BlogAuthorFragment } from './BlogAuthor.gql' +import type { BlogAuthorFragment } from './BlogAuthor.gql' type BlogAuthorProps = BlogAuthorFragment diff --git a/examples/magento-graphcms/components/Blog/BlogHeader.tsx b/examples/magento-graphcms/components/Blog/BlogHeader.tsx index 48ef13b08a3..07ca1191555 100644 --- a/examples/magento-graphcms/components/Blog/BlogHeader.tsx +++ b/examples/magento-graphcms/components/Blog/BlogHeader.tsx @@ -1,4 +1,5 @@ -import { Asset, AssetFragment } from '@graphcommerce/hygraph-ui' +import type { AssetFragment } from '@graphcommerce/hygraph-ui' +import { Asset } from '@graphcommerce/hygraph-ui' import { BlogHeader as NextBlogHeader } from '@graphcommerce/next-ui' export function BlogHeader(props: { asset?: AssetFragment }) { diff --git a/examples/magento-graphcms/components/Blog/BlogItem.tsx b/examples/magento-graphcms/components/Blog/BlogItem.tsx index a290014faf7..22f2ebabf26 100644 --- a/examples/magento-graphcms/components/Blog/BlogItem.tsx +++ b/examples/magento-graphcms/components/Blog/BlogItem.tsx @@ -2,7 +2,7 @@ import { Asset } from '@graphcommerce/hygraph-ui' import { BlogListItem } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import { Typography, useTheme } from '@mui/material' -import { BlogItemFragment } from './BlogItem.gql' +import type { BlogItemFragment } from './BlogItem.gql' type BlogItemProps = BlogItemFragment diff --git a/examples/magento-graphcms/components/Blog/BlogList.tsx b/examples/magento-graphcms/components/Blog/BlogList.tsx index 63d3775152b..ce680c3a08c 100644 --- a/examples/magento-graphcms/components/Blog/BlogList.tsx +++ b/examples/magento-graphcms/components/Blog/BlogList.tsx @@ -1,6 +1,6 @@ import { BlogItemGrid } from '@graphcommerce/next-ui' import { BlogItem } from './BlogItem' -import { BlogListQuery } from './BlogList.gql' +import type { BlogListQuery } from './BlogList.gql' type BlogListProps = BlogListQuery diff --git a/examples/magento-graphcms/components/Blog/BlogTags.tsx b/examples/magento-graphcms/components/Blog/BlogTags.tsx index 7628013a88f..c1dec0c068f 100644 --- a/examples/magento-graphcms/components/Blog/BlogTags.tsx +++ b/examples/magento-graphcms/components/Blog/BlogTags.tsx @@ -1,5 +1,5 @@ import { BlogTag, BlogTags as NextBlogTags } from '@graphcommerce/next-ui' -import { BlogTagsFragment } from './BlogTags.gql' +import type { BlogTagsFragment } from './BlogTags.gql' type BlogTagsProps = BlogTagsFragment diff --git a/examples/magento-graphcms/components/Blog/RowBlogContent.tsx b/examples/magento-graphcms/components/Blog/RowBlogContent.tsx index 4b17c50ab9e..1e9f39ddad2 100644 --- a/examples/magento-graphcms/components/Blog/RowBlogContent.tsx +++ b/examples/magento-graphcms/components/Blog/RowBlogContent.tsx @@ -1,6 +1,6 @@ import { RichText } from '@graphcommerce/hygraph-ui' import { BlogContent } from '@graphcommerce/next-ui' -import { RowBlogContentFragment } from './RowBlogContent.gql' +import type { RowBlogContentFragment } from './RowBlogContent.gql' type RowBlogContentProps = RowBlogContentFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowButtonLinkList/RowButtonLinkList.tsx b/examples/magento-graphcms/components/GraphCMS/RowButtonLinkList/RowButtonLinkList.tsx index b6822e8037e..aedd023a598 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowButtonLinkList/RowButtonLinkList.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowButtonLinkList/RowButtonLinkList.tsx @@ -1,5 +1,5 @@ import { ButtonLinkListItem, ButtonLinkList } from '@graphcommerce/next-ui' -import { RowButtonLinkListFragment } from './RowButtonLinkList.gql' +import type { RowButtonLinkListFragment } from './RowButtonLinkList.gql' export type RowButtonLinkListProps = RowButtonLinkListFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Default.tsx b/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Default.tsx index a29e8d3a863..ec0b92d8560 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Default.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Default.tsx @@ -1,4 +1,5 @@ -import { RichText, RichTextProps } from '@graphcommerce/hygraph-ui' +import type { RichTextProps } from '@graphcommerce/hygraph-ui' +import { RichText } from '@graphcommerce/hygraph-ui' import { ColumnOne } from '@graphcommerce/next-ui' import type { RowColumnOneFragment } from '../RowColumnOne.gql' diff --git a/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Message.tsx b/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Message.tsx index 3d476cbe803..7de4ec11211 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Message.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowColumnOne/variant/Message.tsx @@ -1,4 +1,5 @@ -import { RichText, RichTextProps } from '@graphcommerce/hygraph-ui' +import type { RichTextProps } from '@graphcommerce/hygraph-ui' +import { RichText } from '@graphcommerce/hygraph-ui' import { VariantMessage } from '@graphcommerce/next-ui' import type { RowColumnOneFragment } from '../RowColumnOne.gql' diff --git a/examples/magento-graphcms/components/GraphCMS/RowColumnThree/RowColumnThree.tsx b/examples/magento-graphcms/components/GraphCMS/RowColumnThree/RowColumnThree.tsx index 383eb087473..a90b4095f1a 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowColumnThree/RowColumnThree.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowColumnThree/RowColumnThree.tsx @@ -1,6 +1,6 @@ import { RichText } from '@graphcommerce/hygraph-ui' import { ColumnThree } from '@graphcommerce/next-ui' -import { RowColumnThreeFragment } from './RowColumnThree.gql' +import type { RowColumnThreeFragment } from './RowColumnThree.gql' export function RowColumnThree(props: RowColumnThreeFragment) { const { colOne, colTwo, colThree } = props diff --git a/examples/magento-graphcms/components/GraphCMS/RowColumnTwo/RowColumnTwo.tsx b/examples/magento-graphcms/components/GraphCMS/RowColumnTwo/RowColumnTwo.tsx index 4e90dcb635c..ee1dc15f5e6 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowColumnTwo/RowColumnTwo.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowColumnTwo/RowColumnTwo.tsx @@ -1,6 +1,6 @@ import { RichText } from '@graphcommerce/hygraph-ui' import { ColumnTwo } from '@graphcommerce/next-ui' -import { RowColumnTwoFragment } from './RowColumnTwo.gql' +import type { RowColumnTwoFragment } from './RowColumnTwo.gql' export function RowColumnTwo(props: RowColumnTwoFragment) { const { colOne, colTwo } = props diff --git a/examples/magento-graphcms/components/GraphCMS/RowContentLinks/RowContentLinks.tsx b/examples/magento-graphcms/components/GraphCMS/RowContentLinks/RowContentLinks.tsx index f9783856b7e..875c6215950 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowContentLinks/RowContentLinks.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowContentLinks/RowContentLinks.tsx @@ -1,6 +1,6 @@ import { ContentLinks } from '@graphcommerce/next-ui' import { Link } from '@mui/material' -import { RowContentLinksFragment } from './RowContentLinks.gql' +import type { RowContentLinksFragment } from './RowContentLinks.gql' /** @deprecated Replace with RowLinks */ export function RowContentLinks(props: RowContentLinksFragment) { diff --git a/examples/magento-graphcms/components/GraphCMS/RowHeroBanner/RowHeroBanner.tsx b/examples/magento-graphcms/components/GraphCMS/RowHeroBanner/RowHeroBanner.tsx index cd9c6e13dcf..28d531717dd 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowHeroBanner/RowHeroBanner.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowHeroBanner/RowHeroBanner.tsx @@ -2,7 +2,7 @@ import type { AssetProps } from '@graphcommerce/hygraph-ui' import { Asset, RichText } from '@graphcommerce/hygraph-ui' import { breakpointVal, HeroBanner } from '@graphcommerce/next-ui' import { Button } from '@mui/material' -import { RowHeroBannerFragment } from './RowHeroBanner.gql' +import type { RowHeroBannerFragment } from './RowHeroBanner.gql' export type RowHeroBannerProps = RowHeroBannerFragment & { /** diff --git a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/ImageLabelSwiper.tsx b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/ImageLabelSwiper.tsx index 5cd0c34aa3b..7657f5a76fb 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/ImageLabelSwiper.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/ImageLabelSwiper.tsx @@ -1,7 +1,7 @@ import { Asset, RichText } from '@graphcommerce/hygraph-ui' import { responsiveVal, VariantImageLabelSwiper } from '@graphcommerce/next-ui' import { Box, ButtonBase, Typography } from '@mui/material' -import { RowLinksFragment } from '../RowLinks.gql' +import type { RowLinksFragment } from '../RowLinks.gql' export function ImageLabelSwiper(props: RowLinksFragment) { const { title, rowLinksCopy, pageLinks } = props diff --git a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Inline.tsx b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Inline.tsx index d9536fc3e6c..2ccd86e208c 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Inline.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Inline.tsx @@ -1,7 +1,7 @@ import { VariantInline } from '@graphcommerce/next-ui' import { Link } from '@mui/material' -import { RowLinksFragment } from '../RowLinks.gql' +import type { RowLinksFragment } from '../RowLinks.gql' export function Inline(props: RowLinksFragment) { const { title, pageLinks } = props diff --git a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/LogoSwiper.tsx b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/LogoSwiper.tsx index 3fb599ea8c8..d6a8e1c8315 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/LogoSwiper.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/LogoSwiper.tsx @@ -1,7 +1,7 @@ import { Asset } from '@graphcommerce/hygraph-ui' import { VariantLogoSwiper } from '@graphcommerce/next-ui' import { Link } from '@mui/material' -import { RowLinksFragment } from '../RowLinks.gql' +import type { RowLinksFragment } from '../RowLinks.gql' export function LogoSwiper(props: RowLinksFragment) { const { title, pageLinks } = props diff --git a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Usps.tsx b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Usps.tsx index 6cd3697241b..4e62125e83d 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Usps.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowLinks/variant/Usps.tsx @@ -2,7 +2,7 @@ import { RichText } from '@graphcommerce/hygraph-ui' import { iconCheckmark, IconSvg, VariantUsps } from '@graphcommerce/next-ui' import { Box } from '@mui/material' -import { RowLinksFragment } from '../RowLinks.gql' +import type { RowLinksFragment } from '../RowLinks.gql' export function Usps(props: RowLinksFragment) { const { title, pageLinks } = props diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/RowProduct.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/RowProduct.tsx index 9a757f14c6f..c16db55d89d 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/RowProduct.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/RowProduct.tsx @@ -1,11 +1,8 @@ import { PrivateQueryMaskProvider, usePrivateQuery } from '@graphcommerce/graphql' -import { - ProductListDocument, - ProductListItemsFragment, - ProductSpecsFragment, -} from '@graphcommerce/magento-product' +import type { ProductListItemsFragment, ProductSpecsFragment } from '@graphcommerce/magento-product' +import { ProductListDocument } from '@graphcommerce/magento-product' import { filterNonNullableKeys } from '@graphcommerce/next-ui' -import { RowProductFragment } from './RowProduct.gql' +import type { RowProductFragment } from './RowProduct.gql' import { Backstory, Feature, diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Backstory.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Backstory.tsx index afa0f255214..da3c13c06b4 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Backstory.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Backstory.tsx @@ -1,9 +1,10 @@ import { Asset, RichText } from '@graphcommerce/hygraph-ui' -import { AddProductsToCartForm, ProductListItemsFragment } from '@graphcommerce/magento-product' +import type { ProductListItemsFragment } from '@graphcommerce/magento-product' +import { AddProductsToCartForm } from '@graphcommerce/magento-product' import { ParagraphWithSidebarSlide, RenderType } from '@graphcommerce/next-ui' import { useTheme } from '@mui/material' import { productListRenderer } from '../../../ProductListItems' -import { RowProductFragment } from '../RowProduct.gql' +import type { RowProductFragment } from '../RowProduct.gql' type BackstoryProps = RowProductFragment & ProductListItemsFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Feature.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Feature.tsx index e875c7d6746..46b8a0a917a 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Feature.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Feature.tsx @@ -2,8 +2,8 @@ import { RichText } from '@graphcommerce/hygraph-ui' import { Image } from '@graphcommerce/image' import { ImageText, useContainerSpacing } from '@graphcommerce/next-ui' import { Typography, useTheme } from '@mui/material' -import { RowProductFragment } from '../RowProduct.gql' -import { ProductFeatureMediaFragment } from './ProductFeatureMedia.gql' +import type { RowProductFragment } from '../RowProduct.gql' +import type { ProductFeatureMediaFragment } from './ProductFeatureMedia.gql' type FeatureProps = RowProductFragment & ProductFeatureMediaFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/FeatureBoxed.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/FeatureBoxed.tsx index ed1549626ab..71b967d4450 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/FeatureBoxed.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/FeatureBoxed.tsx @@ -2,8 +2,8 @@ import { RichText } from '@graphcommerce/hygraph-ui' import { Image } from '@graphcommerce/image' import { ImageTextBoxed, responsiveVal } from '@graphcommerce/next-ui' import { Typography, useTheme } from '@mui/material' -import { RowProductFragment } from '../RowProduct.gql' -import { ProductFeatureMediaBoxedFragment } from './ProductFeatureMediaBoxed.gql' +import type { RowProductFragment } from '../RowProduct.gql' +import type { ProductFeatureMediaBoxedFragment } from './ProductFeatureMediaBoxed.gql' type FeatureBoxedProps = RowProductFragment & ProductFeatureMediaBoxedFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Grid.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Grid.tsx index 6fbf98caef0..3327693300b 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Grid.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Grid.tsx @@ -1,7 +1,8 @@ import { ContainerWithHeader } from '@graphcommerce/next-ui' import { Link } from '@mui/material' -import { ProductListItems, ProductListItemsProps } from '../../../ProductListItems/ProductListItems' -import { RowProductFragment } from '../RowProduct.gql' +import type { ProductListItemsProps } from '../../../ProductListItems/ProductListItems' +import { ProductListItems } from '../../../ProductListItems/ProductListItems' +import type { RowProductFragment } from '../RowProduct.gql' type GridProps = RowProductFragment & ProductListItemsProps diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Related.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Related.tsx index 9791fc73cd3..c54e9bdd23f 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Related.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Related.tsx @@ -1,13 +1,10 @@ -import { AddProductsToCartForm, RelatedProductsFragment } from '@graphcommerce/magento-product' -import { - SidebarSlider, - RenderType, - responsiveVal, - SidebarSliderProps, -} from '@graphcommerce/next-ui' +import type { RelatedProductsFragment } from '@graphcommerce/magento-product' +import { AddProductsToCartForm } from '@graphcommerce/magento-product' +import type { SidebarSliderProps } from '@graphcommerce/next-ui' +import { SidebarSlider, RenderType, responsiveVal } from '@graphcommerce/next-ui' import { Typography } from '@mui/material' import { productListRenderer } from '../../../ProductListItems/productListRenderer' -import { RowProductFragment } from '../RowProduct.gql' +import type { RowProductFragment } from '../RowProduct.gql' type RelatedProps = RowProductFragment & RelatedProductsFragment & Pick diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Reviews.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Reviews.tsx index 7012fd0c25e..24be2234c9e 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Reviews.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Reviews.tsx @@ -1,9 +1,10 @@ import { useQuery } from '@graphcommerce/graphql' -import { ProductReviews, ProductReviewsProps } from '@graphcommerce/magento-review' +import type { ProductReviewsProps } from '@graphcommerce/magento-review' +import { ProductReviews } from '@graphcommerce/magento-review' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { Row, sxx } from '@graphcommerce/next-ui' +import { Row } from '@graphcommerce/next-ui' import { Box, Typography } from '@mui/material' -import { RowProductFragment } from '../RowProduct.gql' +import type { RowProductFragment } from '../RowProduct.gql' type ReviewsProps = RowProductFragment & Partial diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Specs.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Specs.tsx index 3b22e3c8071..67a0580cbc7 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Specs.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Specs.tsx @@ -1,5 +1,6 @@ -import { ProductSpecs, ProductSpecsFragment } from '@graphcommerce/magento-product' -import { RowProductFragment } from '../RowProduct.gql' +import type { ProductSpecsFragment } from '@graphcommerce/magento-product' +import { ProductSpecs } from '@graphcommerce/magento-product' +import type { RowProductFragment } from '../RowProduct.gql' type SpecsProps = RowProductFragment & ProductSpecsFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Swipeable.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Swipeable.tsx index 97a8232cba9..e48dcb2e3f0 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Swipeable.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Swipeable.tsx @@ -1,14 +1,10 @@ -import { AddProductsToCartForm, ProductListItemsFragment } from '@graphcommerce/magento-product' -import { - RenderType, - responsiveVal, - SidebarSlider, - SidebarSliderProps, - sxx, -} from '@graphcommerce/next-ui' +import type { ProductListItemsFragment } from '@graphcommerce/magento-product' +import { AddProductsToCartForm } from '@graphcommerce/magento-product' +import type { SidebarSliderProps } from '@graphcommerce/next-ui' +import { RenderType, responsiveVal, SidebarSlider, sxx } from '@graphcommerce/next-ui' import { Typography } from '@mui/material' import { productListRenderer } from '../../../ProductListItems/productListRenderer' -import { RowProductFragment } from '../RowProduct.gql' +import type { RowProductFragment } from '../RowProduct.gql' type SwipeableProps = RowProductFragment & ProductListItemsFragment & Pick diff --git a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Upsells.tsx b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Upsells.tsx index ab1a496cbed..2e009c7ac74 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Upsells.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowProduct/variant/Upsells.tsx @@ -1,13 +1,10 @@ -import { AddProductsToCartForm, UpsellProductsFragment } from '@graphcommerce/magento-product' -import { - SidebarSlider, - RenderType, - responsiveVal, - SidebarSliderProps, -} from '@graphcommerce/next-ui' +import type { UpsellProductsFragment } from '@graphcommerce/magento-product' +import { AddProductsToCartForm } from '@graphcommerce/magento-product' +import type { SidebarSliderProps } from '@graphcommerce/next-ui' +import { SidebarSlider, RenderType, responsiveVal } from '@graphcommerce/next-ui' import { Typography } from '@mui/material' import { productListRenderer } from '../../../ProductListItems/productListRenderer' -import { RowProductFragment } from '../RowProduct.gql' +import type { RowProductFragment } from '../RowProduct.gql' type UpsellsProps = RowProductFragment & UpsellProductsFragment & Pick diff --git a/examples/magento-graphcms/components/GraphCMS/RowQuote/RowQuote.tsx b/examples/magento-graphcms/components/GraphCMS/RowQuote/RowQuote.tsx index f243e905901..54564322945 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowQuote/RowQuote.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowQuote/RowQuote.tsx @@ -1,7 +1,6 @@ import { RichText } from '@graphcommerce/hygraph-ui' import { Quote } from '@graphcommerce/next-ui' -import React from 'react' -import { RowQuoteFragment } from './RowQuote.gql' +import type { RowQuoteFragment } from './RowQuote.gql' type RowQuoteProps = RowQuoteFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowRenderer.tsx b/examples/magento-graphcms/components/GraphCMS/RowRenderer.tsx index 55f11894a0b..9d1d9a736b2 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowRenderer.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowRenderer.tsx @@ -1,7 +1,8 @@ -import { LazyHydrate, RenderType, TypeRenderer } from '@graphcommerce/next-ui' +import type { TypeRenderer } from '@graphcommerce/next-ui' +import { LazyHydrate, RenderType } from '@graphcommerce/next-ui' import { memo } from 'react' import { RowBlogContent } from '../Blog' -import { PageContentQueryFragment } from './PageContentQueryFragment.gql' +import type { PageContentQueryFragment } from './PageContentQueryFragment.gql' import { RowButtonLinkList } from './RowButtonLinkList/RowButtonLinkList' import { RowColumnOne } from './RowColumnOne/RowColumnOne' import { RowColumnThree } from './RowColumnThree/RowColumnThree' @@ -11,7 +12,7 @@ import { RowHeroBanner } from './RowHeroBanner/RowHeroBanner' import { RowLinks } from './RowLinks/RowLinks' import { RowProduct } from './RowProduct/RowProduct' import { RowQuote } from './RowQuote/RowQuote' -import { RowRendererFragment } from './RowRenderer.gql' +import type { RowRendererFragment } from './RowRenderer.gql' import { RowServiceOptions } from './RowServiceOptions/RowServiceOptions' import { RowSpecialBanner } from './RowSpecialBanner/RowSpecialBanner' diff --git a/examples/magento-graphcms/components/GraphCMS/RowServiceOptions/RowServiceOptions.tsx b/examples/magento-graphcms/components/GraphCMS/RowServiceOptions/RowServiceOptions.tsx index 869ee17e352..d74ed3fb6d1 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowServiceOptions/RowServiceOptions.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowServiceOptions/RowServiceOptions.tsx @@ -7,7 +7,7 @@ import { iconPhone, IconSvg, } from '@graphcommerce/next-ui' -import { RowServiceOptionsFragment } from './RowServiceOptions.gql' +import type { RowServiceOptionsFragment } from './RowServiceOptions.gql' type RowServiceOptionsProps = RowServiceOptionsFragment diff --git a/examples/magento-graphcms/components/GraphCMS/RowSpecialBanner/RowSpecialBanner.tsx b/examples/magento-graphcms/components/GraphCMS/RowSpecialBanner/RowSpecialBanner.tsx index cc79a4ae45c..78b8178ea9d 100644 --- a/examples/magento-graphcms/components/GraphCMS/RowSpecialBanner/RowSpecialBanner.tsx +++ b/examples/magento-graphcms/components/GraphCMS/RowSpecialBanner/RowSpecialBanner.tsx @@ -1,7 +1,7 @@ import { RichText, Asset } from '@graphcommerce/hygraph-ui' import { breakpointVal, SpecialBanner } from '@graphcommerce/next-ui' import { Link } from '@mui/material' -import { RowSpecialBannerFragment } from './RowSpecialBanner.gql' +import type { RowSpecialBannerFragment } from './RowSpecialBanner.gql' type RowSpecialBannerProps = RowSpecialBannerFragment diff --git a/examples/magento-graphcms/components/Layout/Footer.tsx b/examples/magento-graphcms/components/Layout/Footer.tsx index 943a38fd966..36b6a9fca7d 100644 --- a/examples/magento-graphcms/components/Layout/Footer.tsx +++ b/examples/magento-graphcms/components/Layout/Footer.tsx @@ -5,7 +5,7 @@ import { magentoVersion } from '@graphcommerce/next-config/config' import { DateFormat, FindAndReplace, Footer as FooterBase } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import { Button, IconButton, Link } from '@mui/material' -import { FooterQueryFragment } from './FooterQueryFragment.gql' +import type { FooterQueryFragment } from './FooterQueryFragment.gql' import { useQuery } from '@graphcommerce/graphql' export type FooterProps = FooterQueryFragment diff --git a/examples/magento-graphcms/components/Layout/LayoutMinimal.tsx b/examples/magento-graphcms/components/Layout/LayoutMinimal.tsx index 714433b4f1c..703b8d42d69 100644 --- a/examples/magento-graphcms/components/Layout/LayoutMinimal.tsx +++ b/examples/magento-graphcms/components/Layout/LayoutMinimal.tsx @@ -1,6 +1,6 @@ import { Footer } from './Footer' import { HeaderContainer } from './HeaderContainer' -import { LayoutQuery } from './Layout.gql' +import type { LayoutQuery } from './Layout.gql' import { LayoutDefault, type LayoutDefaultProps } from './LayoutDefault' import { Logo } from './Logo' diff --git a/examples/magento-graphcms/components/Layout/LayoutOverlay.tsx b/examples/magento-graphcms/components/Layout/LayoutOverlay.tsx index c1cb67f5a56..ec315835d5f 100644 --- a/examples/magento-graphcms/components/Layout/LayoutOverlay.tsx +++ b/examples/magento-graphcms/components/Layout/LayoutOverlay.tsx @@ -1,4 +1,4 @@ -import { LayoutOverlayProps as LayoutOverlayBaseProps } from '@graphcommerce/next-ui' +import type { LayoutOverlayProps as LayoutOverlayBaseProps } from '@graphcommerce/next-ui' export { LayoutOverlay } from '@graphcommerce/next-ui' diff --git a/examples/magento-graphcms/components/ProductListItems/ProductListItems.tsx b/examples/magento-graphcms/components/ProductListItems/ProductListItems.tsx index 2add4576b8e..0a26cd7751f 100644 --- a/examples/magento-graphcms/components/ProductListItems/ProductListItems.tsx +++ b/examples/magento-graphcms/components/ProductListItems/ProductListItems.tsx @@ -1,4 +1,5 @@ -import { ProductListItemsBase, ProductItemsGridProps } from '@graphcommerce/magento-product' +import type { ProductItemsGridProps } from '@graphcommerce/magento-product' +import { ProductListItemsBase } from '@graphcommerce/magento-product' import { productListRenderer } from './productListRenderer' export type ProductListItemsProps = Omit diff --git a/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutClassic.tsx b/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutClassic.tsx index f237d08e5e8..30f00d17c9e 100644 --- a/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutClassic.tsx +++ b/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutClassic.tsx @@ -14,7 +14,7 @@ import { import { breadcrumbs } from '@graphcommerce/next-config/config' import { LayoutTitle, memoDeep, StickyBelowHeader, Container } from '@graphcommerce/next-ui' import { ProductListItems, productListRenderer } from '../ProductListItems' -import { ProductListLayoutProps } from './types' +import type { ProductListLayoutProps } from './types' import { Trans } from '@lingui/react/macro' export const ProductListLayoutClassic = memoDeep(function ProductListLayoutClassic( diff --git a/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutDefault.tsx b/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutDefault.tsx index dcd90cf7bc3..da0450ee4f5 100644 --- a/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutDefault.tsx +++ b/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutDefault.tsx @@ -22,7 +22,8 @@ import { Container, LayoutTitle, memoDeep, StickyBelowHeader } from '@graphcomme import { Trans } from '@lingui/react/macro' import { Typography } from '@mui/material' import { ProductListItems, productListRenderer } from '../ProductListItems' -import { ProductListLayoutProps, useLayoutConfiguration } from './types' +import type { ProductListLayoutProps } from './types' +import { useLayoutConfiguration } from './types' export const ProductListLayoutDefault = memoDeep(function ProductListLayoutDefault( props: ProductListLayoutProps, diff --git a/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutSidebar.tsx b/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutSidebar.tsx index 95bfeae2c83..e5862d999da 100644 --- a/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutSidebar.tsx +++ b/examples/magento-graphcms/components/ProductListLayout/ProductListLayoutSidebar.tsx @@ -30,7 +30,8 @@ import { MediaQuery, memoDeep, Container, StickyBelowHeader, sxx } from '@graphc import { Trans } from '@lingui/react/macro' import { Box, Typography } from '@mui/material' import { ProductListItems, productListRenderer } from '../ProductListItems' -import { ProductListLayoutProps, useLayoutConfiguration } from './types' +import type { ProductListLayoutProps } from './types' +import { useLayoutConfiguration } from './types' export const ProductListLayoutSidebar = memoDeep(function ProductListLayoutSidebar( props: ProductListLayoutProps, diff --git a/examples/magento-graphcms/components/Usps/Usps.tsx b/examples/magento-graphcms/components/Usps/Usps.tsx index 7eecc921fe0..cc7354ba90b 100644 --- a/examples/magento-graphcms/components/Usps/Usps.tsx +++ b/examples/magento-graphcms/components/Usps/Usps.tsx @@ -1,6 +1,7 @@ import { RichText, Asset } from '@graphcommerce/hygraph-ui' -import { UspList, UspListItem, UspListProps } from '@graphcommerce/next-ui' -import { UspsQueryFragment } from './UspsQueryFragment.gql' +import type { UspListProps } from '@graphcommerce/next-ui' +import { UspList, UspListItem } from '@graphcommerce/next-ui' +import type { UspsQueryFragment } from './UspsQueryFragment.gql' export type ProductUspsProps = UspsQueryFragment & Pick diff --git a/examples/magento-graphcms/components/theme.ts b/examples/magento-graphcms/components/theme.ts index 80fd20dc7e1..5f8a8219c6f 100644 --- a/examples/magento-graphcms/components/theme.ts +++ b/examples/magento-graphcms/components/theme.ts @@ -14,8 +14,8 @@ import { responsiveVal, themeBaseDefaults, } from '@graphcommerce/next-ui' -import { LinkProps, Theme } from '@mui/material' -import { Components, PaletteOptions } from '@mui/material/styles' +import type { LinkProps, Theme } from '@mui/material' +import type { Components, PaletteOptions } from '@mui/material/styles' import type {} from '@mui/material/themeCssVarsAugmentation' const lightPalette: PaletteOptions = { diff --git a/examples/magento-graphcms/lib/i18n/I18nProvider.tsx b/examples/magento-graphcms/lib/i18n/I18nProvider.tsx index 3dff459609e..f45607bfed9 100644 --- a/examples/magento-graphcms/lib/i18n/I18nProvider.tsx +++ b/examples/magento-graphcms/lib/i18n/I18nProvider.tsx @@ -1,4 +1,5 @@ -import { LinguiProvider, LinguiProviderProps, SyncMessageLoader } from '@graphcommerce/lingui-next' +import type { LinguiProviderProps, SyncMessageLoader } from '@graphcommerce/lingui-next' +import { LinguiProvider } from '@graphcommerce/lingui-next' import { normalizeLocale } from '@graphcommerce/next-ui' import { i18n } from '@lingui/core' diff --git a/examples/magento-graphcms/pages/[...url].tsx b/examples/magento-graphcms/pages/[...url].tsx index 955156d3f87..e7a96710f4d 100644 --- a/examples/magento-graphcms/pages/[...url].tsx +++ b/examples/magento-graphcms/pages/[...url].tsx @@ -1,7 +1,8 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst, flushMeasurePerf, PrivateQueryMaskProvider } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { Asset, hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { Asset, hygraphPageContent } from '@graphcommerce/hygraph-ui' import { appendSiblingsAsChildren, CategoryBreadcrumbs, @@ -11,43 +12,41 @@ import { findParentBreadcrumbItem, getCategoryStaticPaths, } from '@graphcommerce/magento-category' +import type { + FilterTypes, + ProductFiltersQuery, + ProductListParams, + ProductListQuery, +} from '@graphcommerce/magento-product' import { extractUrlQuery, - FilterTypes, getFilterTypes, parseParams, ProductFiltersDocument, - ProductFiltersQuery, productListApplyCategoryDefaults, ProductListDocument, - ProductListParams, - ProductListQuery, categoryDefaultsToProductListFilters, useProductList, productListLink, hasUserFilterActive, } from '@graphcommerce/magento-product' import { redirectOrNotFound, redirectTo, StoreConfigDocument } from '@graphcommerce/magento-store' -import { - Container, - GetStaticProps, - LayoutHeader, - LayoutTitle, - MetaRobots, -} from '@graphcommerce/next-ui' +import type { GetStaticProps, MetaRobots } from '@graphcommerce/next-ui' +import { Container, LayoutHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' -import { GetStaticPaths } from 'next' +import type { GetStaticPaths } from 'next' +import type { LayoutNavigationProps } from '../components' import { ProductListLayoutClassic, ProductListLayoutDefault, ProductListLayoutSidebar, LayoutDocument, LayoutNavigation, - LayoutNavigationProps, RowProduct, RowRenderer, } from '../components' -import { CategoryPageDocument, CategoryPageQuery } from '../graphql/CategoryPage.gql' +import type { CategoryPageQuery } from '../graphql/CategoryPage.gql' +import { CategoryPageDocument } from '../graphql/CategoryPage.gql' import { graphqlSharedClient, graphqlSsrClient } from '../lib/graphql/graphqlSsrClient' import { breadcrumbs, diff --git a/examples/magento-graphcms/pages/_app.tsx b/examples/magento-graphcms/pages/_app.tsx index f60390c44cb..2d0b1928cf5 100644 --- a/examples/magento-graphcms/pages/_app.tsx +++ b/examples/magento-graphcms/pages/_app.tsx @@ -3,7 +3,7 @@ import { GraphQLProvider } from '@graphcommerce/graphql' import { GlobalHead } from '@graphcommerce/magento-store' import { CssAndFramerMotionProvider, PageLoadIndicator } from '@graphcommerce/next-ui' import { CssBaseline, ThemeProvider } from '@mui/material' -import { AppProps } from 'next/app' +import type { AppProps } from 'next/app' import { theme } from '../components/theme' import { I18nProvider } from '../lib/i18n/I18nProvider' diff --git a/examples/magento-graphcms/pages/_document.tsx b/examples/magento-graphcms/pages/_document.tsx index 9ae7338e6b4..7f3de51be3f 100644 --- a/examples/magento-graphcms/pages/_document.tsx +++ b/examples/magento-graphcms/pages/_document.tsx @@ -1,10 +1,11 @@ -import { LinguiDocumentProps, withLingui } from '@graphcommerce/lingui-next/server' +import type { LinguiDocumentProps } from '@graphcommerce/lingui-next/server' +import { withLingui } from '@graphcommerce/lingui-next/server' +import type { EmotionCacheProps } from '@graphcommerce/next-ui/server' import { DocumentBodyEnd, DocumentBodyStart, DocumentHeadEnd, DocumentHeadStart, - EmotionCacheProps, getCssFlagsInitScript, normalizeLocale, withEmotionCache, diff --git a/examples/magento-graphcms/pages/account/addresses/add.tsx b/examples/magento-graphcms/pages/account/addresses/add.tsx index 03c8a4db82d..1d4fd70500b 100644 --- a/examples/magento-graphcms/pages/account/addresses/add.tsx +++ b/examples/magento-graphcms/pages/account/addresses/add.tsx @@ -1,15 +1,15 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' +import type { AccountDashboardAddressesQuery } from '@graphcommerce/magento-customer' import { CreateCustomerAddressForm, CustomerDocument, useCustomerQuery, WaitForCustomer, - AccountDashboardAddressesQuery, getCustomerAccountIsDisabled, } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, SectionContainer, iconAddresses, LayoutOverlayHeader, @@ -18,7 +18,8 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type Props = AccountDashboardAddressesQuery diff --git a/examples/magento-graphcms/pages/account/addresses/edit.tsx b/examples/magento-graphcms/pages/account/addresses/edit.tsx index f362cbdfd83..bc4f0c4a78d 100644 --- a/examples/magento-graphcms/pages/account/addresses/edit.tsx +++ b/examples/magento-graphcms/pages/account/addresses/edit.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { EditAddressForm, useCustomerQuery, @@ -8,8 +8,8 @@ import { } from '@graphcommerce/magento-customer' import { PageMeta, preloadAttributesForm, StoreConfigDocument } from '@graphcommerce/magento-store' import { magentoVersion } from '@graphcommerce/next-config/config' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, iconAddresses, IconHeader, SectionContainer, @@ -20,7 +20,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Box, Container } from '@mui/material' import { useRouter } from 'next/router' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/addresses/index.tsx b/examples/magento-graphcms/pages/account/addresses/index.tsx index 0920c59355c..38336f8d820 100644 --- a/examples/magento-graphcms/pages/account/addresses/index.tsx +++ b/examples/magento-graphcms/pages/account/addresses/index.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { AccountAddresses, useCustomerQuery, @@ -7,16 +7,13 @@ import { getCustomerAccountIsDisabled, } from '@graphcommerce/magento-customer' import { CountryRegionsDocument, PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' -import { - GetStaticProps, - iconAddresses, - LayoutOverlayHeader, - LayoutTitle, -} from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { iconAddresses, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type Props = Record diff --git a/examples/magento-graphcms/pages/account/authentication/index.tsx b/examples/magento-graphcms/pages/account/authentication/index.tsx index 8ae9abe4ac0..0b7247f88f7 100644 --- a/examples/magento-graphcms/pages/account/authentication/index.tsx +++ b/examples/magento-graphcms/pages/account/authentication/index.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { AccountMenuItem, ChangePasswordForm, @@ -6,8 +6,8 @@ import { getCustomerAccountIsDisabled, } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, SectionContainer, iconLock, LayoutOverlayHeader, @@ -17,7 +17,8 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' import { customerDeleteEnabled, magentoVersion } from '@graphcommerce/next-config/config' diff --git a/examples/magento-graphcms/pages/account/contact/index.tsx b/examples/magento-graphcms/pages/account/contact/index.tsx index b4b1b36973b..17abc5c1d17 100644 --- a/examples/magento-graphcms/pages/account/contact/index.tsx +++ b/examples/magento-graphcms/pages/account/contact/index.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { CustomerDocument, getCustomerAccountIsDisabled, @@ -7,8 +7,8 @@ import { WaitForCustomer, } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, iconEmailOutline, SectionContainer, LayoutOverlayHeader, @@ -17,7 +17,8 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/delete/index.tsx b/examples/magento-graphcms/pages/account/delete/index.tsx index e863bff6d1d..d1a16d1c8b5 100644 --- a/examples/magento-graphcms/pages/account/delete/index.tsx +++ b/examples/magento-graphcms/pages/account/delete/index.tsx @@ -1,12 +1,14 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { AccountDeleteForm, getCustomerAccountIsDisabled } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { customerDeleteEnabled, magentoVersion } from '@graphcommerce/next-config/config' -import { GetStaticProps, LayoutOverlayHeader, LayoutTitle, iconBin } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader, LayoutTitle, iconBin } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import { t } from '@lingui/core/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/forgot-password.tsx b/examples/magento-graphcms/pages/account/forgot-password.tsx index d307822a741..4a3c623ae5f 100644 --- a/examples/magento-graphcms/pages/account/forgot-password.tsx +++ b/examples/magento-graphcms/pages/account/forgot-password.tsx @@ -1,11 +1,13 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { ForgotPasswordForm, getCustomerAccountIsDisabled } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' -import { GetStaticProps, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container, Typography } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../components' +import type { LayoutOverlayProps } from '../../components' +import { LayoutOverlay } from '../../components' import { graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/index.tsx b/examples/magento-graphcms/pages/account/index.tsx index af44cfe25c1..0b31407a10b 100644 --- a/examples/magento-graphcms/pages/account/index.tsx +++ b/examples/magento-graphcms/pages/account/index.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' import { @@ -14,8 +14,8 @@ import { } from '@graphcommerce/magento-customer' import { CustomerNewsletterToggle } from '@graphcommerce/magento-newsletter' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, iconBox, iconEmailOutline, iconHome, @@ -27,13 +27,13 @@ import { iconStar, LayoutTitle, LayoutHeader, - iconBin, RelativeToTimeFormat, } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutDocument, LayoutMinimal, LayoutMinimalProps } from '../../components' +import type { LayoutMinimalProps } from '../../components' +import { LayoutDocument, LayoutMinimal } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/name/index.tsx b/examples/magento-graphcms/pages/account/name/index.tsx index fc1fbba7942..18dc8612074 100644 --- a/examples/magento-graphcms/pages/account/name/index.tsx +++ b/examples/magento-graphcms/pages/account/name/index.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { ChangeNameForm, CustomerDocument, @@ -8,17 +8,13 @@ import { WaitForCustomer, } from '@graphcommerce/magento-customer' import { PageMeta, preloadAttributesForm, StoreConfigDocument } from '@graphcommerce/magento-store' -import { - GetStaticProps, - iconId, - SectionContainer, - LayoutOverlayHeader, - LayoutTitle, -} from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { iconId, SectionContainer, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' import { magentoVersion } from '@graphcommerce/next-config/config' diff --git a/examples/magento-graphcms/pages/account/orders/index.tsx b/examples/magento-graphcms/pages/account/orders/index.tsx index 1522230cd06..460df4a54f8 100644 --- a/examples/magento-graphcms/pages/account/orders/index.tsx +++ b/examples/magento-graphcms/pages/account/orders/index.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { useCustomerQuery, WaitForCustomer, @@ -7,9 +7,9 @@ import { getCustomerAccountIsDisabled, } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { FullPageMessage, - GetStaticProps, iconBox, LayoutOverlayHeader, IconSvg, @@ -19,7 +19,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' import { useRouter } from 'next/router' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/orders/shipment.tsx b/examples/magento-graphcms/pages/account/orders/shipment.tsx index a9903ac906d..750f4268a55 100644 --- a/examples/magento-graphcms/pages/account/orders/shipment.tsx +++ b/examples/magento-graphcms/pages/account/orders/shipment.tsx @@ -1,7 +1,6 @@ import type { PageOptions } from '@graphcommerce/framer-next-pages' import { getCustomerAccountIsDisabled, - OrderDetails, SalesComments, ShipmentDetailPageDocument, ShipmentDetails, diff --git a/examples/magento-graphcms/pages/account/orders/view.tsx b/examples/magento-graphcms/pages/account/orders/view.tsx index 4c45f920d20..9c0a768e9b5 100644 --- a/examples/magento-graphcms/pages/account/orders/view.tsx +++ b/examples/magento-graphcms/pages/account/orders/view.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { useCustomerQuery, WaitForCustomer, @@ -12,8 +12,8 @@ import { OrderAdditional, } from '@graphcommerce/magento-customer' import { CountryRegionsDocument, PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, iconBox, LayoutOverlayHeader, LayoutTitle, @@ -24,7 +24,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container, Typography } from '@mui/material' import { useRouter } from 'next/router' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/reviews/add.tsx b/examples/magento-graphcms/pages/account/reviews/add.tsx index 22aae6bb550..f3063e3de65 100644 --- a/examples/magento-graphcms/pages/account/reviews/add.tsx +++ b/examples/magento-graphcms/pages/account/reviews/add.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { useQuery } from '@graphcommerce/graphql' import { ApolloCustomerErrorFullPage, @@ -10,19 +10,20 @@ import { CreateProductReviewForm, } from '@graphcommerce/magento-review' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { FullPageMessage, iconBox, LayoutOverlayHeader, LayoutTitle, IconSvg, - GetStaticProps, } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' import { useRouter } from 'next/router' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/reviews/index.tsx b/examples/magento-graphcms/pages/account/reviews/index.tsx index e8fc754daf4..d5bc3e1993f 100644 --- a/examples/magento-graphcms/pages/account/reviews/index.tsx +++ b/examples/magento-graphcms/pages/account/reviews/index.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { getCustomerAccountIsDisabled, useCustomerQuery, @@ -6,18 +6,19 @@ import { } from '@graphcommerce/magento-customer' import { AccountDashboardReviewsDocument, AccountReviews } from '@graphcommerce/magento-review' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { FullPageMessage, iconStar, LayoutOverlayHeader, LayoutTitle, IconSvg, - GetStaticProps, } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/account/signin.tsx b/examples/magento-graphcms/pages/account/signin.tsx index 69a60a5c9a9..211bcc2dd0f 100644 --- a/examples/magento-graphcms/pages/account/signin.tsx +++ b/examples/magento-graphcms/pages/account/signin.tsx @@ -1,12 +1,14 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { AccountSignInUpForm, getCustomerAccountIsDisabled } from '@graphcommerce/magento-customer' import { PageMeta, preloadAttributesForm, StoreConfigDocument } from '@graphcommerce/magento-store' import { useMergeGuestWishlistWithCustomer } from '@graphcommerce/magento-wishlist' -import { GetStaticProps, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../components' +import type { LayoutOverlayProps } from '../../components' +import { LayoutOverlay } from '../../components' import { graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' import { magentoVersion } from '@graphcommerce/next-config/config' diff --git a/examples/magento-graphcms/pages/blog/[...url].tsx b/examples/magento-graphcms/pages/blog/[...url].tsx index 527c616d76e..bffce778efe 100644 --- a/examples/magento-graphcms/pages/blog/[...url].tsx +++ b/examples/magento-graphcms/pages/blog/[...url].tsx @@ -1,12 +1,13 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' import { redirectOrNotFound, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { PageMeta, BlogTitle, - GetStaticProps, Row, LayoutTitle, LayoutHeader, @@ -14,18 +15,17 @@ import { } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Container } from '@mui/material' -import { GetStaticPaths } from 'next' +import type { GetStaticPaths } from 'next' +import type { BlogListQuery, LayoutNavigationProps } from '../../components' import { BlogAuthor, BlogHeader, BlogList, BlogListDocument, - BlogListQuery, BlogPostPathsDocument, BlogTags, LayoutDocument, LayoutNavigation, - LayoutNavigationProps, RowRenderer, } from '../../components' import { graphqlSharedClient, graphqlSsrClient } from '../../lib/graphql/graphqlSsrClient' diff --git a/examples/magento-graphcms/pages/blog/page/[page].tsx b/examples/magento-graphcms/pages/blog/page/[page].tsx index cd0fa372b53..37a47ddc88f 100644 --- a/examples/magento-graphcms/pages/blog/page/[page].tsx +++ b/examples/magento-graphcms/pages/blog/page/[page].tsx @@ -1,30 +1,29 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' import { StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { Container, PageMeta, - GetStaticProps, Pagination, LayoutTitle, LayoutHeader, Breadcrumbs, } from '@graphcommerce/next-ui' import { Link } from '@mui/material' -import { GetStaticPaths } from 'next' +import type { GetStaticPaths } from 'next' import { useRouter } from 'next/router' -import React from 'react' +import type React from 'react' +import type { BlogListQuery, BlogPathsQuery, LayoutNavigationProps } from '../../../components' import { BlogList, BlogListDocument, - BlogListQuery, BlogPathsDocument, - BlogPathsQuery, LayoutDocument, LayoutNavigation, - LayoutNavigationProps, RowRenderer, } from '../../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' diff --git a/examples/magento-graphcms/pages/blog/tagged/[url].tsx b/examples/magento-graphcms/pages/blog/tagged/[url].tsx index 5a4434bc623..31f2ccd6737 100644 --- a/examples/magento-graphcms/pages/blog/tagged/[url].tsx +++ b/examples/magento-graphcms/pages/blog/tagged/[url].tsx @@ -1,24 +1,25 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' import { redirectOrNotFound, StoreConfigDocument } from '@graphcommerce/magento-store' -import { PageMeta, GetStaticProps, Row, LayoutTitle, LayoutHeader } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { PageMeta, Row, LayoutTitle, LayoutHeader } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' -import { GetStaticPaths } from 'next' +import type { GetStaticPaths } from 'next' +import type { BlogListTaggedQuery, LayoutNavigationProps } from '../../../components' import { BlogAuthor, BlogHeader, BlogList, BlogPostTaggedPathsDocument, BlogListTaggedDocument, - BlogListTaggedQuery, BlogTags, BlogTitle, LayoutDocument, LayoutNavigation, - LayoutNavigationProps, RowRenderer, } from '../../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' diff --git a/examples/magento-graphcms/pages/c/[...url].tsx b/examples/magento-graphcms/pages/c/[...url].tsx index 7f5bb05b398..242f30a0862 100644 --- a/examples/magento-graphcms/pages/c/[...url].tsx +++ b/examples/magento-graphcms/pages/c/[...url].tsx @@ -1,7 +1,8 @@ import { flushMeasurePerf } from '@graphcommerce/graphql' -import { GetServerSideProps } from '@graphcommerce/next-ui' -import { LayoutNavigationProps } from '../../components' -import CategoryPage, { getStaticProps, CategoryProps, CategoryRoute } from '../[...url]' +import type { GetServerSideProps } from '@graphcommerce/next-ui' +import type { LayoutNavigationProps } from '../../components' +import type { CategoryProps, CategoryRoute } from '../[...url]' +import CategoryPage, { getStaticProps } from '../[...url]' export default CategoryPage diff --git a/examples/magento-graphcms/pages/cart.tsx b/examples/magento-graphcms/pages/cart.tsx index be519a383fe..8f36f06b7a4 100644 --- a/examples/magento-graphcms/pages/cart.tsx +++ b/examples/magento-graphcms/pages/cart.tsx @@ -1,5 +1,5 @@ import { WaitForQueries } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { ApolloCartErrorAlert, CartStartCheckout, @@ -13,8 +13,8 @@ import { CartPageDocument } from '@graphcommerce/magento-cart-checkout' import { CouponAccordion } from '@graphcommerce/magento-cart-coupon' import { CartItemsActionCards, CartCrosssellsScroller } from '@graphcommerce/magento-cart-items' import { Money, PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, iconShoppingBag, Stepper, LayoutTitle, @@ -25,7 +25,8 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { CircularProgress, Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps, productListRenderer } from '../components' +import type { LayoutOverlayProps } from '../components' +import { LayoutOverlay, productListRenderer } from '../components' import { graphqlSharedClient } from '../lib/graphql/graphqlSsrClient' type Props = Record diff --git a/examples/magento-graphcms/pages/checkout/added.tsx b/examples/magento-graphcms/pages/checkout/added.tsx index c32b1c6ae24..3f5cf1ff382 100644 --- a/examples/magento-graphcms/pages/checkout/added.tsx +++ b/examples/magento-graphcms/pages/checkout/added.tsx @@ -1,12 +1,12 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { Image } from '@graphcommerce/image' import { getCartDisabled, useCrosssellItems } from '@graphcommerce/magento-cart' import { AddProductsToCartForm, ProductScroller } from '@graphcommerce/magento-product' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { crossSellsRedirectItems } from '@graphcommerce/next-config/config' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { Button, - GetStaticProps, iconChevronRight, iconShoppingBag, IconSvg, @@ -17,7 +17,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Box, Container, Divider, Typography } from '@mui/material' import { useEffect, useRef } from 'react' -import { LayoutOverlay, LayoutOverlayProps, productListRenderer } from '../../components' +import type { LayoutOverlayProps } from '../../components' +import { LayoutOverlay, productListRenderer } from '../../components' import { graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type Props = Record diff --git a/examples/magento-graphcms/pages/checkout/customer/addresses/edit.tsx b/examples/magento-graphcms/pages/checkout/customer/addresses/edit.tsx index 2354be8bb62..ccc97c7aa4f 100644 --- a/examples/magento-graphcms/pages/checkout/customer/addresses/edit.tsx +++ b/examples/magento-graphcms/pages/checkout/customer/addresses/edit.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { getCartDisabled } from '@graphcommerce/magento-cart' import { ApolloCustomerErrorFullPage, @@ -9,8 +9,8 @@ import { } from '@graphcommerce/magento-customer' import { PageMeta, preloadAttributesForm, StoreConfigDocument } from '@graphcommerce/magento-store' import { magentoVersion } from '@graphcommerce/next-config/config' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, iconAddresses, IconHeader, SectionContainer, @@ -22,7 +22,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Box, CircularProgress, Container, Skeleton } from '@mui/material' import { useRouter } from 'next/router' -import { LayoutOverlay, LayoutOverlayProps } from '../../../../components' +import type { LayoutOverlayProps } from '../../../../components' +import { LayoutOverlay } from '../../../../components' import { graphqlSharedClient } from '../../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/checkout/edit/billing-address.tsx b/examples/magento-graphcms/pages/checkout/edit/billing-address.tsx index 95642cd5e2c..686a347a548 100644 --- a/examples/magento-graphcms/pages/checkout/edit/billing-address.tsx +++ b/examples/magento-graphcms/pages/checkout/edit/billing-address.tsx @@ -1,13 +1,15 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { getCheckoutIsDisabled, EditBillingAddressForm } from '@graphcommerce/magento-cart' import { preloadAttributesForm, StoreConfigDocument } from '@graphcommerce/magento-store' import { magentoVersion } from '@graphcommerce/next-config/config' -import { GetStaticProps, PageMeta, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { PageMeta, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutDocument, LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutDocument, LayoutOverlay } from '../../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' import { getBillingAddressPermission } from '@graphcommerce/magento-customer' diff --git a/examples/magento-graphcms/pages/checkout/index.tsx b/examples/magento-graphcms/pages/checkout/index.tsx index 03fe1bdbdf7..6591eec571b 100644 --- a/examples/magento-graphcms/pages/checkout/index.tsx +++ b/examples/magento-graphcms/pages/checkout/index.tsx @@ -5,7 +5,7 @@ import { ComposedSubmit, WaitForQueries, } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { ApolloCartErrorFullPage, @@ -24,9 +24,9 @@ import { ShippingMethodForm } from '@graphcommerce/magento-cart-shipping-method' import { CustomerDocument, useCustomerQuery } from '@graphcommerce/magento-customer' import { PageMeta, preloadAttributesForm, StoreConfigDocument } from '@graphcommerce/magento-store' import { magentoVersion } from '@graphcommerce/next-config/config' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { FormActions, - GetStaticProps, iconBox, LayoutHeader, Stepper, @@ -38,7 +38,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { CircularProgress, Container, Typography } from '@mui/material' import { useRouter } from 'next/router' -import { LayoutDocument, LayoutMinimal, LayoutMinimalProps } from '../../components' +import type { LayoutMinimalProps } from '../../components' +import { LayoutDocument, LayoutMinimal } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type Props = Record diff --git a/examples/magento-graphcms/pages/checkout/item/[url].tsx b/examples/magento-graphcms/pages/checkout/item/[url].tsx index 9d87e1b7fea..7afe60ec1cd 100644 --- a/examples/magento-graphcms/pages/checkout/item/[url].tsx +++ b/examples/magento-graphcms/pages/checkout/item/[url].tsx @@ -1,5 +1,5 @@ import { WaitForQueries } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { flushMeasurePerf } from '@graphcommerce/graphql' import { ApolloCartErrorAlert, @@ -14,13 +14,12 @@ import { useEditItem, } from '@graphcommerce/magento-cart-items' import { ProductPageGallery, ProductPageName } from '@graphcommerce/magento-product' +import type { GetServerSideProps, LayoutOverlayProps } from '@graphcommerce/next-ui' import { Container, FullPageMessage, - GetServerSideProps, LayoutOverlay, LayoutOverlayHeader, - LayoutOverlayProps, LayoutTitle, OverlayStickyBottom, PageMeta, @@ -29,8 +28,10 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { CircularProgress, Typography } from '@mui/material' -import { LayoutNavigationProps, AddProductsToCartView } from '../../../components' -import { Props, getStaticProps } from '../../p/[url]' +import type { LayoutNavigationProps } from '../../../components' +import { AddProductsToCartView } from '../../../components' +import type { Props } from '../../p/[url]' +import { getStaticProps } from '../../p/[url]' type RouteProps = { url: string } type GetSSP = GetServerSideProps diff --git a/examples/magento-graphcms/pages/checkout/payment.tsx b/examples/magento-graphcms/pages/checkout/payment.tsx index ca1347d3c62..b5f7b59d2d7 100644 --- a/examples/magento-graphcms/pages/checkout/payment.tsx +++ b/examples/magento-graphcms/pages/checkout/payment.tsx @@ -1,5 +1,5 @@ import { ComposedForm, WaitForQueries } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { ApolloCartErrorFullPage, @@ -21,10 +21,10 @@ import { } from '@graphcommerce/magento-cart-payment-method' import { SubscribeToNewsletter } from '@graphcommerce/magento-newsletter' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { FormActions, FullPageMessage, - GetStaticProps, iconChevronRight, iconId, LayoutHeader, @@ -35,7 +35,8 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { CircularProgress, Container, Dialog, Typography } from '@mui/material' -import { LayoutDocument, LayoutMinimal, LayoutMinimalProps } from '../../components' +import type { LayoutMinimalProps } from '../../components' +import { LayoutDocument, LayoutMinimal } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/checkout/success.tsx b/examples/magento-graphcms/pages/checkout/success.tsx index bf47e65872f..315c5bcf4fe 100644 --- a/examples/magento-graphcms/pages/checkout/success.tsx +++ b/examples/magento-graphcms/pages/checkout/success.tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { CartItemSummary, @@ -8,9 +8,9 @@ import { } from '@graphcommerce/magento-cart' import { SignupNewsletter } from '@graphcommerce/magento-newsletter' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { FullPageMessage, - GetStaticProps, iconParty, iconSadFace, LayoutHeader, @@ -21,12 +21,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Button, Box, Container, Typography, CircularProgress } from '@mui/material' import { useRouter } from 'next/router' -import { - LayoutDocument, - LayoutMinimal, - LayoutNavigationProps, - LayoutMinimalProps, -} from '../../components' +import type { LayoutNavigationProps, LayoutMinimalProps } from '../../components' +import { LayoutDocument, LayoutMinimal } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' import { WaitForQueries } from '@graphcommerce/ecommerce-ui' diff --git a/examples/magento-graphcms/pages/checkout/terms/[url].tsx b/examples/magento-graphcms/pages/checkout/terms/[url].tsx index 21ccfff26ec..47f67c3e705 100644 --- a/examples/magento-graphcms/pages/checkout/terms/[url].tsx +++ b/examples/magento-graphcms/pages/checkout/terms/[url].tsx @@ -1,14 +1,13 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' -import { - CartAgreementsDocument, - CartAgreementsQuery, - getCheckoutIsDisabled, -} from '@graphcommerce/magento-cart' +import type { PageOptions } from '@graphcommerce/framer-next-pages' +import type { CartAgreementsQuery } from '@graphcommerce/magento-cart' +import { CartAgreementsDocument, getCheckoutIsDisabled } from '@graphcommerce/magento-cart' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { GetStaticProps, PageMeta, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { PageMeta, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { Container, Typography } from '@mui/material' -import { GetStaticPaths } from 'next' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { GetStaticPaths } from 'next' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' import { revalidate } from '@graphcommerce/next-ui' diff --git a/examples/magento-graphcms/pages/compare.tsx b/examples/magento-graphcms/pages/compare.tsx index 442d10faf4f..e839265c988 100644 --- a/examples/magento-graphcms/pages/compare.tsx +++ b/examples/magento-graphcms/pages/compare.tsx @@ -1,5 +1,5 @@ import { WaitForQueries } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { useCompareList, EmptyCompareListButton, @@ -11,10 +11,9 @@ import { CompareListIntroText, } from '@graphcommerce/magento-compare' import { StoreConfigDocument } from '@graphcommerce/magento-store' +import type { GetStaticProps, LayoutOverlayProps } from '@graphcommerce/next-ui' import { - GetStaticProps, LayoutOverlay, - LayoutOverlayProps, iconCompare, FullPageMessage, LayoutOverlayHeader, diff --git a/examples/magento-graphcms/pages/customer/account/confirm.tsx b/examples/magento-graphcms/pages/customer/account/confirm.tsx index 50df6ee5f3e..8b6d19c9d73 100644 --- a/examples/magento-graphcms/pages/customer/account/confirm.tsx +++ b/examples/magento-graphcms/pages/customer/account/confirm.tsx @@ -1,11 +1,13 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { ConfirmCustomerForm, getCustomerAccountIsDisabled } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' -import { GetStaticProps, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../../components' +import type { LayoutOverlayProps } from '../../../components' +import { LayoutOverlay } from '../../../components' import { graphqlSharedClient } from '../../../lib/graphql/graphqlSsrClient' import { revalidate } from '@graphcommerce/next-ui' diff --git a/examples/magento-graphcms/pages/customer/account/createPassword/index.tsx b/examples/magento-graphcms/pages/customer/account/createPassword/index.tsx index 3674c463571..7759e5c0297 100644 --- a/examples/magento-graphcms/pages/customer/account/createPassword/index.tsx +++ b/examples/magento-graphcms/pages/customer/account/createPassword/index.tsx @@ -1,12 +1,14 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { ResetPasswordForm, getCustomerAccountIsDisabled } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' -import { GetStaticProps, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Box, Container, Link, Button } from '@mui/material' import { useRouter } from 'next/router' -import { LayoutOverlay, LayoutOverlayProps } from '../../../../components' +import type { LayoutOverlayProps } from '../../../../components' +import { LayoutOverlay } from '../../../../components' import { graphqlSharedClient } from '../../../../lib/graphql/graphqlSsrClient' type GetPageStaticProps = GetStaticProps diff --git a/examples/magento-graphcms/pages/guest/orderstatus.tsx b/examples/magento-graphcms/pages/guest/orderstatus.tsx index 5ec20c81eca..8825b394be8 100644 --- a/examples/magento-graphcms/pages/guest/orderstatus.tsx +++ b/examples/magento-graphcms/pages/guest/orderstatus.tsx @@ -1,14 +1,8 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { GuestOrderOverviewForm, useCustomerSession } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' -import { - GetStaticProps, - iconBox, - LayoutOverlayHeader, - LayoutTitle, - LayoutOverlayProps, - LayoutOverlay, -} from '@graphcommerce/next-ui' +import type { GetStaticProps, LayoutOverlayProps } from '@graphcommerce/next-ui' +import { iconBox, LayoutOverlayHeader, LayoutTitle, LayoutOverlay } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import { t } from '@lingui/core/macro' import { Alert, Button, Container } from '@mui/material' diff --git a/examples/magento-graphcms/pages/index.tsx b/examples/magento-graphcms/pages/index.tsx index 0140d2d6516..f7a7b14cd5c 100644 --- a/examples/magento-graphcms/pages/index.tsx +++ b/examples/magento-graphcms/pages/index.tsx @@ -1,17 +1,15 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' -import { ProductListDocument, ProductListQuery } from '@graphcommerce/magento-product' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' +import type { ProductListQuery } from '@graphcommerce/magento-product' +import { ProductListDocument } from '@graphcommerce/magento-product' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { GetStaticProps, LayoutHeader, MetaRobots, PageMeta } from '@graphcommerce/next-ui' -import { - LayoutDocument, - LayoutNavigation, - LayoutNavigationProps, - RowProduct, - RowRenderer, -} from '../components' +import type { GetStaticProps, MetaRobots } from '@graphcommerce/next-ui' +import { LayoutHeader, PageMeta } from '@graphcommerce/next-ui' +import type { LayoutNavigationProps } from '../components' +import { LayoutDocument, LayoutNavigation, RowProduct, RowRenderer } from '../components' import { graphqlSharedClient, graphqlSsrClient } from '../lib/graphql/graphqlSsrClient' type Props = HygraphPagesQuery & { diff --git a/examples/magento-graphcms/pages/modal/[...url].tsx b/examples/magento-graphcms/pages/modal/[...url].tsx index 67f6d873950..e2ea04d4106 100644 --- a/examples/magento-graphcms/pages/modal/[...url].tsx +++ b/examples/magento-graphcms/pages/modal/[...url].tsx @@ -1,18 +1,15 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { - GetStaticProps, - MetaRobots, - LayoutOverlayHeader, - LayoutTitle, - PageMeta, -} from '@graphcommerce/next-ui' +import type { GetStaticProps, MetaRobots } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader, LayoutTitle, PageMeta } from '@graphcommerce/next-ui' import { Box, Typography } from '@mui/material' -import { GetStaticPaths } from 'next' -import { LayoutDocument, LayoutOverlay, LayoutOverlayProps, RowRenderer } from '../../components' +import type { GetStaticPaths } from 'next' +import type { LayoutOverlayProps } from '../../components' +import { LayoutDocument, LayoutOverlay, RowRenderer } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type Props = HygraphPagesQuery diff --git a/examples/magento-graphcms/pages/p/[url].tsx b/examples/magento-graphcms/pages/p/[url].tsx index 8b61396982c..d407298fad8 100644 --- a/examples/magento-graphcms/pages/p/[url].tsx +++ b/examples/magento-graphcms/pages/p/[url].tsx @@ -1,4 +1,4 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst, PrivateQueryMaskProvider, @@ -7,10 +7,11 @@ import { flushMeasurePerf, } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' +import type { AddProductsToCartFormProps } from '@graphcommerce/magento-product' import { AddProductsToCartForm, - AddProductsToCartFormProps, getProductStaticPaths, jsonLdProduct, jsonLdProductOffer, @@ -29,25 +30,28 @@ import { import { defaultConfigurableOptionsSelection } from '@graphcommerce/magento-product-configurable' import { RecentlyViewedProducts } from '@graphcommerce/magento-recently-viewed-products' import { jsonLdProductReview, ProductReviewChip } from '@graphcommerce/magento-review' -import { redirectOrNotFound, Money, StoreConfigDocument } from '@graphcommerce/magento-store' +import { redirectOrNotFound, StoreConfigDocument } from '@graphcommerce/magento-store' import { ProductWishlistChipDetail } from '@graphcommerce/magento-wishlist' -import { GetStaticProps, LayoutHeader, LayoutTitle, isTypename } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { LayoutHeader, LayoutTitle, isTypename } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Typography } from '@mui/material' -import { GetStaticPaths } from 'next' +import type { GetStaticPaths } from 'next' +import type { LayoutNavigationProps } from '../../components' import { LayoutDocument, LayoutNavigation, - LayoutNavigationProps, productListRenderer, RowProduct, RowRenderer, Usps, } from '../../components' import { AddProductsToCartView } from '../../components/ProductView/AddProductsToCartView' -import { UspsDocument, UspsQuery } from '../../components/Usps/Usps.gql' -import { ProductPage2Document, ProductPage2Query } from '../../graphql/ProductPage2.gql' +import type { UspsQuery } from '../../components/Usps/Usps.gql' +import { UspsDocument } from '../../components/Usps/Usps.gql' +import type { ProductPage2Query } from '../../graphql/ProductPage2.gql' +import { ProductPage2Document } from '../../graphql/ProductPage2.gql' import { graphqlSharedClient, graphqlSsrClient } from '../../lib/graphql/graphqlSsrClient' import { Container } from '@graphcommerce/next-ui' import { breadcrumbs, magentoVersion } from '@graphcommerce/next-config/config' diff --git a/examples/magento-graphcms/pages/robots.txt.tsx b/examples/magento-graphcms/pages/robots.txt.tsx index e4302353cdb..f28a53bccad 100644 --- a/examples/magento-graphcms/pages/robots.txt.tsx +++ b/examples/magento-graphcms/pages/robots.txt.tsx @@ -6,7 +6,7 @@ import { storefrontAll, storefrontConfig, } from '@graphcommerce/next-ui' -import { GetServerSideProps } from 'next' +import type { GetServerSideProps } from 'next' const sitemapRoutes = ['/sitemap/content.xml', '/sitemap/categories.xml', '/sitemap/products.xml'] diff --git a/examples/magento-graphcms/pages/search/[[...url]].tsx b/examples/magento-graphcms/pages/search/[[...url]].tsx index d1c66984587..99058741fb3 100644 --- a/examples/magento-graphcms/pages/search/[[...url]].tsx +++ b/examples/magento-graphcms/pages/search/[[...url]].tsx @@ -1,16 +1,18 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { PrivateQueryMaskProvider, cacheFirst, flushMeasurePerf } from '@graphcommerce/graphql' -import { MenuQueryFragment } from '@graphcommerce/magento-category' +import type { MenuQueryFragment } from '@graphcommerce/magento-category' +import type { + FilterTypes, + ProductListParams, + ProductListQuery, + ProductFiltersQuery, +} from '@graphcommerce/magento-product' import { ProductListDocument, extractUrlQuery, parseParams, - FilterTypes, - ProductListParams, getFilterTypes, ProductFiltersDocument, - ProductListQuery, - ProductFiltersQuery, hasUserFilterActive, } from '@graphcommerce/magento-product' import { @@ -20,15 +22,16 @@ import { useProductList, } from '@graphcommerce/magento-search' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' -import { GetStaticProps, LayoutHeader } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { LayoutHeader } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' +import type { LayoutNavigationProps } from '../../components' import { ProductListLayoutClassic, ProductListLayoutDefault, ProductListLayoutSidebar, LayoutDocument, LayoutNavigation, - LayoutNavigationProps, } from '../../components' import { graphqlSharedClient, graphqlSsrClient } from '../../lib/graphql/graphqlSsrClient' import { productFiltersPro, productFiltersLayout } from '@graphcommerce/next-config/config' diff --git a/examples/magento-graphcms/pages/service/[[...url]].tsx b/examples/magento-graphcms/pages/service/[[...url]].tsx index a9706046746..5534b680540 100644 --- a/examples/magento-graphcms/pages/service/[[...url]].tsx +++ b/examples/magento-graphcms/pages/service/[[...url]].tsx @@ -1,28 +1,15 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' -import { - PagesStaticPathsDocument, - hygraphPageContent, - HygraphPagesQuery, -} from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { PagesStaticPathsDocument, hygraphPageContent } from '@graphcommerce/hygraph-ui' import { StoreConfigDocument, redirectOrNotFound } from '@graphcommerce/magento-store' -import { - PageMeta, - GetStaticProps, - LayoutOverlayHeader, - LayoutTitle, - revalidate, -} from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { PageMeta, LayoutOverlayHeader, LayoutTitle, revalidate } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Container } from '@mui/material' -import { GetStaticPaths } from 'next' -import { - LayoutDocument, - LayoutOverlay, - LayoutOverlayProps, - LayoutNavigationProps, - RowRenderer, -} from '../../components' +import type { GetStaticPaths } from 'next' +import type { LayoutOverlayProps, LayoutNavigationProps } from '../../components' +import { LayoutDocument, LayoutOverlay, RowRenderer } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' import { limitSsg } from '@graphcommerce/next-config/config' diff --git a/examples/magento-graphcms/pages/service/contact-us.tsx b/examples/magento-graphcms/pages/service/contact-us.tsx index 17444fa2a7e..2a5fa7e337c 100644 --- a/examples/magento-graphcms/pages/service/contact-us.tsx +++ b/examples/magento-graphcms/pages/service/contact-us.tsx @@ -1,19 +1,16 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' import { ContactForm } from '@graphcommerce/magento-customer' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { PageMeta, GetStaticProps, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { PageMeta, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Container, Typography } from '@mui/material' -import { - LayoutDocument, - LayoutOverlay, - LayoutOverlayProps, - LayoutNavigationProps, - RowRenderer, -} from '../../components' +import type { LayoutOverlayProps, LayoutNavigationProps } from '../../components' +import { LayoutDocument, LayoutOverlay, RowRenderer } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' import { magentoVersion } from '@graphcommerce/next-config/config' diff --git a/examples/magento-graphcms/pages/service/newsletter.tsx b/examples/magento-graphcms/pages/service/newsletter.tsx index 22903fa5f99..a476b50bee8 100644 --- a/examples/magento-graphcms/pages/service/newsletter.tsx +++ b/examples/magento-graphcms/pages/service/newsletter.tsx @@ -1,20 +1,17 @@ -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { revalidate } from '@graphcommerce/next-ui' -import { hygraphPageContent, HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' +import { hygraphPageContent } from '@graphcommerce/hygraph-ui' import { GuestNewsletter } from '@graphcommerce/magento-newsletter' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { PageMeta, GetStaticProps, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import type { GetStaticProps } from '@graphcommerce/next-ui' +import { PageMeta, LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import { t } from '@lingui/core/macro' import { Container, Typography } from '@mui/material' -import { - LayoutDocument, - LayoutOverlay, - LayoutOverlayProps, - LayoutNavigationProps, - RowRenderer, -} from '../../components' +import type { LayoutOverlayProps, LayoutNavigationProps } from '../../components' +import { LayoutDocument, LayoutOverlay, RowRenderer } from '../../components' import { graphqlSsrClient, graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type Props = HygraphPagesQuery diff --git a/examples/magento-graphcms/pages/sitemap/categories.xml.tsx b/examples/magento-graphcms/pages/sitemap/categories.xml.tsx index 1504583e30d..141bb9fc378 100644 --- a/examples/magento-graphcms/pages/sitemap/categories.xml.tsx +++ b/examples/magento-graphcms/pages/sitemap/categories.xml.tsx @@ -5,7 +5,7 @@ import { getServerSidePropsSitemap, toSitemapFields, } from '@graphcommerce/next-ui' -import { GetServerSideProps } from 'next' +import type { GetServerSideProps } from 'next' import { graphqlSsrClient } from '../../lib/graphql/graphqlSsrClient' import { productListLink } from '@graphcommerce/magento-product' diff --git a/examples/magento-graphcms/pages/sitemap/content.xml.tsx b/examples/magento-graphcms/pages/sitemap/content.xml.tsx index b0969d6b55b..cd849c059db 100644 --- a/examples/magento-graphcms/pages/sitemap/content.xml.tsx +++ b/examples/magento-graphcms/pages/sitemap/content.xml.tsx @@ -6,7 +6,7 @@ import { getServerSidePropsSitemap, toSitemapFields, } from '@graphcommerce/next-ui' -import { GetServerSideProps } from 'next' +import type { GetServerSideProps } from 'next' import { graphqlSsrClient } from '../../lib/graphql/graphqlSsrClient' const excludes = [ diff --git a/examples/magento-graphcms/pages/sitemap/products.xml.tsx b/examples/magento-graphcms/pages/sitemap/products.xml.tsx index 25922ed4ef6..77b87bcf2e2 100644 --- a/examples/magento-graphcms/pages/sitemap/products.xml.tsx +++ b/examples/magento-graphcms/pages/sitemap/products.xml.tsx @@ -4,7 +4,7 @@ import { getServerSidePropsSitemap, toSitemapFields, } from '@graphcommerce/next-ui' -import { GetServerSideProps } from 'next' +import type { GetServerSideProps } from 'next' import { graphqlSsrClient } from '../../lib/graphql/graphqlSsrClient' import { getProductStaticPaths, productPath } from '@graphcommerce/magento-product' diff --git a/examples/magento-graphcms/pages/switch-stores.tsx b/examples/magento-graphcms/pages/switch-stores.tsx index 8467ccaadb5..8f2b945bc78 100644 --- a/examples/magento-graphcms/pages/switch-stores.tsx +++ b/examples/magento-graphcms/pages/switch-stores.tsx @@ -1,4 +1,6 @@ -import { PageOptions, usePrevPageRouter } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' +import { usePrevPageRouter } from '@graphcommerce/framer-next-pages' +import type { StoreSwitcherListQuery } from '@graphcommerce/magento-store' import { PageMeta, StoreConfigDocument, @@ -8,13 +10,12 @@ import { StoreSwitcherGroupSelector, StoreSwitcherLinkOrButton, StoreSwitcherListDocument, - StoreSwitcherListQuery, StoreSwitcherStoreSelector, storeToLocale, } from '@graphcommerce/magento-store' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { FormActions, - GetStaticProps, iconLanguage, LayoutOverlayHeader, LayoutTitle, @@ -23,7 +24,8 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' -import { LayoutDocument, LayoutOverlay, LayoutOverlayProps } from '../components' +import type { LayoutOverlayProps } from '../components' +import { LayoutDocument, LayoutOverlay } from '../components' import { graphqlSsrClient, graphqlSharedClient } from '../lib/graphql/graphqlSsrClient' import { useRouter } from 'next/router' import type { ParsedUrlQuery } from 'querystring' diff --git a/examples/magento-graphcms/pages/wishlist/index.tsx b/examples/magento-graphcms/pages/wishlist/index.tsx index 8cbf6848627..bbb186a27c1 100644 --- a/examples/magento-graphcms/pages/wishlist/index.tsx +++ b/examples/magento-graphcms/pages/wishlist/index.tsx @@ -1,9 +1,9 @@ import { WaitForQueries } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { useWishlistItems, WishlistItemActionCard } from '@graphcommerce/magento-wishlist' +import type { GetStaticProps } from '@graphcommerce/next-ui' import { - GetStaticProps, iconHeart, FullPageMessage, Button, @@ -14,7 +14,8 @@ import { import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { CircularProgress, Container } from '@mui/material' -import { LayoutOverlay, LayoutOverlayProps } from '../../components' +import type { LayoutOverlayProps } from '../../components' +import { LayoutOverlay } from '../../components' import { graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' type Props = Record diff --git a/examples/magento-graphcms/plugins/EnableCrosssellsPlugin.tsx b/examples/magento-graphcms/plugins/EnableCrosssellsPlugin.tsx index 0bf14e120f4..613b9182a66 100644 --- a/examples/magento-graphcms/plugins/EnableCrosssellsPlugin.tsx +++ b/examples/magento-graphcms/plugins/EnableCrosssellsPlugin.tsx @@ -1,5 +1,5 @@ -import { AddProductsToCartFormProps } from '@graphcommerce/magento-product' -import { PluginConfig, PluginProps } from '@graphcommerce/next-config' +import type { AddProductsToCartFormProps } from '@graphcommerce/magento-product' +import type { PluginConfig, PluginProps } from '@graphcommerce/next-config' export const config: PluginConfig = { type: 'component', diff --git a/examples/magento-open-source/components/ProductView/Reviews.tsx b/examples/magento-open-source/components/ProductView/Reviews.tsx index dda54186a8b..fc3bf13904d 100644 --- a/examples/magento-open-source/components/ProductView/Reviews.tsx +++ b/examples/magento-open-source/components/ProductView/Reviews.tsx @@ -2,7 +2,7 @@ import { useQuery } from '@graphcommerce/graphql' import type { ProductReviewsProps } from '@graphcommerce/magento-review' import { ProductReviews } from '@graphcommerce/magento-review' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { Row, sxx } from '@graphcommerce/next-ui' +import { Row } from '@graphcommerce/next-ui' import { Box, Typography } from '@mui/material' type ReviewsProps = ProductReviewsProps & { title: React.ReactNode } diff --git a/examples/magento-open-source/pages/account/index.tsx b/examples/magento-open-source/pages/account/index.tsx index af90e713b99..f8e9a3a9afb 100644 --- a/examples/magento-open-source/pages/account/index.tsx +++ b/examples/magento-open-source/pages/account/index.tsx @@ -14,7 +14,6 @@ import { import { CustomerNewsletterToggle } from '@graphcommerce/magento-newsletter' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { - iconBin, iconBox, iconEmailOutline, iconHome, diff --git a/examples/magento-open-source/pages/account/orders/shipment.tsx b/examples/magento-open-source/pages/account/orders/shipment.tsx index a9903ac906d..750f4268a55 100644 --- a/examples/magento-open-source/pages/account/orders/shipment.tsx +++ b/examples/magento-open-source/pages/account/orders/shipment.tsx @@ -1,7 +1,6 @@ import type { PageOptions } from '@graphcommerce/framer-next-pages' import { getCustomerAccountIsDisabled, - OrderDetails, SalesComments, ShipmentDetailPageDocument, ShipmentDetails, diff --git a/examples/magento-open-source/pages/account/signin.tsx b/examples/magento-open-source/pages/account/signin.tsx index 635533844bb..b2ff78c7851 100644 --- a/examples/magento-open-source/pages/account/signin.tsx +++ b/examples/magento-open-source/pages/account/signin.tsx @@ -4,9 +4,8 @@ import { PageMeta, preloadAttributesForm, StoreConfigDocument } from '@graphcomm import { useMergeGuestWishlistWithCustomer } from '@graphcommerce/magento-wishlist' import { magentoVersion } from '@graphcommerce/next-config/config' import type { GetStaticProps } from '@graphcommerce/next-ui' -import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' -import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' import type { LayoutOverlayProps } from '../../components' import { LayoutOverlay } from '../../components' diff --git a/examples/magento-open-source/pages/checkout/success.tsx b/examples/magento-open-source/pages/checkout/success.tsx index bef02f59c36..94bc76d12ec 100644 --- a/examples/magento-open-source/pages/checkout/success.tsx +++ b/examples/magento-open-source/pages/checkout/success.tsx @@ -1,5 +1,5 @@ import { WaitForQueries } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { CartItemSummary, diff --git a/examples/magento-open-source/pages/customer/account/createPassword.tsx b/examples/magento-open-source/pages/customer/account/createPassword.tsx index 9ba2529f1d4..5b80ed39cbd 100644 --- a/examples/magento-open-source/pages/customer/account/createPassword.tsx +++ b/examples/magento-open-source/pages/customer/account/createPassword.tsx @@ -5,7 +5,7 @@ import type { GetStaticProps } from '@graphcommerce/next-ui' import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' -import { Box, Button, Container, Link } from '@mui/material' +import { Box, Container, Link } from '@mui/material' import { useRouter } from 'next/router' import type { LayoutOverlayProps } from '../../../components' import { LayoutOverlay } from '../../../components' diff --git a/examples/magento-open-source/pages/search/[[...url]].tsx b/examples/magento-open-source/pages/search/[[...url]].tsx index 0d9f9b63c3e..e100fe8e601 100644 --- a/examples/magento-open-source/pages/search/[[...url]].tsx +++ b/examples/magento-open-source/pages/search/[[...url]].tsx @@ -17,8 +17,6 @@ import { } from '@graphcommerce/magento-product' import type { CategorySearchQuery } from '@graphcommerce/magento-search' import { - categoriesApplySearchDefaults, - CategorySearchDocument, productListApplySearchDefaults, searchDefaultsToProductListFilters, SearchField, diff --git a/examples/magento-open-source/pages/service/contact-us.tsx b/examples/magento-open-source/pages/service/contact-us.tsx index d5e35626216..c12f5fe0684 100644 --- a/examples/magento-open-source/pages/service/contact-us.tsx +++ b/examples/magento-open-source/pages/service/contact-us.tsx @@ -15,7 +15,7 @@ type Props = Record type RouteProps = { url: string[] } type GetPageStaticProps = GetStaticProps -function ContactUs(props: Props) { +function ContactUs() { const title = t`Contact us` return ( diff --git a/examples/magento-open-source/pages/service/index.tsx b/examples/magento-open-source/pages/service/index.tsx index 0c9849a1323..333010adf2f 100644 --- a/examples/magento-open-source/pages/service/index.tsx +++ b/examples/magento-open-source/pages/service/index.tsx @@ -13,7 +13,7 @@ type Props = Record type RouteProps = { url: string[] } type GetPageStaticProps = GetStaticProps -function ServicePage(props: Props) { +function ServicePage() { const title = t`Customer Service` return ( diff --git a/examples/magento-open-source/pages/service/newsletter.tsx b/examples/magento-open-source/pages/service/newsletter.tsx index a69c8c6b0cf..6ba9349908f 100644 --- a/examples/magento-open-source/pages/service/newsletter.tsx +++ b/examples/magento-open-source/pages/service/newsletter.tsx @@ -15,7 +15,7 @@ type Props = Record type RouteProps = { url: string[] } type GetPageStaticProps = GetStaticProps -function NewsletterSubscribe(props: Props) { +function NewsletterSubscribe() { const title = t`Newsletter` return ( diff --git a/examples/magento-storyblok/components/Layout/Footer.tsx b/examples/magento-storyblok/components/Layout/Footer.tsx index 684e149d99c..24c81d0d585 100644 --- a/examples/magento-storyblok/components/Layout/Footer.tsx +++ b/examples/magento-storyblok/components/Layout/Footer.tsx @@ -18,7 +18,6 @@ export function Footer(props: FooterProps) { const cartEnabled = useCheckoutGuestEnabled() const config = useQuery(StoreConfigDocument).data?.storeConfig - const websiteName = config?.website_name const year = return ( diff --git a/examples/magento-storyblok/components/ProductView/Reviews.tsx b/examples/magento-storyblok/components/ProductView/Reviews.tsx index dda54186a8b..fc3bf13904d 100644 --- a/examples/magento-storyblok/components/ProductView/Reviews.tsx +++ b/examples/magento-storyblok/components/ProductView/Reviews.tsx @@ -2,7 +2,7 @@ import { useQuery } from '@graphcommerce/graphql' import type { ProductReviewsProps } from '@graphcommerce/magento-review' import { ProductReviews } from '@graphcommerce/magento-review' import { StoreConfigDocument } from '@graphcommerce/magento-store' -import { Row, sxx } from '@graphcommerce/next-ui' +import { Row } from '@graphcommerce/next-ui' import { Box, Typography } from '@mui/material' type ReviewsProps = ProductReviewsProps & { title: React.ReactNode } diff --git a/examples/magento-storyblok/components/Storyblok/RowBlogContent/RowBlogContent.tsx b/examples/magento-storyblok/components/Storyblok/RowBlogContent/RowBlogContent.tsx index 2feb156b145..ce6712be6e7 100644 --- a/examples/magento-storyblok/components/Storyblok/RowBlogContent/RowBlogContent.tsx +++ b/examples/magento-storyblok/components/Storyblok/RowBlogContent/RowBlogContent.tsx @@ -1,4 +1,4 @@ -import { BlogContent, Row } from '@graphcommerce/next-ui' +import { BlogContent } from '@graphcommerce/next-ui' import { RichText, storyblokEditable } from '@graphcommerce/storyblok-ui' import { Box } from '@mui/material' import type { StoryblokRowBlogContent as RowBlogContentBlok } from '../types' diff --git a/examples/magento-storyblok/pages/account/index.tsx b/examples/magento-storyblok/pages/account/index.tsx index 64c736d8abd..7d9a8e016e0 100644 --- a/examples/magento-storyblok/pages/account/index.tsx +++ b/examples/magento-storyblok/pages/account/index.tsx @@ -14,7 +14,6 @@ import { import { CustomerNewsletterToggle } from '@graphcommerce/magento-newsletter' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { - iconBin, iconBox, iconEmailOutline, iconHome, diff --git a/examples/magento-storyblok/pages/account/orders/shipment.tsx b/examples/magento-storyblok/pages/account/orders/shipment.tsx index a9903ac906d..750f4268a55 100644 --- a/examples/magento-storyblok/pages/account/orders/shipment.tsx +++ b/examples/magento-storyblok/pages/account/orders/shipment.tsx @@ -1,7 +1,6 @@ import type { PageOptions } from '@graphcommerce/framer-next-pages' import { getCustomerAccountIsDisabled, - OrderDetails, SalesComments, ShipmentDetailPageDocument, ShipmentDetails, diff --git a/examples/magento-storyblok/pages/account/signin.tsx b/examples/magento-storyblok/pages/account/signin.tsx index 635533844bb..b2ff78c7851 100644 --- a/examples/magento-storyblok/pages/account/signin.tsx +++ b/examples/magento-storyblok/pages/account/signin.tsx @@ -4,9 +4,8 @@ import { PageMeta, preloadAttributesForm, StoreConfigDocument } from '@graphcomm import { useMergeGuestWishlistWithCustomer } from '@graphcommerce/magento-wishlist' import { magentoVersion } from '@graphcommerce/next-config/config' import type { GetStaticProps } from '@graphcommerce/next-ui' -import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' +import { LayoutOverlayHeader } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' -import { Trans } from '@lingui/react/macro' import { Container } from '@mui/material' import type { LayoutOverlayProps } from '../../components' import { LayoutOverlay } from '../../components' diff --git a/examples/magento-storyblok/pages/checkout/success.tsx b/examples/magento-storyblok/pages/checkout/success.tsx index 6c5a2617c32..4aa2c02fd0f 100644 --- a/examples/magento-storyblok/pages/checkout/success.tsx +++ b/examples/magento-storyblok/pages/checkout/success.tsx @@ -1,5 +1,5 @@ import { WaitForQueries } from '@graphcommerce/ecommerce-ui' -import { PageOptions } from '@graphcommerce/framer-next-pages' +import type { PageOptions } from '@graphcommerce/framer-next-pages' import { cacheFirst } from '@graphcommerce/graphql' import { CartItemSummary, diff --git a/examples/magento-storyblok/pages/customer/account/createPassword.tsx b/examples/magento-storyblok/pages/customer/account/createPassword.tsx index 9ba2529f1d4..5b80ed39cbd 100644 --- a/examples/magento-storyblok/pages/customer/account/createPassword.tsx +++ b/examples/magento-storyblok/pages/customer/account/createPassword.tsx @@ -5,7 +5,7 @@ import type { GetStaticProps } from '@graphcommerce/next-ui' import { LayoutOverlayHeader, LayoutTitle } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' -import { Box, Button, Container, Link } from '@mui/material' +import { Box, Container, Link } from '@mui/material' import { useRouter } from 'next/router' import type { LayoutOverlayProps } from '../../../components' import { LayoutOverlay } from '../../../components' diff --git a/examples/magento-storyblok/pages/search/[[...url]].tsx b/examples/magento-storyblok/pages/search/[[...url]].tsx index 9a020c42cea..04215a7e728 100644 --- a/examples/magento-storyblok/pages/search/[[...url]].tsx +++ b/examples/magento-storyblok/pages/search/[[...url]].tsx @@ -17,8 +17,6 @@ import { } from '@graphcommerce/magento-product' import type { CategorySearchQuery } from '@graphcommerce/magento-search' import { - categoriesApplySearchDefaults, - CategorySearchDocument, productListApplySearchDefaults, searchDefaultsToProductListFilters, SearchField, diff --git a/packages/algolia-categories/mesh/algoliaHitToMagentoCategory.ts b/packages/algolia-categories/mesh/algoliaHitToMagentoCategory.ts index 55483492715..71099b4c779 100644 --- a/packages/algolia-categories/mesh/algoliaHitToMagentoCategory.ts +++ b/packages/algolia-categories/mesh/algoliaHitToMagentoCategory.ts @@ -20,8 +20,8 @@ export type AlgoliaCategoryHitAddiotonalProperties = AlgoliaProductHitAdditional } function assertAdditional( - additional: unknown, -): additional is AlgoliaCategoryHitAddiotonalProperties { + _additional: unknown, +): _additional is AlgoliaCategoryHitAddiotonalProperties { return true } diff --git a/packages/algolia-products/mesh/algoliaFacetsToAggregations.ts b/packages/algolia-products/mesh/algoliaFacetsToAggregations.ts index 15554fcb06b..c29a9b21933 100644 --- a/packages/algolia-products/mesh/algoliaFacetsToAggregations.ts +++ b/packages/algolia-products/mesh/algoliaFacetsToAggregations.ts @@ -65,7 +65,7 @@ export function algoliaPricesToPricesAggregations( } // eslint-disable-next-line @typescript-eslint/no-explicit-any -function assertAlgoliaFacets(facets: any): facets is AlgoliaFacets { +function assertAlgoliaFacets(_facets: any): _facets is AlgoliaFacets { return true } diff --git a/packages/algolia-products/mesh/algoliaHitToMagentoProduct.ts b/packages/algolia-products/mesh/algoliaHitToMagentoProduct.ts index c9fea07f562..f6f057831f3 100644 --- a/packages/algolia-products/mesh/algoliaHitToMagentoProduct.ts +++ b/packages/algolia-products/mesh/algoliaHitToMagentoProduct.ts @@ -14,8 +14,8 @@ import type { import type { GetStoreConfigReturn } from './getStoreConfig' function assertAdditional( - additional: unknown, -): additional is AlgoliaProductHitAdditionalProperties { + _additional: unknown, +): _additional is AlgoliaProductHitAdditionalProperties { return true } diff --git a/packages/algolia-products/mesh/getFilterTypes.ts b/packages/algolia-products/mesh/getFilterTypes.ts index ca0216c52e6..28acbb80ecc 100644 --- a/packages/algolia-products/mesh/getFilterTypes.ts +++ b/packages/algolia-products/mesh/getFilterTypes.ts @@ -22,7 +22,7 @@ export async function getFilterTypes(context: MeshContext): Promise .map((i) => [i.code, i.frontend_input]) .filter(nonNullable), ) - } catch (error) { + } catch { // Fallback to the old way } } diff --git a/packages/algolia-products/mesh/getSearchSuggestionsInput.ts b/packages/algolia-products/mesh/getSearchSuggestionsInput.ts index 5a643959ac8..1c6602b49e1 100644 --- a/packages/algolia-products/mesh/getSearchSuggestionsInput.ts +++ b/packages/algolia-products/mesh/getSearchSuggestionsInput.ts @@ -8,7 +8,7 @@ export function isSuggestionsEnabled() { // eslint-disable-next-line @typescript-eslint/require-await export async function getSearchSuggestionsInput( search: string, - context: MeshContext, + _context: MeshContext, ): Promise { return { query: search, diff --git a/packages/algolia-products/mesh/resolvers.ts b/packages/algolia-products/mesh/resolvers.ts index 8c837aa75a5..67d7776cc9c 100644 --- a/packages/algolia-products/mesh/resolvers.ts +++ b/packages/algolia-products/mesh/resolvers.ts @@ -1,4 +1,4 @@ -import type { AlgoliasearchResponse, MeshContext, Resolvers } from '@graphcommerce/graphql-mesh' +import type { AlgoliasearchResponse, Resolvers } from '@graphcommerce/graphql-mesh' import { hasSelectionSetPath } from '@graphcommerce/graphql-mesh' import type { GraphQLError, GraphQLResolveInfo } from 'graphql' import { algoliaFacetsToAggregations, getCategoryList } from './algoliaFacetsToAggregations' diff --git a/packages/algolia-search/components/Chip/RenderChip.tsx b/packages/algolia-search/components/Chip/RenderChip.tsx index 3ff0d60b2a4..cd7405c5d65 100644 --- a/packages/algolia-search/components/Chip/RenderChip.tsx +++ b/packages/algolia-search/components/Chip/RenderChip.tsx @@ -1,6 +1,5 @@ import type { TypeRenderer } from '@graphcommerce/next-ui' import { RenderType } from '@graphcommerce/next-ui' -import React from 'react' import type { RefinementFilterChipProps } from './FilterChip/RefinementFilterChip' import { RefinementFilterChip } from './FilterChip/RefinementFilterChip' import type { RefinementRangeChipProps } from './FilterChip/RefinementRangeChip' diff --git a/packages/cli/dist/bin/codegen.js b/packages/cli/dist/bin/codegen.js index 09b809e69b7..a2c26e167dc 100755 --- a/packages/cli/dist/bin/codegen.js +++ b/packages/cli/dist/bin/codegen.js @@ -17,7 +17,7 @@ async function cleanup() { if (r.isFile()) return fs.unlink(configLocation); return void 0; }); - } catch (e) { + } catch { } return void 0; } diff --git a/packages/cli/dist/bin/mesh.js b/packages/cli/dist/bin/mesh.js index b6266a227a8..5ccf33c32ae 100755 --- a/packages/cli/dist/bin/mesh.js +++ b/packages/cli/dist/bin/mesh.js @@ -95,7 +95,7 @@ async function cleanup() { if (r.isFile()) return promises.unlink(tmpMeshLocation); return void 0; }); - } catch (e) { + } catch { } return void 0; } diff --git a/packages/cli/src/bin/codegen.ts b/packages/cli/src/bin/codegen.ts index 1eb4deb47de..7dbdc0eaf62 100755 --- a/packages/cli/src/bin/codegen.ts +++ b/packages/cli/src/bin/codegen.ts @@ -21,7 +21,7 @@ async function cleanup() { if (r.isFile()) return fs.unlink(configLocation) return undefined }) - } catch (e) { + } catch { // ignore } return undefined diff --git a/packages/cli/src/bin/mesh.ts b/packages/cli/src/bin/mesh.ts index d75e18b1241..33efe24854f 100755 --- a/packages/cli/src/bin/mesh.ts +++ b/packages/cli/src/bin/mesh.ts @@ -52,7 +52,7 @@ async function cleanup() { if (r.isFile()) return fs.unlink(tmpMeshLocation) return undefined }) - } catch (e) { + } catch { // ignore } return undefined diff --git a/packages/demo-magento-graphcommerce/copy/pages/test/form-elements.tsx b/packages/demo-magento-graphcommerce/copy/pages/test/form-elements.tsx index c718dc20209..9eb2ba268a1 100644 --- a/packages/demo-magento-graphcommerce/copy/pages/test/form-elements.tsx +++ b/packages/demo-magento-graphcommerce/copy/pages/test/form-elements.tsx @@ -19,7 +19,7 @@ import { LayoutTitle, } from '@graphcommerce/next-ui' import { FormAutoSubmit, FormPersist, useForm } from '@graphcommerce/react-hook-form' -import { Container, List, ListItem, TextField, Typography } from '@mui/material' +import { Container, List, ListItem, Typography } from '@mui/material' import type { LayoutMinimalProps } from '../../components' import { LayoutMinimal } from '../../components' import { graphqlSharedClient } from '../../lib/graphql/graphqlSsrClient' diff --git a/packages/demo-magento-graphcommerce/copy/pages/test/minimal-page-shell/[[...url]].tsx b/packages/demo-magento-graphcommerce/copy/pages/test/minimal-page-shell/[[...url]].tsx index 26168abc40e..e912268c45e 100644 --- a/packages/demo-magento-graphcommerce/copy/pages/test/minimal-page-shell/[[...url]].tsx +++ b/packages/demo-magento-graphcommerce/copy/pages/test/minimal-page-shell/[[...url]].tsx @@ -11,7 +11,8 @@ import { import { Container, Divider, List, ListItemButton } from '@mui/material' import { m } from 'motion/react' import { useRouter } from 'next/router' -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import type { LayoutMinimalProps } from '../../../components' import { LayoutMinimal } from '../../../components' diff --git a/packages/demo-magento-graphcommerce/copy/pages/test/number-inputs.tsx b/packages/demo-magento-graphcommerce/copy/pages/test/number-inputs.tsx index b487a1f0bdc..37931c1b1db 100644 --- a/packages/demo-magento-graphcommerce/copy/pages/test/number-inputs.tsx +++ b/packages/demo-magento-graphcommerce/copy/pages/test/number-inputs.tsx @@ -2,7 +2,7 @@ import { NumberFieldElement, useForm } from '@graphcommerce/ecommerce-ui' import type { PageOptions } from '@graphcommerce/framer-next-pages' import { StoreConfigDocument } from '@graphcommerce/magento-store' import type { GetStaticProps, TextInputNumberProps } from '@graphcommerce/next-ui' -import { LayoutHeader, LayoutTitle, responsiveVal, TextInputNumber } from '@graphcommerce/next-ui' +import { LayoutHeader, LayoutTitle, responsiveVal } from '@graphcommerce/next-ui' import { Box, Container, Divider, styled, Typography } from '@mui/material' import React from 'react' import type { LayoutMinimalProps } from '../../components' diff --git a/packages/ecommerce-ui/components/FormComponents/ActionCardListForm.tsx b/packages/ecommerce-ui/components/FormComponents/ActionCardListForm.tsx index 339a36be773..794a6861aed 100644 --- a/packages/ecommerce-ui/components/FormComponents/ActionCardListForm.tsx +++ b/packages/ecommerce-ui/components/FormComponents/ActionCardListForm.tsx @@ -3,7 +3,8 @@ import { ActionCardList } from '@graphcommerce/next-ui' import type { ControllerProps, FieldValues } from '@graphcommerce/react-hook-form' import { useController } from '@graphcommerce/react-hook-form' import type { MouseEventHandler } from 'react' -import React, { useCallback } from 'react' +import type React from 'react' +import { useCallback } from 'react' export type ActionCardItemBase = Pick @@ -54,7 +55,7 @@ export function ActionCardListForm< ) const { - field: { onChange, value, ref, onBlur }, + field: { onChange, value, ref }, fieldState, formState, } = useController({ diff --git a/packages/ecommerce-ui/components/FormComponents/SliderElement.tsx b/packages/ecommerce-ui/components/FormComponents/SliderElement.tsx index f6417285a07..eadb3f89843 100644 --- a/packages/ecommerce-ui/components/FormComponents/SliderElement.tsx +++ b/packages/ecommerce-ui/components/FormComponents/SliderElement.tsx @@ -3,7 +3,7 @@ import { useController } from '@graphcommerce/react-hook-form' import { t } from '@lingui/core/macro' import type { FormControlProps, SliderProps } from '@mui/material' import { FormControl, FormHelperText, FormLabel, Slider } from '@mui/material' -import React from 'react' +import type React from 'react' import type { FieldElementProps } from './types' type AdditionalProps = { diff --git a/packages/ecommerce-ui/components/FormComponents/SwitchElement.tsx b/packages/ecommerce-ui/components/FormComponents/SwitchElement.tsx index b7678cc11cc..c25d0699f1c 100644 --- a/packages/ecommerce-ui/components/FormComponents/SwitchElement.tsx +++ b/packages/ecommerce-ui/components/FormComponents/SwitchElement.tsx @@ -2,7 +2,7 @@ import type { FieldValues } from '@graphcommerce/react-hook-form' import { useController } from '@graphcommerce/react-hook-form' import type { FormControlLabelProps, SwitchProps } from '@mui/material' import { FormControlLabel, Switch } from '@mui/material' -import React from 'react' +import type React from 'react' import type { FieldElementProps } from './types' type AdditionalProps = Omit diff --git a/packages/ecommerce-ui/components/FormComponents/TextFieldElement.tsx b/packages/ecommerce-ui/components/FormComponents/TextFieldElement.tsx index 36752ed455b..be5976e8ad7 100644 --- a/packages/ecommerce-ui/components/FormComponents/TextFieldElement.tsx +++ b/packages/ecommerce-ui/components/FormComponents/TextFieldElement.tsx @@ -5,7 +5,8 @@ import { emailPattern, useController } from '@graphcommerce/react-hook-form' import { t } from '@lingui/core/macro' import type { TextFieldProps } from '@mui/material' import { TextField, useForkRef } from '@mui/material' -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import type { BaseControllerProps, FieldElementProps } from './types' type InternalProps = { diff --git a/packages/ecommerce-ui/components/PreviewMode/PreviewMode.tsx b/packages/ecommerce-ui/components/PreviewMode/PreviewMode.tsx index 588f7dfb285..0a033edab47 100644 --- a/packages/ecommerce-ui/components/PreviewMode/PreviewMode.tsx +++ b/packages/ecommerce-ui/components/PreviewMode/PreviewMode.tsx @@ -2,13 +2,6 @@ import { useRouter } from 'next/router' import { PreviewModeDisabled } from './PreviewModeDisabled' import { PreviewModeEnabled } from './PreviewModeEnabled' -function getPreviewUrl() { - const url = new URL(window.location.href) - url.pathname = '/api/preview' - ;[...url.searchParams.entries()].forEach(([key]) => url.searchParams.delete(key)) - return url -} - export function PreviewMode() { const router = useRouter() diff --git a/packages/ecommerce-ui/components/WaitForQueries/WaitForQueries.tsx b/packages/ecommerce-ui/components/WaitForQueries/WaitForQueries.tsx index f4bdd25add4..0def06aa637 100644 --- a/packages/ecommerce-ui/components/WaitForQueries/WaitForQueries.tsx +++ b/packages/ecommerce-ui/components/WaitForQueries/WaitForQueries.tsx @@ -1,6 +1,6 @@ -import type { ApolloClient, useQuery } from '@graphcommerce/graphql' +import type { useQuery } from '@graphcommerce/graphql' import { useIsSSR } from '@graphcommerce/next-ui' -import React from 'react' +import type React from 'react' export type WaitForQueriesProps = { // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/framer-next-pages/components/Page.tsx b/packages/framer-next-pages/components/Page.tsx index 2d7bebea6de..5eea94bb404 100644 --- a/packages/framer-next-pages/components/Page.tsx +++ b/packages/framer-next-pages/components/Page.tsx @@ -1,6 +1,6 @@ import { dvh } from '@graphcommerce/framer-utils' import { m, useIsPresent } from 'motion/react' -import React from 'react' +import type React from 'react' import type { PageItem } from '../types' export type PageProps = Pick & { diff --git a/packages/framer-next-pages/components/Pages.tsx b/packages/framer-next-pages/components/Pages.tsx index f1e52356032..edef02a8557 100644 --- a/packages/framer-next-pages/components/Pages.tsx +++ b/packages/framer-next-pages/components/Pages.tsx @@ -169,7 +169,7 @@ export function FramerNextPages(props: PagesProps) { } cancel = requestIdleCallback(() => setFallback(fbItem)) - } catch (e) { + } catch { if (process.env.NODE_ENV !== 'production') { // eslint-disable-next-line no-console console.log( diff --git a/packages/framer-next-pages/example/components/StackedDebugger.tsx b/packages/framer-next-pages/example/components/StackedDebugger.tsx index 1489e7b0930..d2b76ab1367 100644 --- a/packages/framer-next-pages/example/components/StackedDebugger.tsx +++ b/packages/framer-next-pages/example/components/StackedDebugger.tsx @@ -1,5 +1,5 @@ import { useRouter } from 'next/router' -import React, { useState } from 'react' +import { useState } from 'react' import { PageDepthDebug } from './PageDepthDebug' import { useRenderCount } from './useRenderCount' diff --git a/packages/framer-next-pages/example/pages/_app.tsx b/packages/framer-next-pages/example/pages/_app.tsx index 0fca3cb2c4f..2f8d140a679 100644 --- a/packages/framer-next-pages/example/pages/_app.tsx +++ b/packages/framer-next-pages/example/pages/_app.tsx @@ -8,7 +8,6 @@ import { createTheme, CssBaseline, ThemeProvider } from '@mui/material' import { LazyMotion } from 'motion/react' import type { AppPropsType } from 'next/dist/shared/lib/utils' import type { Router } from 'next/router' -import React from 'react' import '../demo.css' const theme = createTheme({ diff --git a/packages/framer-next-pages/example/pages/multi-stack/[...url].tsx b/packages/framer-next-pages/example/pages/multi-stack/[...url].tsx index 4c43ea3e645..075b2232e4a 100644 --- a/packages/framer-next-pages/example/pages/multi-stack/[...url].tsx +++ b/packages/framer-next-pages/example/pages/multi-stack/[...url].tsx @@ -13,7 +13,7 @@ import { Container, Link } from '@mui/material' import { m } from 'motion/react' import type { GetStaticPathsResult, GetStaticProps } from 'next' import { useRouter } from 'next/router' -import React, { useState } from 'react' +import { useState } from 'react' import { Grid } from '../../components/Grid' import { StackDebug } from '../../components/StackedDebugger' diff --git a/packages/framer-next-pages/example/pages/single-stack/[...url].tsx b/packages/framer-next-pages/example/pages/single-stack/[...url].tsx index 9f54ad4e022..9a8617a5379 100644 --- a/packages/framer-next-pages/example/pages/single-stack/[...url].tsx +++ b/packages/framer-next-pages/example/pages/single-stack/[...url].tsx @@ -6,7 +6,7 @@ import { Container, Link } from '@mui/material' import { m } from 'motion/react' import type { GetStaticPathsResult, GetStaticProps } from 'next' import { useRouter } from 'next/router' -import React, { useState } from 'react' +import { useState } from 'react' import { Grid } from '../../components/Grid' import { StackDebug } from '../../components/StackedDebugger' diff --git a/packages/framer-scroller/components/ThumbnailContainer.tsx b/packages/framer-scroller/components/ThumbnailContainer.tsx index 92acf084623..4510a297377 100644 --- a/packages/framer-scroller/components/ThumbnailContainer.tsx +++ b/packages/framer-scroller/components/ThumbnailContainer.tsx @@ -3,7 +3,8 @@ import type { SxProps, Theme } from '@mui/material' import { styled } from '@mui/material' import type { MotionNodePanHandlers } from 'motion/react' import { m } from 'motion/react' -import React, { useRef } from 'react' +import type React from 'react' +import { useRef } from 'react' const MotionBox = styled(m.div)({}) diff --git a/packages/framer-scroller/example/pages/_app.tsx b/packages/framer-scroller/example/pages/_app.tsx index 37a4072fde1..b29964b9d1d 100644 --- a/packages/framer-scroller/example/pages/_app.tsx +++ b/packages/framer-scroller/example/pages/_app.tsx @@ -4,7 +4,6 @@ import { createTheme, CssBaseline, StyledEngineProvider, ThemeProvider } from '@ import { domMax, LazyMotion } from 'motion/react' import type { AppPropsType } from 'next/dist/shared/lib/utils' import type { Router } from 'next/router' -import React from 'react' const theme = createTheme({ shape: { diff --git a/packages/framer-scroller/example/pages/index.tsx b/packages/framer-scroller/example/pages/index.tsx index 5ea1f43db1a..75e511edd71 100644 --- a/packages/framer-scroller/example/pages/index.tsx +++ b/packages/framer-scroller/example/pages/index.tsx @@ -8,7 +8,7 @@ import { import { sxx } from '@graphcommerce/next-ui' import { Box, styled, Typography } from '@mui/material' import { m } from 'motion/react' -import React, { useState } from 'react' +import { useState } from 'react' const MotionDiv = styled(m.div)({}) diff --git a/packages/googlerecaptcha/mesh/resolvers.ts b/packages/googlerecaptcha/mesh/resolvers.ts index 52cf12e666c..d235f22ad21 100644 --- a/packages/googlerecaptcha/mesh/resolvers.ts +++ b/packages/googlerecaptcha/mesh/resolvers.ts @@ -4,7 +4,7 @@ import { googleRecaptchaKey } from '@graphcommerce/next-config/config' export const resolvers: Resolvers = { Query: { - recaptchaV3Config: (root, args, context, info) => { + recaptchaV3Config: (root, args, context) => { const config = storefrontFromContext(context) const key = config?.googleRecaptchaKey ?? googleRecaptchaKey diff --git a/packages/graphql-mesh/utils/traverseSelectionSet.ts b/packages/graphql-mesh/utils/traverseSelectionSet.ts index 745f53a8c52..cf33fb7d1f2 100644 --- a/packages/graphql-mesh/utils/traverseSelectionSet.ts +++ b/packages/graphql-mesh/utils/traverseSelectionSet.ts @@ -1,4 +1,4 @@ -import type { GraphQLResolveInfo, SelectionNode, SelectionSetNode } from 'graphql' +import type { SelectionNode, SelectionSetNode } from 'graphql' import { Kind, print } from 'graphql' import type { Path } from 'react-hook-form' diff --git a/packages/hygraph-cli/src/readSchema.ts b/packages/hygraph-cli/src/readSchema.ts index a2d318a0265..8e2c1339226 100644 --- a/packages/hygraph-cli/src/readSchema.ts +++ b/packages/hygraph-cli/src/readSchema.ts @@ -1,4 +1,4 @@ -import type { ApolloClient, NormalizedCacheObject } from '@apollo/client' +import type { ApolloClient } from '@apollo/client' import { gql } from '@apollo/client' import type { Schema } from './types' diff --git a/packages/hygraph-cli/src/utils/getEndpointUrl.ts b/packages/hygraph-cli/src/utils/getEndpointUrl.ts index b996b21e9ee..13911cc9f1c 100644 --- a/packages/hygraph-cli/src/utils/getEndpointUrl.ts +++ b/packages/hygraph-cli/src/utils/getEndpointUrl.ts @@ -1,4 +1,4 @@ -import type { ApolloClient, NormalizedCacheObject } from '@apollo/client' +import type { ApolloClient } from '@apollo/client' import gql from 'graphql-tag' import type { HygraphConfig } from './getConfig' diff --git a/packages/hygraph-dynamic-rows/lib/hygraphDynamicRows.ts b/packages/hygraph-dynamic-rows/lib/hygraphDynamicRows.ts index 8cd606f106b..c4798999dac 100644 --- a/packages/hygraph-dynamic-rows/lib/hygraphDynamicRows.ts +++ b/packages/hygraph-dynamic-rows/lib/hygraphDynamicRows.ts @@ -1,4 +1,4 @@ -import type { ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql' +import type { ApolloClient } from '@graphcommerce/graphql' import { cacheFirst } from '@graphcommerce/graphql' import type { HygraphPagesQuery } from '@graphcommerce/hygraph-ui' import type { diff --git a/packages/hygraph-ui/components/Asset/Asset.tsx b/packages/hygraph-ui/components/Asset/Asset.tsx index 88cb0981a13..f2004a38176 100644 --- a/packages/hygraph-ui/components/Asset/Asset.tsx +++ b/packages/hygraph-ui/components/Asset/Asset.tsx @@ -1,6 +1,5 @@ import type { ImageProps } from '@graphcommerce/image' import { Image } from '@graphcommerce/image' -import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { styled } from '@mui/material' import { memo } from 'react' diff --git a/packages/hygraph-ui/components/RichText/RichText.tsx b/packages/hygraph-ui/components/RichText/RichText.tsx index 707b6fb349b..c056e11acbe 100644 --- a/packages/hygraph-ui/components/RichText/RichText.tsx +++ b/packages/hygraph-ui/components/RichText/RichText.tsx @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/no-use-before-define */ -import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import React from 'react' import { defaultRenderers } from './defaultRenderers' diff --git a/packages/hygraph-ui/lib/getAllHygraphPages.ts b/packages/hygraph-ui/lib/getAllHygraphPages.ts index c7137c37a0e..2ac2177ddd3 100644 --- a/packages/hygraph-ui/lib/getAllHygraphPages.ts +++ b/packages/hygraph-ui/lib/getAllHygraphPages.ts @@ -1,6 +1,5 @@ import { cacheFirst } from '@graphcommerce/graphql' import type { ApolloClient } from '@apollo/client' -import type { HygraphAllPagesQuery } from '../graphql' import { HygraphAllPagesDocument } from '../graphql' type Urls = { url: string } diff --git a/packages/image/components/Image.tsx b/packages/image/components/Image.tsx index d9371732b89..93ae18947c7 100644 --- a/packages/image/components/Image.tsx +++ b/packages/image/components/Image.tsx @@ -9,7 +9,6 @@ /* eslint-disable jsx-a11y/alt-text */ import { imageQuality } from '@graphcommerce/next-config/config' -import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { styled, useForkRef } from '@mui/material' import type { ImageConfigComplete, LoaderValue } from 'next/dist/shared/lib/image-config' @@ -521,7 +520,7 @@ const Image = React.forwardRef( width={width} height={height} data-nimg - sx={sxx(style, sx)} + sx={[style, ...(Array.isArray(sx) ? sx : [sx])]} /> ) : ( @@ -539,7 +538,7 @@ const Image = React.forwardRef( loading={loading ?? 'lazy'} width={width} height={height} - sx={sxx(style, sx)} + sx={[style, ...(Array.isArray(sx) ? sx : [sx])]} sizes={sizes} data-nimg decoding='async' diff --git a/packages/image/config/config.ts b/packages/image/config/config.ts index 2d83ff94a06..4c381a868ab 100644 --- a/packages/image/config/config.ts +++ b/packages/image/config/config.ts @@ -14,6 +14,10 @@ export type ImageLoaderPropsWithConfig = ImageLoaderProps & { config: Readonly } +const imageConfig = + // eslint-disable-next-line no-underscore-dangle + (process.env.__NEXT_IMAGE_OPTS as unknown as ImageConfigComplete) || imageConfigDefault + /** @public */ export const { deviceSizes: configDeviceSizes, @@ -21,8 +25,7 @@ export const { loader: configLoader, path: configPath, domains: configDomains, - // eslint-disable-next-line no-underscore-dangle -} = (process.env.__NEXT_IMAGE_OPTS as unknown as ImageConfigComplete) || imageConfigDefault +} = imageConfig function normalizeSrc(src: string): string { return src[0] === '/' ? src.slice(1) : src @@ -162,13 +165,11 @@ export function imageUrl( const { width, quality = 'content' } = options if (configLoader === 'custom') return src - const config = - (process.env.__NEXT_IMAGE_OPTS as unknown as ImageConfigComplete) || imageConfigDefault const allSizes = [...configImageSizes, ...configDeviceSizes].sort((a, b) => a - b) const snapped = allSizes.find((size) => size >= width) ?? allSizes[allSizes.length - 1] return (urlLoaders[configLoader] ?? defaultLoader)({ - config: { ...config, allSizes }, + config: { ...imageConfig, allSizes }, src, width: snapped, quality: typeof quality === 'number' ? quality : imageQuality[quality], diff --git a/packages/image/example/pages/index.tsx b/packages/image/example/pages/index.tsx index a348e270146..dace160d6c3 100644 --- a/packages/image/example/pages/index.tsx +++ b/packages/image/example/pages/index.tsx @@ -1,6 +1,5 @@ /* eslint-disable import/no-extraneous-dependencies */ import { Image } from '@graphcommerce/image' -import React from 'react' import image from '../components/image.jpg' const imgWidth = image.width diff --git a/packages/lingui-next/components/LinguiProvider.tsx b/packages/lingui-next/components/LinguiProvider.tsx index 7a0f649b409..379fece469a 100644 --- a/packages/lingui-next/components/LinguiProvider.tsx +++ b/packages/lingui-next/components/LinguiProvider.tsx @@ -3,7 +3,8 @@ import { i18n, type Messages } from '@lingui/core' import { t } from '@lingui/core/macro' import type { I18nProviderProps } from '@lingui/react' import { I18nProvider } from '@lingui/react' -import React, { useMemo } from 'react' +import type React from 'react' +import { useMemo } from 'react' import type { MessageLoader, SyncMessageLoader } from '../types' export type LinguiProviderProps = Omit & { diff --git a/packages/magento-cart-coupon/CouponAccordion/CouponAccordion.tsx b/packages/magento-cart-coupon/CouponAccordion/CouponAccordion.tsx index 01a169130c2..e2b432c4e30 100644 --- a/packages/magento-cart-coupon/CouponAccordion/CouponAccordion.tsx +++ b/packages/magento-cart-coupon/CouponAccordion/CouponAccordion.tsx @@ -7,7 +7,7 @@ import { sxx, } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' -import type { AccordionProps, SxProps, Theme } from '@mui/material' +import type { AccordionProps } from '@mui/material' import { Accordion, AccordionDetails, AccordionSummary, Box } from '@mui/material' import { useState } from 'react' import { ApplyCouponForm } from '../ApplyCouponForm/ApplyCouponForm' diff --git a/packages/magento-cart-items/components/UpdateItemQuantity/UpdateItemQuantity.tsx b/packages/magento-cart-items/components/UpdateItemQuantity/UpdateItemQuantity.tsx index 63758348e8d..b1671a9f993 100644 --- a/packages/magento-cart-items/components/UpdateItemQuantity/UpdateItemQuantity.tsx +++ b/packages/magento-cart-items/components/UpdateItemQuantity/UpdateItemQuantity.tsx @@ -4,7 +4,6 @@ import { ApolloCartErrorSnackbar, useFormGqlMutationCart } from '@graphcommerce/ import type { UseFormGraphQlOptions } from '@graphcommerce/react-hook-form' import { FormAutoSubmit } from '@graphcommerce/react-hook-form' import type { SxProps, Theme } from '@mui/material' -import React from 'react' import type { UpdateItemQuantityMutation, UpdateItemQuantityMutationVariables, diff --git a/packages/magento-cart-payment-method/PaymentMethodContext/PaymentMethodContext.tsx b/packages/magento-cart-payment-method/PaymentMethodContext/PaymentMethodContext.tsx index 459ca7504a0..d5e025af891 100644 --- a/packages/magento-cart-payment-method/PaymentMethodContext/PaymentMethodContext.tsx +++ b/packages/magento-cart-payment-method/PaymentMethodContext/PaymentMethodContext.tsx @@ -3,7 +3,8 @@ import { useCartQuery, useClearCurrentCartId } from '@graphcommerce/magento-cart import { filterNonNullableKeys } from '@graphcommerce/next-ui' import { useEventCallback } from '@mui/material' import { useRouter } from 'next/router' -import React, { useEffect, useMemo, useState } from 'react' +import type React from 'react' +import { useEffect, useMemo, useState } from 'react' import type { ExpandPaymentMethodsContext, PaymentMethod, diff --git a/packages/magento-cart-payment-method/test/goToPayment.ts b/packages/magento-cart-payment-method/test/goToPayment.ts index adcdea76e87..5b411db7dc0 100644 --- a/packages/magento-cart-payment-method/test/goToPayment.ts +++ b/packages/magento-cart-payment-method/test/goToPayment.ts @@ -1,5 +1,5 @@ /* eslint-disable import/no-extraneous-dependencies */ -import type { ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql' +import type { ApolloClient } from '@graphcommerce/graphql' import { fillShippingAddressForm } from '@graphcommerce/magento-cart-shipping-address/test/fillShippingAddressForm' import { fillCartAgreementsForm } from '@graphcommerce/magento-cart/test/fillCartAgreementsForm' import type { Page } from '@playwright/test' diff --git a/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx b/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx index 1048047a3f9..9fbb8e0dae6 100644 --- a/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx +++ b/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx @@ -20,7 +20,8 @@ import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -import React, { useEffect } from 'react' +import type React from 'react' +import { useEffect } from 'react' import { findCustomerAddressFromCartAddress } from '../../utils/findCustomerAddressFromCartAddress' import { GetAddressesDocument } from '../ShippingAddressForm/GetAddresses.gql' import { CustomerAddressActionCard } from './CustomerAddressActionCard' diff --git a/packages/magento-cart/components/CartAddressMultiLine/CartAddressMultiLine.tsx b/packages/magento-cart/components/CartAddressMultiLine/CartAddressMultiLine.tsx index 9881469f6e6..1da8c5f18d7 100644 --- a/packages/magento-cart/components/CartAddressMultiLine/CartAddressMultiLine.tsx +++ b/packages/magento-cart/components/CartAddressMultiLine/CartAddressMultiLine.tsx @@ -1,6 +1,5 @@ import type { CountryCodeEnum } from '@graphcommerce/graphql-mesh' import { AddressMultiLine } from '@graphcommerce/magento-customer' -import React from 'react' import type { CartAddressFragment } from '../CartAddress/CartAddress.gql' export type CartAddressMultiLineProps = Partial diff --git a/packages/magento-cart/components/CartAddressSingleLine/CartAddressSingleLine.tsx b/packages/magento-cart/components/CartAddressSingleLine/CartAddressSingleLine.tsx index e4509aad2ea..d3c3c77ec3a 100644 --- a/packages/magento-cart/components/CartAddressSingleLine/CartAddressSingleLine.tsx +++ b/packages/magento-cart/components/CartAddressSingleLine/CartAddressSingleLine.tsx @@ -1,6 +1,5 @@ import type { CountryCodeEnum } from '@graphcommerce/graphql-mesh' import { AddressSingleLine } from '@graphcommerce/magento-customer' -import React from 'react' import type { CartAddressFragment } from '../CartAddress/CartAddress.gql' export type CartAddressSingleLineProps = CartAddressFragment & { locale?: CountryCodeEnum } diff --git a/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.tsx b/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.tsx index 05cfbbeaa49..142f5d4c407 100644 --- a/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.tsx +++ b/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.tsx @@ -4,7 +4,7 @@ import { Button, extendableComponent, iconChevronRight, IconSvg, sxx } from '@gr import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box, Link } from '@mui/material' -import React from 'react' +import type React from 'react' import { useCheckoutShouldLoginToContinue } from '../../hooks' import type { CartStartCheckoutFragment } from './CartStartCheckout.gql' diff --git a/packages/magento-cart/components/CartStartCheckout/CartStartCheckoutLinkOrButton.tsx b/packages/magento-cart/components/CartStartCheckout/CartStartCheckoutLinkOrButton.tsx index 7b09484a083..4d37348418f 100644 --- a/packages/magento-cart/components/CartStartCheckout/CartStartCheckoutLinkOrButton.tsx +++ b/packages/magento-cart/components/CartStartCheckout/CartStartCheckoutLinkOrButton.tsx @@ -1,8 +1,7 @@ import type { LinkOrButtonProps } from '@graphcommerce/next-ui' -import { iconChevronRight, IconSvg, LinkOrButton, sxx } from '@graphcommerce/next-ui' +import { iconChevronRight, IconSvg, LinkOrButton } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' -import type { SxProps, Theme } from '@mui/material' -import React from 'react' +import type React from 'react' import { useCheckoutShouldLoginToContinue } from '../../hooks' import type { CartStartCheckoutFragment } from './CartStartCheckout.gql' diff --git a/packages/magento-cart/components/CartSummary/CartSummary.tsx b/packages/magento-cart/components/CartSummary/CartSummary.tsx index 05de995cd48..6fe393321b6 100644 --- a/packages/magento-cart/components/CartSummary/CartSummary.tsx +++ b/packages/magento-cart/components/CartSummary/CartSummary.tsx @@ -4,7 +4,7 @@ import { breakpointVal, extendableComponent, SectionContainer, sxx } from '@grap import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box, Link, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { useCartQuery } from '../../hooks' import { CartAddressMultiLine } from '../CartAddressMultiLine/CartAddressMultiLine' import { GetCartSummaryDocument } from './GetCartSummary.gql' diff --git a/packages/magento-cart/components/EmptyCart/EmptyCart.tsx b/packages/magento-cart/components/EmptyCart/EmptyCart.tsx index 6c229e10dc3..58fb342f487 100644 --- a/packages/magento-cart/components/EmptyCart/EmptyCart.tsx +++ b/packages/magento-cart/components/EmptyCart/EmptyCart.tsx @@ -7,7 +7,7 @@ import { } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' -import React from 'react' +import type React from 'react' export type EmptyCartProps = { children?: React.ReactNode diff --git a/packages/magento-cart/components/InlineAccount/InlineAccount.tsx b/packages/magento-cart/components/InlineAccount/InlineAccount.tsx index 9582b8810d7..2d34bf38870 100644 --- a/packages/magento-cart/components/InlineAccount/InlineAccount.tsx +++ b/packages/magento-cart/components/InlineAccount/InlineAccount.tsx @@ -9,7 +9,8 @@ import { Button, extendableComponent, FormRow, sxx } from '@graphcommerce/next-u import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box, TextField, Typography } from '@mui/material' -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import { useCartQuery } from '../../hooks/useCartQuery' import { InlineAccountDocument } from './InlineAccount.gql' diff --git a/packages/magento-cart/test/fillCartAgreementsForm.ts b/packages/magento-cart/test/fillCartAgreementsForm.ts index 40c3c6588dd..0084a1dcae9 100644 --- a/packages/magento-cart/test/fillCartAgreementsForm.ts +++ b/packages/magento-cart/test/fillCartAgreementsForm.ts @@ -1,5 +1,5 @@ /* eslint-disable import/no-extraneous-dependencies */ -import type { ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql' +import type { ApolloClient } from '@graphcommerce/graphql' import type { Page } from '@playwright/test' import { CartAgreementsDocument } from '../components/CartAgreementsForm/CartAgreements.gql' diff --git a/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumbs.tsx b/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumbs.tsx index bc3d440c904..6084a081abf 100644 --- a/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumbs.tsx +++ b/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumbs.tsx @@ -1,5 +1,5 @@ import type { BreadcrumbsProps } from '@graphcommerce/next-ui' -import { Breadcrumbs, BreadcrumbsJsonLd, jsonLdBreadcrumb, sxx } from '@graphcommerce/next-ui' +import { Breadcrumbs, BreadcrumbsJsonLd, jsonLdBreadcrumb } from '@graphcommerce/next-ui' import { useRouter } from 'next/router' import type { BreadcrumbList } from 'schema-dts' import type { CategoryBreadcrumbFragment } from './CategoryBreadcrumb.gql' diff --git a/packages/magento-cms/components/CmsBlock/CmsBlock.tsx b/packages/magento-cms/components/CmsBlock/CmsBlock.tsx index ffa6e46e4b0..9cca317cb16 100644 --- a/packages/magento-cms/components/CmsBlock/CmsBlock.tsx +++ b/packages/magento-cms/components/CmsBlock/CmsBlock.tsx @@ -7,7 +7,7 @@ export type CmsBlockProps = { } export function CmsBlock(props: CmsBlockProps) { - const { cmsBlock, productListRenderer } = props + const { cmsBlock } = props if (!cmsBlock?.content) return null // eslint-disable-next-line react/no-danger return
diff --git a/packages/magento-cms/components/CmsPageContent/CmsPageContent.tsx b/packages/magento-cms/components/CmsPageContent/CmsPageContent.tsx index f88bfe61f55..7150d91dc25 100644 --- a/packages/magento-cms/components/CmsPageContent/CmsPageContent.tsx +++ b/packages/magento-cms/components/CmsPageContent/CmsPageContent.tsx @@ -8,7 +8,7 @@ export type CmsPageContentProps = { } export function CmsPageContent(props: CmsPageContentProps) { - const { cmsPage, productListRenderer } = props + const { cmsPage } = props return ( {/* eslint-disable-next-line react/no-danger */} diff --git a/packages/magento-compare/components/CompareListForm.tsx b/packages/magento-compare/components/CompareListForm.tsx index 9ebf4cffb2f..ad4085813fb 100644 --- a/packages/magento-compare/components/CompareListForm.tsx +++ b/packages/magento-compare/components/CompareListForm.tsx @@ -1,7 +1,8 @@ import type { UseFormReturn } from '@graphcommerce/ecommerce-ui' import { FormPersist, useForm, useWatch } from '@graphcommerce/ecommerce-ui' import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui' -import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react' +import type React from 'react' +import { createContext, useContext, useEffect, useMemo, useRef } from 'react' import { useCompareList } from '../hooks' export type CompareListFormProps = { children?: React.ReactNode } diff --git a/packages/magento-compare/components/CompareProductButton.tsx b/packages/magento-compare/components/CompareProductButton.tsx index f8b7d134b42..13736bacd07 100644 --- a/packages/magento-compare/components/CompareProductButton.tsx +++ b/packages/magento-compare/components/CompareProductButton.tsx @@ -1,5 +1,4 @@ import { useMutation } from '@graphcommerce/graphql' -import { sxx } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' // eslint-disable-next-line @typescript-eslint/no-restricted-imports import type { SxProps, Theme } from '@mui/material' diff --git a/packages/magento-customer/components/AccountMenu/AccountMenu.tsx b/packages/magento-customer/components/AccountMenu/AccountMenu.tsx index 20ecad8f4cf..99f9a20d31c 100644 --- a/packages/magento-customer/components/AccountMenu/AccountMenu.tsx +++ b/packages/magento-customer/components/AccountMenu/AccountMenu.tsx @@ -1,7 +1,7 @@ import { extendableComponent, sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { List } from '@mui/material' -import React from 'react' +import type React from 'react' export type AccountMenuProps = { children: React.ReactNode; sx?: SxProps } diff --git a/packages/magento-customer/components/AccountMenuItem/AccountMenuItem.tsx b/packages/magento-customer/components/AccountMenuItem/AccountMenuItem.tsx index f04de7e7610..eeaf08f233e 100644 --- a/packages/magento-customer/components/AccountMenuItem/AccountMenuItem.tsx +++ b/packages/magento-customer/components/AccountMenuItem/AccountMenuItem.tsx @@ -10,7 +10,7 @@ import { } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { ListItem, ListItemIcon, ListItemText } from '@mui/material' -import React from 'react' +import type React from 'react' export type AccountMenuItemProps = { iconSrc: ImageProps['src'] diff --git a/packages/magento-customer/components/AccountOrders/AccountOrders.tsx b/packages/magento-customer/components/AccountOrders/AccountOrders.tsx index 3aca09c49dc..e7fb560e49e 100644 --- a/packages/magento-customer/components/AccountOrders/AccountOrders.tsx +++ b/packages/magento-customer/components/AccountOrders/AccountOrders.tsx @@ -1,7 +1,7 @@ import { Pagination, sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Box, Link } from '@mui/material' -import React from 'react' +import type React from 'react' import { NoOrdersFound } from '../NoOrdersFound/NoOrdersFound' import { OrderCard } from '../Order' import type { AccountOrdersFragment } from './AccountOrders.gql' diff --git a/packages/magento-customer/components/CreditMemo/CreditMemoDetails.tsx b/packages/magento-customer/components/CreditMemo/CreditMemoDetails.tsx index f759c5add6b..0ca3194e6a2 100644 --- a/packages/magento-customer/components/CreditMemo/CreditMemoDetails.tsx +++ b/packages/magento-customer/components/CreditMemo/CreditMemoDetails.tsx @@ -1,10 +1,4 @@ -import { - breakpointVal, - DateTimeFormat, - extendableComponent, - SectionContainer, - sxx, -} from '@graphcommerce/next-ui' +import { breakpointVal, extendableComponent, SectionContainer, sxx } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box, Typography } from '@mui/material' @@ -26,7 +20,7 @@ const { classes } = extendableComponent(componentName, parts) export function CreditMemoDetails(props: CreditMemoDetailsProps) { const { creditMemo, sx = [] } = props - const { number, id } = creditMemo + const { number } = creditMemo return ( { if (Object.keys(getValues()).length > 0 && Object.keys(urlQuery).length === 0) reset() diff --git a/packages/magento-customer/components/Invoice/InvoiceDetails.tsx b/packages/magento-customer/components/Invoice/InvoiceDetails.tsx index bb7b460d547..fddf42dfc6e 100644 --- a/packages/magento-customer/components/Invoice/InvoiceDetails.tsx +++ b/packages/magento-customer/components/Invoice/InvoiceDetails.tsx @@ -1,10 +1,4 @@ -import { - breakpointVal, - DateTimeFormat, - extendableComponent, - SectionContainer, - sxx, -} from '@graphcommerce/next-ui' +import { breakpointVal, extendableComponent, SectionContainer, sxx } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box, Typography } from '@mui/material' @@ -26,7 +20,7 @@ const { classes } = extendableComponent(componentName, parts) export function InvoiceDetails(props: InvoiceDetailsProps) { const { invoice, sx = [] } = props - const { number, id } = invoice + const { number } = invoice return ( ({ + sx={() => ({ '&.orderStatePending': { color: 'text.disabled' }, '&.orderStateProcessing': { color: 'info.main' }, '&.orderStateComplete': { color: 'success.main' }, diff --git a/packages/magento-customer/components/Shipment/ShipmentCard.tsx b/packages/magento-customer/components/Shipment/ShipmentCard.tsx index a80bf05b71e..df64e9b2e9f 100644 --- a/packages/magento-customer/components/Shipment/ShipmentCard.tsx +++ b/packages/magento-customer/components/Shipment/ShipmentCard.tsx @@ -1,16 +1,7 @@ -import { Money } from '@graphcommerce/magento-store' -import { - breakpointVal, - filterNonNullableKeys, - iconChevronRight, - IconSvg, - NextLink, - sxx, -} from '@graphcommerce/next-ui' +import { breakpointVal, iconChevronRight, IconSvg, NextLink, sxx } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -import { TrackingLink } from '../TrackingLink/TrackingLink' import type { ShipmentCardFragment } from './ShipmentCard.gql' export type ShipmentCardProps = { diff --git a/packages/magento-customer/components/Shipment/ShipmentDetails.tsx b/packages/magento-customer/components/Shipment/ShipmentDetails.tsx index 06079307345..084cb8e07bc 100644 --- a/packages/magento-customer/components/Shipment/ShipmentDetails.tsx +++ b/packages/magento-customer/components/Shipment/ShipmentDetails.tsx @@ -1,6 +1,5 @@ import { breakpointVal, - DateTimeFormat, extendableComponent, filterNonNullableKeys, SectionContainer, diff --git a/packages/magento-customer/components/Shipment/ShipmentItem.tsx b/packages/magento-customer/components/Shipment/ShipmentItem.tsx index 26d51ffc7ac..1ed6fdf8b15 100644 --- a/packages/magento-customer/components/Shipment/ShipmentItem.tsx +++ b/packages/magento-customer/components/Shipment/ShipmentItem.tsx @@ -12,7 +12,7 @@ export type ShipmentItemProps = Omit { - const { currentPage, pageSize, filter, scope, sort } = args + const { currentPage, pageSize, filter, sort } = args let items = ( diff --git a/packages/magento-newsletter/components/CustomerNewsletterToggle/CustomerNewsletterToggle.tsx b/packages/magento-newsletter/components/CustomerNewsletterToggle/CustomerNewsletterToggle.tsx index e90a73f54e3..d889ebfc014 100644 --- a/packages/magento-newsletter/components/CustomerNewsletterToggle/CustomerNewsletterToggle.tsx +++ b/packages/magento-newsletter/components/CustomerNewsletterToggle/CustomerNewsletterToggle.tsx @@ -10,7 +10,7 @@ import { FormHelperText, // eslint-disable-next-line @typescript-eslint/no-restricted-imports Switch, } from '@mui/material' -import React from 'react' +import type React from 'react' import { GetCustomerNewsletterToggleDocument } from './GetCustomerNewsLetterToggle.gql' import { UpdateNewsletterSubscriptionDocument } from './UpdateNewsletterSubscription.gql' diff --git a/packages/magento-newsletter/components/GuestNewsletterToggle/GuestNewsletterToggle.tsx b/packages/magento-newsletter/components/GuestNewsletterToggle/GuestNewsletterToggle.tsx index fbe9143cbf9..228c16ed767 100644 --- a/packages/magento-newsletter/components/GuestNewsletterToggle/GuestNewsletterToggle.tsx +++ b/packages/magento-newsletter/components/GuestNewsletterToggle/GuestNewsletterToggle.tsx @@ -9,7 +9,7 @@ import { FormHelperText, // eslint-disable-next-line @typescript-eslint/no-restricted-imports Switch, } from '@mui/material' -import React from 'react' +import type React from 'react' import { GetCartEmailDocument } from '../SignupNewsletter/GetCartEmail.gql' import type { GuestNewsletterToggleMutation, diff --git a/packages/magento-payment-adyen/components/AdyenPaymentOptionsAndPlaceOrder/AdyenPaymentOptionsAndPlaceOrder.tsx b/packages/magento-payment-adyen/components/AdyenPaymentOptionsAndPlaceOrder/AdyenPaymentOptionsAndPlaceOrder.tsx index 92348d72f9d..8f76bc775c9 100644 --- a/packages/magento-payment-adyen/components/AdyenPaymentOptionsAndPlaceOrder/AdyenPaymentOptionsAndPlaceOrder.tsx +++ b/packages/magento-payment-adyen/components/AdyenPaymentOptionsAndPlaceOrder/AdyenPaymentOptionsAndPlaceOrder.tsx @@ -63,7 +63,7 @@ export function HppOptions(props: PaymentOptionsProps) { }, }) - const { handleSubmit, control, formState, required } = form + const { handleSubmit, control, formState } = form const submit = handleSubmit(() => {}) diff --git a/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts b/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts index 72764696cec..9f941f04603 100644 --- a/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts +++ b/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts @@ -55,7 +55,7 @@ export function parsePaymentResponse( if (action) { try { response.action = JSON.parse(action) - } catch (e) { + } catch { if (process.env.NODE_ENV !== 'production') { throw Error('Could not parse AdyenPaymentStatusResult.action as JSON') } @@ -69,7 +69,7 @@ export function parsePaymentResponse( if (additionalData) { try { response.additionalData = JSON.parse(additionalData) - } catch (e) { + } catch { if (process.env.NODE_ENV !== 'production') { throw Error('Could not parse AdyenPaymentStatusResult.additionalData as JSON') } diff --git a/packages/magento-payment-braintree/plugins/AddBraintreeMethods.tsx b/packages/magento-payment-braintree/plugins/AddBraintreeMethods.tsx index 0e9a9dae291..8ece158ca34 100644 --- a/packages/magento-payment-braintree/plugins/AddBraintreeMethods.tsx +++ b/packages/magento-payment-braintree/plugins/AddBraintreeMethods.tsx @@ -2,7 +2,6 @@ import type { PaymentMethodContextProviderProps } from '@graphcommerce/magento-c import type { PluginConfig, PluginProps } from '@graphcommerce/next-config' import { braintree } from '../methods/braintree' import { braintree_local_payment } from '../methods/braintree_local_payments' -import { braintree_paypal } from '../methods/braintree_paypal' export const config: PluginConfig = { type: 'component', diff --git a/packages/magento-payment-paypal/components/PayPalPaymentHandler/PayPalPaymentHandler.tsx b/packages/magento-payment-paypal/components/PayPalPaymentHandler/PayPalPaymentHandler.tsx index 6618ed085a4..0edfcd06b07 100644 --- a/packages/magento-payment-paypal/components/PayPalPaymentHandler/PayPalPaymentHandler.tsx +++ b/packages/magento-payment-paypal/components/PayPalPaymentHandler/PayPalPaymentHandler.tsx @@ -53,7 +53,7 @@ export function PayPalPaymentHandler(props: PaymentHandlerProps) { // eslint-disable-next-line @typescript-eslint/no-floating-promises onSuccess(orderNumber) } - } catch (e) { + } catch { await unlock({ token: null, PayerID: null }) } } diff --git a/packages/magento-payment-tokens/components/CustomerTokensPage/CustomerTokensPage.tsx b/packages/magento-payment-tokens/components/CustomerTokensPage/CustomerTokensPage.tsx index 1c420d108f4..6796a65e8f2 100644 --- a/packages/magento-payment-tokens/components/CustomerTokensPage/CustomerTokensPage.tsx +++ b/packages/magento-payment-tokens/components/CustomerTokensPage/CustomerTokensPage.tsx @@ -11,13 +11,11 @@ import { iconCreditCard, LayoutOverlayHeader, LayoutTitle, - sxx, type GetStaticProps, } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' import { Alert, Box, Container, Typography } from '@mui/material' -import type { PaymentTokenFragment } from '../../graphql/fragments/PaymentToken.gql' import { CustomerPaymentTokensDocument } from '../../graphql/queries/PaymentTokens.gql' import { DeletePaymentTokenButton } from '../DeletePaymentTokenButton' diff --git a/packages/magento-product-bundle/components/BundleProductOptions/BundleOptionValue.tsx b/packages/magento-product-bundle/components/BundleProductOptions/BundleOptionValue.tsx index 40fed30062c..26edb1ed1a1 100644 --- a/packages/magento-product-bundle/components/BundleProductOptions/BundleOptionValue.tsx +++ b/packages/magento-product-bundle/components/BundleProductOptions/BundleOptionValue.tsx @@ -16,18 +16,7 @@ const swatchSizes = { } export function BundleOptionValue(props: ActionCardItemRenderProps) { - const { - selected, - item, - option, - product, - index, - size = 'large', - color, - price, - onReset, - ...rest - } = props + const { selected, item, option, product, index, size = 'large', color } = props const { control } = useFormAddProductsToCart() const thumbnail = option.product?.thumbnail?.url diff --git a/packages/magento-product-configurable/components/ConfigurableOptionValueImage/ConfigurableOptionValueImage.tsx b/packages/magento-product-configurable/components/ConfigurableOptionValueImage/ConfigurableOptionValueImage.tsx index ca25fdb9076..769ccfbd60b 100644 --- a/packages/magento-product-configurable/components/ConfigurableOptionValueImage/ConfigurableOptionValueImage.tsx +++ b/packages/magento-product-configurable/components/ConfigurableOptionValueImage/ConfigurableOptionValueImage.tsx @@ -1,8 +1,6 @@ import type { ActionCardItemRenderProps } from '@graphcommerce/ecommerce-ui' import { Image } from '@graphcommerce/image' import { ActionCard, responsiveVal } from '@graphcommerce/next-ui' -import { Trans } from '@lingui/react/macro' -import { Button } from '@mui/material' import type { ConfigurableOptionValueImageFragment } from './ConfigurableOptionValueImage.gql' export type ConfigurableOptionValueImageProps = diff --git a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx index 08fdc0ccb58..e81ceaaebab 100644 --- a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx +++ b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx @@ -2,7 +2,7 @@ import type { ActionCardItemBase } from '@graphcommerce/ecommerce-ui' import { ActionCardListForm } from '@graphcommerce/ecommerce-ui' import type { AddProductsToCartFields } from '@graphcommerce/magento-product/components' import { useFormAddProductsToCart } from '@graphcommerce/magento-product/components' -import { filterNonNullableKeys, nonNullable, SectionHeader, sxx } from '@graphcommerce/next-ui' +import { filterNonNullableKeys, nonNullable, SectionHeader } from '@graphcommerce/next-ui' import { useWatch } from '@graphcommerce/react-hook-form' import { t } from '@lingui/core/macro' import type { SxProps, Theme } from '@mui/material' diff --git a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx index a107b44dc28..9f4a1cdc32e 100644 --- a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx +++ b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx @@ -6,7 +6,8 @@ import { filterNonNullableKeys, useLocale } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -import React, { useEffect, useMemo } from 'react' +import type React from 'react' +import { useEffect, useMemo } from 'react' import type { ConfigurableOptionsFragment } from '../../graphql' import { useConfigurableOptionsSelection } from '../../hooks' import { ConfigurableOptionValue } from '../ConfigurableOptionValue/ConfigurableOptionValue' diff --git a/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd.tsx b/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd.tsx index 1ecc7d2174a..d62da7493e5 100644 --- a/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd.tsx +++ b/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd.tsx @@ -4,7 +4,6 @@ import type { ProductPageJsonLdProps, } from '@graphcommerce/magento-product' import type { PluginConfig, PluginProps } from '@graphcommerce/next-config' -import { isTypename } from '@graphcommerce/next-ui' import { useConfigurableSelectedVariant } from '../../hooks' export const config: PluginConfig = { diff --git a/packages/magento-product-configurable/utils/defaultConfigurableOptionsSelection.ts b/packages/magento-product-configurable/utils/defaultConfigurableOptionsSelection.ts index e0fee48ded2..95fb0a0b6b1 100644 --- a/packages/magento-product-configurable/utils/defaultConfigurableOptionsSelection.ts +++ b/packages/magento-product-configurable/utils/defaultConfigurableOptionsSelection.ts @@ -1,7 +1,7 @@ import type { ApolloClient } from '@graphcommerce/graphql' import type { AddProductsToCartFormProps } from '@graphcommerce/magento-product' import { configurableVariantForSimple } from '@graphcommerce/next-config/config' -import { filterNonNullableKeys, findByTypename, nonNullable } from '@graphcommerce/next-ui' +import { findByTypename, nonNullable } from '@graphcommerce/next-ui' import { GetConfigurableOptionsSelectionDocument } from '../graphql' import type { DefaultConfigurableOptionsSelectionFragment } from './DefaultConfigurableOptionsSelection.gql' diff --git a/packages/magento-product-downloadable/components/DownloadsPage/DownloadsPage.tsx b/packages/magento-product-downloadable/components/DownloadsPage/DownloadsPage.tsx index 2b0ea66c3ce..1f086e516a2 100644 --- a/packages/magento-product-downloadable/components/DownloadsPage/DownloadsPage.tsx +++ b/packages/magento-product-downloadable/components/DownloadsPage/DownloadsPage.tsx @@ -2,7 +2,6 @@ import type { ApolloClient } from '@graphcommerce/graphql' import { getCustomerAccountIsDisabled, useCustomerQuery, - useCustomerSession, WaitForCustomer, } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' @@ -31,8 +30,6 @@ export function DownloadsPage() { const downloads = filterNonNullableKeys(dashboard.data?.customerDownloadableProducts?.items) - const session = useCustomerSession() - return ( <> diff --git a/packages/magento-product-grouped/GroupedProducts/GroupedProductActionCard.tsx b/packages/magento-product-grouped/GroupedProducts/GroupedProductActionCard.tsx index ad8236fdcaf..80b46777bf3 100644 --- a/packages/magento-product-grouped/GroupedProducts/GroupedProductActionCard.tsx +++ b/packages/magento-product-grouped/GroupedProducts/GroupedProductActionCard.tsx @@ -24,7 +24,7 @@ const typographySizes = { export function GroupedProductActionCard(props: GroupedProductActionCardProps) { const { item, sx = [], size = 'large', index = 0, ...rest } = props const { product } = item - const { control, register } = useFormAddProductsToCart() + const { register } = useFormAddProductsToCart() if (!product?.sku) return null diff --git a/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx b/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx index e4fff3d4f9b..fd97cfe0baa 100644 --- a/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx +++ b/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx @@ -1,5 +1,4 @@ -import { ActionCardLayout, filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui' -import { useMemo } from 'react' +import { ActionCardLayout, filterNonNullableKeys } from '@graphcommerce/next-ui' import type { GroupedProductFragment } from '../graphql/fragments/GroupedProduct.gql' import { GroupedProductActionCard } from './GroupedProductActionCard' diff --git a/packages/magento-product-virtual/ProductListItemVirtual.tsx b/packages/magento-product-virtual/ProductListItemVirtual.tsx index 32760f6e525..c010c3878db 100644 --- a/packages/magento-product-virtual/ProductListItemVirtual.tsx +++ b/packages/magento-product-virtual/ProductListItemVirtual.tsx @@ -1,6 +1,5 @@ import type { ProductListItemProps } from '@graphcommerce/magento-product' import { ProductListItem } from '@graphcommerce/magento-product' -import React from 'react' import type { ProductListItemVirtualFragment } from './ProductListItemVirtual.gql' export type ProductListItemVirtualProps = ProductListItemVirtualFragment & ProductListItemProps diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx index 1753837c106..dbed6d6a315 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx @@ -1,11 +1,10 @@ -import { TextFieldElement, useWatch } from '@graphcommerce/ecommerce-ui' +import { TextFieldElement } from '@graphcommerce/ecommerce-ui' import type { CurrencyEnum } from '@graphcommerce/graphql-mesh' -import { Money } from '@graphcommerce/magento-store' import type { TypeRenderer } from '@graphcommerce/next-ui' import { SectionHeader } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { useFormAddProductsToCart } from '../AddProductsToCart' import { CustomizablePrice } from './CustomizablePrice' import type { ProductCustomizableFragment } from './ProductCustomizable.gql' diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx index 175c11bd5b0..4626778ff81 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx @@ -1,5 +1,4 @@ -import { TextFieldElement, useWatch } from '@graphcommerce/ecommerce-ui' -import { Money } from '@graphcommerce/magento-store' +import { TextFieldElement } from '@graphcommerce/ecommerce-ui' import { SectionHeader } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import { Box } from '@mui/material' diff --git a/packages/magento-product/components/ProductCustomizable/CustomizablePrice.tsx b/packages/magento-product/components/ProductCustomizable/CustomizablePrice.tsx index 700a7ee7ce7..53afbad4e4c 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizablePrice.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizablePrice.tsx @@ -1,5 +1,5 @@ -import type { Control, FieldName, FieldPath } from '@graphcommerce/ecommerce-ui' -import { useWatch, type FieldValues } from '@graphcommerce/ecommerce-ui' +import type { FieldPath } from '@graphcommerce/ecommerce-ui' +import { useWatch } from '@graphcommerce/ecommerce-ui' import type { PriceTypeEnum } from '@graphcommerce/graphql-mesh' import { Money, type MoneyFragment } from '@graphcommerce/magento-store' import { sxx } from '@graphcommerce/next-ui' diff --git a/packages/magento-product/components/ProductFiltersPro/ProductFiltersPro.tsx b/packages/magento-product/components/ProductFiltersPro/ProductFiltersPro.tsx index 0ab17945df2..875cbc68d5c 100644 --- a/packages/magento-product/components/ProductFiltersPro/ProductFiltersPro.tsx +++ b/packages/magento-product/components/ProductFiltersPro/ProductFiltersPro.tsx @@ -12,7 +12,8 @@ import { useEventCallback, useMediaQuery, useTheme } from '@mui/material' import { m, useTransform } from 'motion/react' import { useRouter } from 'next/router' import type { BaseSyntheticEvent, MutableRefObject } from 'react' -import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react' +import type React from 'react' +import { createContext, useContext, useEffect, useMemo, useRef } from 'react' import { productListLinkFromFilter } from '../../hooks/useProductListLink' import type { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql' import type { ProductFilterParams, ProductListParams } from '../ProductListItems/filterTypes' diff --git a/packages/magento-product/components/ProductFiltersPro/ProductFiltersProLayoutSidebar.tsx b/packages/magento-product/components/ProductFiltersPro/ProductFiltersProLayoutSidebar.tsx index c9343688028..47edc557111 100644 --- a/packages/magento-product/components/ProductFiltersPro/ProductFiltersProLayoutSidebar.tsx +++ b/packages/magento-product/components/ProductFiltersPro/ProductFiltersProLayoutSidebar.tsx @@ -3,7 +3,7 @@ import { extendableComponent, StickyBelowHeader } from '@graphcommerce/next-ui' import type { Theme } from '@mui/material' // eslint-disable-next-line @typescript-eslint/no-restricted-imports import { Box, Container, useMediaQuery } from '@mui/material' -import React from 'react' +import type React from 'react' import { useProductFiltersPro } from './ProductFiltersPro' export type ProductFiltersProLayoutSidebarProps = { diff --git a/packages/magento-product/components/ProductListFiltersContainer/ProductListFiltersContainer.tsx b/packages/magento-product/components/ProductListFiltersContainer/ProductListFiltersContainer.tsx index 194f9d85ee4..bb05c02a5f7 100644 --- a/packages/magento-product/components/ProductListFiltersContainer/ProductListFiltersContainer.tsx +++ b/packages/magento-product/components/ProductListFiltersContainer/ProductListFiltersContainer.tsx @@ -10,7 +10,8 @@ import { import type { SxProps, Theme } from '@mui/material' import { Box, styled } from '@mui/material' import { m, useTransform } from 'motion/react' -import React, { useEffect, useRef, useState } from 'react' +import type React from 'react' +import { useEffect, useRef, useState } from 'react' const MotionDiv = styled(m.div)({}) diff --git a/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx b/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx index 30ccf171965..241ab84674f 100644 --- a/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx +++ b/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx @@ -1,5 +1,5 @@ import { breakpointVal, NextLink, sxx } from '@graphcommerce/next-ui' -import type { BoxProps, ButtonBaseProps, SxProps, Theme } from '@mui/material' +import type { BoxProps, ButtonBaseProps } from '@mui/material' import { Box, ButtonBase } from '@mui/material' import React from 'react' diff --git a/packages/magento-product/components/ProductListItem/ProductListItemParts.tsx b/packages/magento-product/components/ProductListItem/ProductListItemParts.tsx index bbca11aa35f..c0bd540daf2 100644 --- a/packages/magento-product/components/ProductListItem/ProductListItemParts.tsx +++ b/packages/magento-product/components/ProductListItem/ProductListItemParts.tsx @@ -2,7 +2,7 @@ import type { ImageProps } from '@graphcommerce/image' import { extendableComponent, sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Skeleton } from '@mui/material' -import React from 'react' +import type React from 'react' import type { ProductListItemFragment } from '../../graphql' import { productLink } from '../../hooks/useProductLink' import { ProductListPrice } from '../ProductListPrice/ProductListPrice' diff --git a/packages/magento-product/components/ProductPageDescription/ProductPageDescription.tsx b/packages/magento-product/components/ProductPageDescription/ProductPageDescription.tsx index aab9178408b..d388ff29ef5 100644 --- a/packages/magento-product/components/ProductPageDescription/ProductPageDescription.tsx +++ b/packages/magento-product/components/ProductPageDescription/ProductPageDescription.tsx @@ -26,14 +26,7 @@ const parts = ['root', 'description'] as const const { classes } = extendableComponent(componentName, parts) export function ProductPageDescription(props: ProductPageDescriptionProps) { - const { - product, - right, - fontSize = 'subtitle1', - maxWidth = 'lg', - sx = [], - productListRenderer, - } = props + const { product, right, fontSize = 'subtitle1', maxWidth = 'lg', sx = [] } = props return ( diff --git a/packages/magento-product/components/ProductPageGallery/ProductPageGallery.tsx b/packages/magento-product/components/ProductPageGallery/ProductPageGallery.tsx index e3d4cc4e733..7420bd34015 100644 --- a/packages/magento-product/components/ProductPageGallery/ProductPageGallery.tsx +++ b/packages/magento-product/components/ProductPageGallery/ProductPageGallery.tsx @@ -1,6 +1,6 @@ import type { MotionImageAspectProps } from '@graphcommerce/framer-scroller' import type { SidebarGalleryProps, TypeRenderer } from '@graphcommerce/next-ui' -import { filterNonNullableKeys, nonNullable, SidebarGallery } from '@graphcommerce/next-ui' +import { filterNonNullableKeys, SidebarGallery } from '@graphcommerce/next-ui' import type { ProductPageGalleryFragment } from './ProductPageGallery.gql' import { ProductVideo, type ProductVideoProps } from './ProductVideo' diff --git a/packages/magento-product/components/ProductPageGallery/ProductVideo.tsx b/packages/magento-product/components/ProductPageGallery/ProductVideo.tsx index ba29b399316..3103469e7b5 100644 --- a/packages/magento-product/components/ProductPageGallery/ProductVideo.tsx +++ b/packages/magento-product/components/ProductPageGallery/ProductVideo.tsx @@ -1,8 +1,9 @@ import type { MotionImageAspectPropsAdditional } from '@graphcommerce/framer-scroller' -import { Fab, iconPlay, IconSvg, sxx, YoutubeEmbed, type FabProps } from '@graphcommerce/next-ui' -import { Avatar, Box, IconButton, styled, type SxProps, type Theme } from '@mui/material' -import { m, type MotionProps, type MotionStyle } from 'motion/react' -import React, { useState } from 'react' +import { Fab, iconPlay, sxx, YoutubeEmbed, type FabProps } from '@graphcommerce/next-ui' +import { Box, styled, type SxProps, type Theme } from '@mui/material' +import { m } from 'motion/react' +import type React from 'react' +import { useState } from 'react' import type { ProductVideoFragment } from './ProductVideo.gql' const youtubeRegExp = new RegExp( @@ -96,7 +97,7 @@ function extractYoutubeId(src: string): string | null { } export function ProductVideo(props: ProductVideoProps) { - const { video, autoplay, iframeProps, videoProps, sx, style, layout, width, height } = props + const { video, autoplay, iframeProps, videoProps, sx, style, width, height } = props const [play, setPlay] = useState(autoplay) @@ -134,7 +135,7 @@ export function ProductVideo(props: ProductVideoProps) { ) } - const baseSx: SxProps = (theme) => ({ + const baseSx: SxProps = () => ({ display: 'block', maxWidth: '99.6%', maxHeight: '100%', diff --git a/packages/magento-product/components/ProductPagePrice/ProductPagePriceLowest.tsx b/packages/magento-product/components/ProductPagePrice/ProductPagePriceLowest.tsx index bf8bd2eedfa..e1cb46e1634 100644 --- a/packages/magento-product/components/ProductPagePrice/ProductPagePriceLowest.tsx +++ b/packages/magento-product/components/ProductPagePrice/ProductPagePriceLowest.tsx @@ -13,7 +13,7 @@ export type ProductPagePriceLowestProps = { UseCustomizableOptionPriceProps export function ProductPagePriceLowest(props: ProductPagePriceLowestProps) { - const { product, sx, index = 0 } = props + const { product, sx } = props const priceTiers = filterNonNullableKeys(product.price_tiers, ['quantity', 'final_price']) const lastTier = priceTiers[priceTiers.length - 1] diff --git a/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx b/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx index 14d4408a375..9ea8fb6311e 100644 --- a/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx +++ b/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx @@ -15,7 +15,6 @@ import { useFormGqlMutation } from '@graphcommerce/react-hook-form' import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Alert, Box, Button, Typography } from '@mui/material' -import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import { CreateProductReviewDocument } from './CreateProductReview.gql' import { ProductReviewRatingsMetadataDocument } from './ProductReviewRatingsMetadata.gql' @@ -40,7 +39,6 @@ const { classes } = extendableComponent(name, parts) export function CreateProductReviewForm(props: CreateProductReviewFormProps) { const { sku, nickname, sx = [] } = props - const router = useRouter() const [ratings, setRatings] = useState([]) const { data, loading } = useQuery(ProductReviewRatingsMetadataDocument) diff --git a/packages/magento-review/components/ProductReviewChip/ProductReviewChip.tsx b/packages/magento-review/components/ProductReviewChip/ProductReviewChip.tsx index dc5a3c4bae0..3fd3368b259 100644 --- a/packages/magento-review/components/ProductReviewChip/ProductReviewChip.tsx +++ b/packages/magento-review/components/ProductReviewChip/ProductReviewChip.tsx @@ -2,7 +2,7 @@ import { iconStar, IconSvg } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import type { ChipProps } from '@mui/material' import { Chip } from '@mui/material' -import React from 'react' +import type React from 'react' export type ProductReviewChipProps = { rating?: number diff --git a/packages/magento-review/components/ProductReviews/ProductReviews.tsx b/packages/magento-review/components/ProductReviews/ProductReviews.tsx index 35e3171c05a..99498a44192 100644 --- a/packages/magento-review/components/ProductReviews/ProductReviews.tsx +++ b/packages/magento-review/components/ProductReviews/ProductReviews.tsx @@ -11,7 +11,8 @@ import { Trans } from '@lingui/react/macro' import type { SxProps, Theme } from '@mui/material' import { Box, Button, Link, Typography } from '@mui/material' import { useRouter } from 'next/router' -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import { ProductReviewChip } from '../ProductReviewChip/ProductReviewChip' import type { ProductReviewsFragment } from './ProductReviews.gql' import { ProductReviewsPageDocument } from './ProductReviewsPage.gql' diff --git a/packages/magento-search-overlay/components/SearchOverlayInput.tsx b/packages/magento-search-overlay/components/SearchOverlayInput.tsx index ebcfc6c2406..d43f8c4487c 100644 --- a/packages/magento-search-overlay/components/SearchOverlayInput.tsx +++ b/packages/magento-search-overlay/components/SearchOverlayInput.tsx @@ -79,7 +79,7 @@ export const SearchInput = React.forwardRef( spellCheck='false' autoComplete='off' sx={sxx( - (theme) => ({ + () => ({ '& .MuiInputBase-input': { ...inputSx }, }), selected && diff --git a/packages/magento-search-overlay/components/SearchOverlayProvider.tsx b/packages/magento-search-overlay/components/SearchOverlayProvider.tsx index 5289ae4db49..6d10d9273d1 100644 --- a/packages/magento-search-overlay/components/SearchOverlayProvider.tsx +++ b/packages/magento-search-overlay/components/SearchOverlayProvider.tsx @@ -4,7 +4,8 @@ import { useForkRef } from '@mui/material' import { motionValue } from 'motion/react' import { useRouter } from 'next/router' import type { ReactNode } from 'react' -import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react' +import type React from 'react' +import { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react' import { useQuicksearch } from '../hooks/useQuicksearch' export const searchOverlayIsOpen = motionValue(false) diff --git a/packages/magento-search/utils/categoriesApplySearchDefaults.ts b/packages/magento-search/utils/categoriesApplySearchDefaults.ts index 6082ffe1734..83d0ef9182c 100644 --- a/packages/magento-search/utils/categoriesApplySearchDefaults.ts +++ b/packages/magento-search/utils/categoriesApplySearchDefaults.ts @@ -7,7 +7,7 @@ export type CategoriesApplySearchVariablesProps = { export function categoriesApplySearchDefaults( props: CategoriesApplySearchVariablesProps, - conf: StoreConfigQuery, + _conf: StoreConfigQuery, ): CategorySearchQueryVariables { const { search } = props return { filters: { name: { match: search } }, pageSize: 5 } diff --git a/packages/magento-store/components/AttributeForm/AttributeFormField.tsx b/packages/magento-store/components/AttributeForm/AttributeFormField.tsx index aea46240041..8ac2bdbc0e4 100644 --- a/packages/magento-store/components/AttributeForm/AttributeFormField.tsx +++ b/packages/magento-store/components/AttributeForm/AttributeFormField.tsx @@ -15,7 +15,7 @@ export function AttributeFormField< TFieldValues extends FieldValues = FieldValues, Typename extends CustomAttributeMetadataTypename = CustomAttributeMetadataTypename, >(props: AttributeFormFieldProps) { - const { metadata, control, sx } = props + const { metadata } = props if (process.env.NODE_ENV === 'production') return null diff --git a/packages/magento-store/components/GlobalHead/GlobalHead.tsx b/packages/magento-store/components/GlobalHead/GlobalHead.tsx index ec3639b6e9e..1708d5397d7 100644 --- a/packages/magento-store/components/GlobalHead/GlobalHead.tsx +++ b/packages/magento-store/components/GlobalHead/GlobalHead.tsx @@ -9,7 +9,6 @@ import { StoreConfigDocument } from '../../graphql' export type GlobalHeadProps = Omit export const GlobalHead = React.memo((props) => { - const { children } = props const name = useQuery(StoreConfigDocument).data?.storeConfig?.website_name ?? '' const { head_shortcut_icon, secure_base_media_url } = diff --git a/packages/magento-store/components/Money/Money.tsx b/packages/magento-store/components/Money/Money.tsx index b4e2afc13d5..b0551635c14 100644 --- a/packages/magento-store/components/Money/Money.tsx +++ b/packages/magento-store/components/Money/Money.tsx @@ -1,4 +1,3 @@ -import { format } from 'path' import { useQuery } from '@graphcommerce/graphql' import type { CurrencyFormatProps } from '@graphcommerce/next-ui' import { CurrencyFormat, NumberFormat } from '@graphcommerce/next-ui' diff --git a/packages/magento-store/components/StoreSwitcher/StoreSwitcherCurrencySelector.tsx b/packages/magento-store/components/StoreSwitcher/StoreSwitcherCurrencySelector.tsx index 48f829575b9..7c95e7a16b2 100644 --- a/packages/magento-store/components/StoreSwitcher/StoreSwitcherCurrencySelector.tsx +++ b/packages/magento-store/components/StoreSwitcher/StoreSwitcherCurrencySelector.tsx @@ -1,6 +1,5 @@ import type { ActionCardListFormProps } from '@graphcommerce/ecommerce-ui' -import { ActionCardListForm, useWatch } from '@graphcommerce/ecommerce-ui' -import { useIsomorphicLayoutEffect } from '@graphcommerce/framer-utils' +import { ActionCardListForm } from '@graphcommerce/ecommerce-ui' import type { ActionCardProps } from '@graphcommerce/next-ui' import { ActionCard, CurrencySymbol, nonNullable, sxx } from '@graphcommerce/next-ui' import type { StoreSwitcherFormValues } from './useStoreSwitcher' diff --git a/packages/magento-store/components/StoreSwitcher/useStoreSwitcher.tsx b/packages/magento-store/components/StoreSwitcher/useStoreSwitcher.tsx index 58ce1b27d49..e5a4455f12c 100644 --- a/packages/magento-store/components/StoreSwitcher/useStoreSwitcher.tsx +++ b/packages/magento-store/components/StoreSwitcher/useStoreSwitcher.tsx @@ -9,7 +9,6 @@ import { cookie, filterNonNullableKeys, storefrontAll, - useCookie, useStorefrontConfig, type RequiredKeys, } from '@graphcommerce/next-ui' diff --git a/packages/magento-store/components/StoreSwitcherButton/StoreSwitcherMenuFabSecondaryItem.tsx b/packages/magento-store/components/StoreSwitcherButton/StoreSwitcherMenuFabSecondaryItem.tsx index f2b28c556f3..695c84279ad 100644 --- a/packages/magento-store/components/StoreSwitcherButton/StoreSwitcherMenuFabSecondaryItem.tsx +++ b/packages/magento-store/components/StoreSwitcherButton/StoreSwitcherMenuFabSecondaryItem.tsx @@ -18,7 +18,7 @@ export type StoreSwitcherMenuFabSecondaryItemProps = Omit< export function StoreSwitcherMenuFabSecondaryItem(props: StoreSwitcherMenuFabSecondaryItemProps) { const { sx, textProps, ...rest } = props - const { show, onClick } = useShowStoreSwitcherButton() + const { show } = useShowStoreSwitcherButton() if (!show) return null return ( diff --git a/packages/magento-store/components/StoreSwitcherButton/useStoreSwitcherButton.ts b/packages/magento-store/components/StoreSwitcherButton/useStoreSwitcherButton.ts index ca84190f103..d2e68c4ffce 100644 --- a/packages/magento-store/components/StoreSwitcherButton/useStoreSwitcherButton.ts +++ b/packages/magento-store/components/StoreSwitcherButton/useStoreSwitcherButton.ts @@ -3,7 +3,7 @@ import { useCookie } from '@graphcommerce/next-ui' import { useRouter } from 'next/router' import { StoreConfigDocument } from '../../graphql' -export function useShowStoreSwitcherButton(options?: Record) { +export function useShowStoreSwitcherButton(_options?: Record) { const config = useQuery(StoreConfigDocument) const country = config.data?.storeConfig?.locale?.split('_')?.[1]?.toLowerCase() ?? '' const router = useRouter() diff --git a/packages/magento-store/test/apolloClientStore.fixture.ts b/packages/magento-store/test/apolloClientStore.fixture.ts index d0e630618dc..46e5a51a9bc 100644 --- a/packages/magento-store/test/apolloClientStore.fixture.ts +++ b/packages/magento-store/test/apolloClientStore.fixture.ts @@ -1,7 +1,6 @@ /* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable no-empty-pattern */ -import type { NormalizedCacheObject } from '@graphcommerce/graphql' import { ApolloClient, InMemoryCache } from '@graphcommerce/graphql' import { test as base } from '@playwright/test' import { localeToStore } from '../utils/localeToStore' diff --git a/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx b/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx index d579cd869de..63fee06481a 100644 --- a/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx +++ b/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx @@ -2,7 +2,7 @@ import { DesktopHeaderBadge, extendableComponent, iconHeart, IconSvg } from '@gr import { t } from '@lingui/core/macro' import type { BadgeProps, FabProps as FabPropsType, SxProps, Theme } from '@mui/material' import { Fab } from '@mui/material' -import React from 'react' +import type React from 'react' import { useWishlistEnabled, useWishlistItems } from '../../hooks' export type WishlistFabContentProps = { diff --git a/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx b/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx index 29a72e9967b..fead2161090 100644 --- a/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx +++ b/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx @@ -2,7 +2,7 @@ import { iconHeart, IconSvg, MenuFabSecondaryItem } from '@graphcommerce/next-ui import type { SxProps, Theme } from '@mui/material' import { Badge } from '@mui/material' import type { MouseEventHandler } from 'react' -import React from 'react' +import type React from 'react' import { useWishlistItems } from '../../hooks' export type WishlistMenuFabItemContentProps = { diff --git a/packages/magento-wishlist/hooks/useRemoveProductsFromWishlist/useRemoveProductsFromWishlist.tsx b/packages/magento-wishlist/hooks/useRemoveProductsFromWishlist/useRemoveProductsFromWishlist.tsx index dd3a2ffc8c7..2c1bcadef4b 100644 --- a/packages/magento-wishlist/hooks/useRemoveProductsFromWishlist/useRemoveProductsFromWishlist.tsx +++ b/packages/magento-wishlist/hooks/useRemoveProductsFromWishlist/useRemoveProductsFromWishlist.tsx @@ -1,6 +1,6 @@ import { useApolloClient } from '@graphcommerce/graphql' import { useCustomerSession } from '@graphcommerce/magento-customer' -import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui' +import { nonNullable } from '@graphcommerce/next-ui' import { useEventCallback } from '@mui/material' import { UseWishlistCustomerDocument, UseWishlistGuestDocument } from '../useWishlistitems' import type { UseRemoveProductsFromWishlistMutationVariables } from './UseRemoveProductsFromWishlist.gql' diff --git a/packages/next-ui/Blog/BlogAuthor/BlogAuthor.tsx b/packages/next-ui/Blog/BlogAuthor/BlogAuthor.tsx index e162a1f4fc2..7888289067f 100644 --- a/packages/next-ui/Blog/BlogAuthor/BlogAuthor.tsx +++ b/packages/next-ui/Blog/BlogAuthor/BlogAuthor.tsx @@ -11,7 +11,7 @@ export type BlogAuthorProps = { } export function BlogAuthor(props: BlogAuthorProps) { - const { author, date, sx = [] } = props + const { author, date } = props return ( , 'sx' | 'children'> diff --git a/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx b/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx index 55607743979..f377a8faf53 100644 --- a/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx +++ b/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx @@ -1,5 +1,5 @@ import { Trans } from '@lingui/react/macro' -import { Box, Link, useTheme } from '@mui/material' +import { Box, Link } from '@mui/material' import type { KeyboardEvent } from 'react' import { useEffect, useRef } from 'react' import type { BreadcrumbsType } from './types' @@ -15,7 +15,6 @@ export type PopperBreadcrumbsListProps = { export function BreadcrumbsList(props: PopperBreadcrumbsListProps) { const { autoFocus, breadcrumbs, showDesktopAmount = 4, showMobileAmount = 3, onClose } = props const listRef = useRef(null) - const theme = useTheme() const handleKeyDown = (event: KeyboardEvent) => { if (event.key === 'Escape') { diff --git a/packages/next-ui/ChipMenu/ChipMenu.tsx b/packages/next-ui/ChipMenu/ChipMenu.tsx index 1dfb9ba3e58..cf3a03180b6 100644 --- a/packages/next-ui/ChipMenu/ChipMenu.tsx +++ b/packages/next-ui/ChipMenu/ChipMenu.tsx @@ -1,7 +1,8 @@ import { sxx } from '@graphcommerce/next-ui' import type { ChipProps, MenuProps, SxProps, Theme } from '@mui/material' import { Chip, Menu, menuClasses } from '@mui/material' -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import { iconCancelAlt, iconChevronDown, iconChevronUp } from '../icons' import { IconSvg } from '../IconSvg' import { SectionHeader } from '../SectionHeader/SectionHeader' diff --git a/packages/next-ui/Container/Container.tsx b/packages/next-ui/Container/Container.tsx index 071951a9ffd..2f018100b62 100644 --- a/packages/next-ui/Container/Container.tsx +++ b/packages/next-ui/Container/Container.tsx @@ -19,10 +19,7 @@ export type ContainerSizingProps = Omit & OwnerProps const name = 'MuiContainer' const slots = ['root'] as const -const { withState } = extendableComponent( - 'MuiContainer', - slots, -) +const { withState } = extendableComponent(name, slots) /** * Calculate the padding and margin for a container. diff --git a/packages/next-ui/ContainerWithHeader/ContainerWithHeader.tsx b/packages/next-ui/ContainerWithHeader/ContainerWithHeader.tsx index 5324e3251c2..389eb821756 100644 --- a/packages/next-ui/ContainerWithHeader/ContainerWithHeader.tsx +++ b/packages/next-ui/ContainerWithHeader/ContainerWithHeader.tsx @@ -1,6 +1,6 @@ import type { SxProps, Theme } from '@mui/material' import { Box, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { Row } from '../Row/Row' import { extendableComponent } from '../Styles' diff --git a/packages/next-ui/FramerScroller/SidebarGallery.tsx b/packages/next-ui/FramerScroller/SidebarGallery.tsx index 283c03a375e..731b1cab233 100644 --- a/packages/next-ui/FramerScroller/SidebarGallery.tsx +++ b/packages/next-ui/FramerScroller/SidebarGallery.tsx @@ -16,7 +16,8 @@ import type { SxProps, Theme } from '@mui/material' import { Box, Fab, styled, Unstable_TrapFocus as TrapFocus, useTheme } from '@mui/material' import { m, useDomEvent, useMotionValue } from 'motion/react' import { useRouter } from 'next/router' -import React, { useCallback, useEffect, useRef } from 'react' +import type React from 'react' +import { useCallback, useEffect, useRef } from 'react' import { iconChevronLeft, iconChevronRight, iconFullscreen, iconFullscreenExit } from '../icons' import { IconSvg } from '../IconSvg' import { Row } from '../Row/Row' diff --git a/packages/next-ui/FullPageMessage/FullPageMessage.tsx b/packages/next-ui/FullPageMessage/FullPageMessage.tsx index b1a9cb45528..6b4941de1a9 100644 --- a/packages/next-ui/FullPageMessage/FullPageMessage.tsx +++ b/packages/next-ui/FullPageMessage/FullPageMessage.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Box, Container, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../Styles' import { responsiveVal } from '../Styles/responsiveVal' diff --git a/packages/next-ui/Layout/components/LayoutHeaderClose.tsx b/packages/next-ui/Layout/components/LayoutHeaderClose.tsx index 8ed2f750df9..2a8a59408ce 100644 --- a/packages/next-ui/Layout/components/LayoutHeaderClose.tsx +++ b/packages/next-ui/Layout/components/LayoutHeaderClose.tsx @@ -1,8 +1,7 @@ import { useGo, usePageContext } from '@graphcommerce/framer-next-pages' import { t } from '@lingui/core/macro' -import { Fab, type ButtonProps } from '@mui/material' +import { Fab } from '@mui/material' import { useState } from 'react' -import { Button } from '../../Button' import type { FabProps } from '../../Fab' import { iconClose } from '../../icons' import { IconSvg, useIconSvgSize } from '../../IconSvg' diff --git a/packages/next-ui/Layout/components/LayoutHeaderContent.tsx b/packages/next-ui/Layout/components/LayoutHeaderContent.tsx index 805717c8285..71601fdca3c 100644 --- a/packages/next-ui/Layout/components/LayoutHeaderContent.tsx +++ b/packages/next-ui/Layout/components/LayoutHeaderContent.tsx @@ -4,7 +4,8 @@ import type { SxProps, Theme } from '@mui/material' import { Box, styled } from '@mui/material' import type { MotionNodeLayoutOptions } from 'motion/react' import { m } from 'motion/react' -import React, { useRef } from 'react' +import type React from 'react' +import { useRef } from 'react' import { Container } from '../../Container/Container' import { extendableComponent } from '../../Styles' import { useScrollY } from '../hooks/useScrollY' diff --git a/packages/next-ui/LayoutParts/DesktopNavBar.tsx b/packages/next-ui/LayoutParts/DesktopNavBar.tsx index 3d8ce4b8003..70a52bd6c5a 100644 --- a/packages/next-ui/LayoutParts/DesktopNavBar.tsx +++ b/packages/next-ui/LayoutParts/DesktopNavBar.tsx @@ -1,7 +1,7 @@ import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller' import { sxx } from '@graphcommerce/next-ui' import type { BoxProps } from '@mui/material' -import React from 'react' +import type React from 'react' import { iconChevronLeft, iconChevronRight } from '../icons' import type { IconSvgProps } from '../IconSvg' import { IconSvg } from '../IconSvg' diff --git a/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx b/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx index 8d7175c5083..83c9c59dd72 100644 --- a/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx +++ b/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx @@ -1,9 +1,8 @@ -import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material' import { useRouter } from 'next/router' import type { MouseEventHandler } from 'react' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../Styles' import { NextLink } from '../Theme' diff --git a/packages/next-ui/LayoutParts/StickyBelowHeader.tsx b/packages/next-ui/LayoutParts/StickyBelowHeader.tsx index fe99e943f81..c2d432367c6 100644 --- a/packages/next-ui/LayoutParts/StickyBelowHeader.tsx +++ b/packages/next-ui/LayoutParts/StickyBelowHeader.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Container } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../Styles' export type StickyBelowHeaderProps = { diff --git a/packages/next-ui/LazyHydrate/LazyHydrate.tsx b/packages/next-ui/LazyHydrate/LazyHydrate.tsx index 432828a1693..402148d3949 100644 --- a/packages/next-ui/LazyHydrate/LazyHydrate.tsx +++ b/packages/next-ui/LazyHydrate/LazyHydrate.tsx @@ -3,7 +3,8 @@ import type { BoxProps } from '@mui/material' import { Box } from '@mui/material' import { cancelIdleCallback, requestIdleCallback } from 'next/dist/client/request-idle-callback' import type { CSSProperties } from 'react' -import React, { startTransition, useRef, useState } from 'react' +import type React from 'react' +import { startTransition, useRef, useState } from 'react' export type LazyHydrateProps = BoxProps<'div'> & { /** diff --git a/packages/next-ui/Overlay/components/OverlayBase.tsx b/packages/next-ui/Overlay/components/OverlayBase.tsx index 082cc3d4348..11c80e37c59 100644 --- a/packages/next-ui/Overlay/components/OverlayBase.tsx +++ b/packages/next-ui/Overlay/components/OverlayBase.tsx @@ -19,7 +19,8 @@ import { useMotionValueEvent, useTransform, } from 'motion/react' -import React, { useCallback, useEffect, useRef } from 'react' +import type React from 'react' +import { useCallback, useEffect, useRef } from 'react' import { useMatchMedia } from '../../hooks/useMatchMedia' import { LayoutProvider } from '../../Layout/components/LayoutProvider' import type { ExtendableComponent } from '../../Styles' diff --git a/packages/next-ui/Overlay/components/OverlayHeader.tsx b/packages/next-ui/Overlay/components/OverlayHeader.tsx index d5785771b24..2f8748d6136 100644 --- a/packages/next-ui/Overlay/components/OverlayHeader.tsx +++ b/packages/next-ui/Overlay/components/OverlayHeader.tsx @@ -1,5 +1,4 @@ import { sxx } from '@graphcommerce/next-ui' -import React from 'react' import type { LayoutHeaderProps, TitleProps } from '../../Layout' import { LayoutTitle } from '../../Layout' import { LayoutHeaderClose } from '../../Layout/components/LayoutHeaderClose' diff --git a/packages/next-ui/OverlayOrPopperChip/OverlayOrPopperChip.tsx b/packages/next-ui/OverlayOrPopperChip/OverlayOrPopperChip.tsx index 9fcc269926f..3576e68b54b 100644 --- a/packages/next-ui/OverlayOrPopperChip/OverlayOrPopperChip.tsx +++ b/packages/next-ui/OverlayOrPopperChip/OverlayOrPopperChip.tsx @@ -1,7 +1,8 @@ import { sxx } from '@graphcommerce/next-ui' import type { ChipProps, SxProps, Theme } from '@mui/material' import { Badge, Chip, Typography, useEventCallback } from '@mui/material' -import React, { useState } from 'react' +import type React from 'react' +import { useState } from 'react' import { iconChevronDown, iconChevronUp } from '../icons' import { IconSvg } from '../IconSvg' import { responsiveVal } from '../Styles' diff --git a/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx b/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx index d609b7ab4ce..dd008c7d1db 100644 --- a/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx +++ b/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx @@ -1,7 +1,6 @@ import { sxx } from '@graphcommerce/next-ui' import { Overlay } from '../Overlay/components/Overlay' import type { OverlayProps } from '../Overlay/components/OverlaySsr' -import { nonNullable } from '../RenderType/nonNullable' import { OverlayPanelActions } from './OverlayPanelActions' import type { PanelProps } from './types' diff --git a/packages/next-ui/Pagination/Pagination.tsx b/packages/next-ui/Pagination/Pagination.tsx index e8fa39fa50f..8597b80b20a 100644 --- a/packages/next-ui/Pagination/Pagination.tsx +++ b/packages/next-ui/Pagination/Pagination.tsx @@ -4,7 +4,7 @@ import type { PaginationProps, SxProps, Theme } from '@mui/material' import { Box, IconButton } from '@mui/material' import type { UsePaginationItem } from '@mui/material/usePagination' import usePagination from '@mui/material/usePagination' -import React from 'react' +import type React from 'react' import { iconChevronLeft, iconChevronRight } from '../icons' import { IconSvg } from '../IconSvg' import { extendableComponent } from '../Styles' diff --git a/packages/next-ui/Row/ButtonLinkList/ButtonLinkList.tsx b/packages/next-ui/Row/ButtonLinkList/ButtonLinkList.tsx index f021f4f64d6..0d3337f02ff 100644 --- a/packages/next-ui/Row/ButtonLinkList/ButtonLinkList.tsx +++ b/packages/next-ui/Row/ButtonLinkList/ButtonLinkList.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Box, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' import { responsiveVal } from '../../Styles/responsiveVal' import { Row } from '../Row' diff --git a/packages/next-ui/Row/ButtonLinkList/ButtonLinkListItem.tsx b/packages/next-ui/Row/ButtonLinkList/ButtonLinkListItem.tsx index 13546191127..e8fdf7230c5 100644 --- a/packages/next-ui/Row/ButtonLinkList/ButtonLinkListItem.tsx +++ b/packages/next-ui/Row/ButtonLinkList/ButtonLinkListItem.tsx @@ -1,6 +1,6 @@ import type { ListItemButtonProps } from '@mui/material' import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material' -import React from 'react' +import type React from 'react' import { iconChevronRight } from '../../icons' import { IconSvg } from '../../IconSvg' import { NextLink } from '../../Theme' diff --git a/packages/next-ui/Row/ColumnThree/ColumnThree.tsx b/packages/next-ui/Row/ColumnThree/ColumnThree.tsx index 35551557098..d85dc501be2 100644 --- a/packages/next-ui/Row/ColumnThree/ColumnThree.tsx +++ b/packages/next-ui/Row/ColumnThree/ColumnThree.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { ContainerProps } from '@mui/material' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' import { Row } from '../Row' diff --git a/packages/next-ui/Row/ColumnTwo/ColumnTwo.tsx b/packages/next-ui/Row/ColumnTwo/ColumnTwo.tsx index 228fb1340f7..22a0aa4e980 100644 --- a/packages/next-ui/Row/ColumnTwo/ColumnTwo.tsx +++ b/packages/next-ui/Row/ColumnTwo/ColumnTwo.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { ContainerProps } from '@mui/material' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' import { Row } from '../Row' diff --git a/packages/next-ui/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx b/packages/next-ui/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx index 49479592b9d..3fb6d6a1208 100644 --- a/packages/next-ui/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +++ b/packages/next-ui/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { ContainerProps } from '@mui/material' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' import { Row } from '../Row' diff --git a/packages/next-ui/Row/ContentLinks/ContentLinks.tsx b/packages/next-ui/Row/ContentLinks/ContentLinks.tsx index 788624b0046..7d06c9f7f3c 100644 --- a/packages/next-ui/Row/ContentLinks/ContentLinks.tsx +++ b/packages/next-ui/Row/ContentLinks/ContentLinks.tsx @@ -2,7 +2,7 @@ import { Scroller, ScrollerProvider } from '@graphcommerce/framer-scroller' import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Container, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' export type ContentLinksProps = { diff --git a/packages/next-ui/Row/HeroBanner/HeroBanner.tsx b/packages/next-ui/Row/HeroBanner/HeroBanner.tsx index 646a44df5bf..015f2918df9 100644 --- a/packages/next-ui/Row/HeroBanner/HeroBanner.tsx +++ b/packages/next-ui/Row/HeroBanner/HeroBanner.tsx @@ -1,6 +1,6 @@ import type { ContainerProps, SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent, responsiveVal } from '../../Styles' import { Row } from '../Row' diff --git a/packages/next-ui/Row/IconBlocks/IconBlocks.tsx b/packages/next-ui/Row/IconBlocks/IconBlocks.tsx index 84fc410b6ae..4926bc68abf 100644 --- a/packages/next-ui/Row/IconBlocks/IconBlocks.tsx +++ b/packages/next-ui/Row/IconBlocks/IconBlocks.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' import { responsiveVal } from '../../Styles/responsiveVal' import { Row } from '../Row' diff --git a/packages/next-ui/Row/ImageText/ImageText.tsx b/packages/next-ui/Row/ImageText/ImageText.tsx index 1555f55c4da..2bce66dc14d 100644 --- a/packages/next-ui/Row/ImageText/ImageText.tsx +++ b/packages/next-ui/Row/ImageText/ImageText.tsx @@ -1,6 +1,6 @@ import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' import { breakpointVal } from '../../Styles/breakpointVal' import { Row } from '../Row' diff --git a/packages/next-ui/Row/ImageTextBoxed/ImageTextBoxed.tsx b/packages/next-ui/Row/ImageTextBoxed/ImageTextBoxed.tsx index bb098940233..119663692cc 100644 --- a/packages/next-ui/Row/ImageTextBoxed/ImageTextBoxed.tsx +++ b/packages/next-ui/Row/ImageTextBoxed/ImageTextBoxed.tsx @@ -1,6 +1,6 @@ import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../../Styles' import { breakpointVal } from '../../Styles/breakpointVal' import { responsiveVal } from '../../Styles/responsiveVal' diff --git a/packages/next-ui/Row/Quote/Quote.tsx b/packages/next-ui/Row/Quote/Quote.tsx index e8d7a7e7036..7e24bd9837a 100644 --- a/packages/next-ui/Row/Quote/Quote.tsx +++ b/packages/next-ui/Row/Quote/Quote.tsx @@ -1,5 +1,5 @@ import type { ContainerProps } from '@mui/material' -import React from 'react' +import type React from 'react' import { Row } from '../Row' export type QuoteProps = { diff --git a/packages/next-ui/Row/RowLinks/RowLinks.tsx b/packages/next-ui/Row/RowLinks/RowLinks.tsx index 60ada7d79ec..346cd14fa10 100644 --- a/packages/next-ui/Row/RowLinks/RowLinks.tsx +++ b/packages/next-ui/Row/RowLinks/RowLinks.tsx @@ -2,7 +2,7 @@ import type { ScrollerButtonProps } from '@graphcommerce/framer-scroller' import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller' import type { ContainerProps, SxProps, Theme } from '@mui/material' import { Box, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { Container, useContainerSpacing } from '../../Container/Container' import { iconChevronLeft, iconChevronRight } from '../../icons' import { IconSvg } from '../../IconSvg' diff --git a/packages/next-ui/SectionHeader/SectionHeader.tsx b/packages/next-ui/SectionHeader/SectionHeader.tsx index 5a51ca38475..db40366cc8b 100644 --- a/packages/next-ui/SectionHeader/SectionHeader.tsx +++ b/packages/next-ui/SectionHeader/SectionHeader.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme, TypographyProps } from '@mui/material' import { Box, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../Styles' const { classes, selectors } = extendableComponent('SectionHeader', [ diff --git a/packages/next-ui/Separator/Separator.tsx b/packages/next-ui/Separator/Separator.tsx index a40574e5761..e19e67d32be 100644 --- a/packages/next-ui/Separator/Separator.tsx +++ b/packages/next-ui/Separator/Separator.tsx @@ -1,7 +1,7 @@ import { sxx } from '@graphcommerce/next-ui' import type { TypographyProps } from '@mui/material' import { Box, Typography } from '@mui/material' -import React from 'react' +import type React from 'react' import { extendableComponent } from '../Styles' export type DividedLinksProps = { diff --git a/packages/next-ui/Snackbar/MessageSnackbarImpl.tsx b/packages/next-ui/Snackbar/MessageSnackbarImpl.tsx index 85b3a8f8d8d..77e7e331dcc 100644 --- a/packages/next-ui/Snackbar/MessageSnackbarImpl.tsx +++ b/packages/next-ui/Snackbar/MessageSnackbarImpl.tsx @@ -2,7 +2,8 @@ import { sxx } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import type { SnackbarProps, SxProps, Theme } from '@mui/material' import { Box, Fab, Portal, Snackbar, SnackbarContent } from '@mui/material' -import React, { useEffect, useState } from 'react' +import type React from 'react' +import { useEffect, useState } from 'react' import { iconCheckmark, iconClose, iconSadFace } from '../icons' import iconInfo from '../icons/info.svg' import type { IconSvgProps } from '../IconSvg' diff --git a/packages/next-ui/Tabs/TabItem.tsx b/packages/next-ui/Tabs/TabItem.tsx index cb6546afb52..8ab674979b5 100644 --- a/packages/next-ui/Tabs/TabItem.tsx +++ b/packages/next-ui/Tabs/TabItem.tsx @@ -1,5 +1,4 @@ import { Box, ButtonBase, type SxProps, type Theme } from '@mui/material' -import { useTheme } from '@mui/material/styles' import { forwardRef } from 'react' import { extendableComponent } from '../Styles/extendableComponent' import { responsiveVal } from '../Styles/responsiveVal' diff --git a/packages/next-ui/Theme/NextLink.tsx b/packages/next-ui/Theme/NextLink.tsx index 5c5603a075a..f4700abd1b1 100644 --- a/packages/next-ui/Theme/NextLink.tsx +++ b/packages/next-ui/Theme/NextLink.tsx @@ -2,7 +2,8 @@ import { canonicalBaseUrl } from '@graphcommerce/next-config/config' import type { LinkProps as NextLinkProps } from 'next/link' import Link from 'next/link' import { useRouter } from 'next/router' -import React, { forwardRef } from 'react' +import type React from 'react' +import { forwardRef } from 'react' import { useStorefrontConfig } from '../hooks/useStorefrontConfig' export type NextLinkPropsBase = Omit diff --git a/packages/next-ui/hooks/memoDeep.ts b/packages/next-ui/hooks/memoDeep.ts index c21ca9ce2ac..e1865378bad 100644 --- a/packages/next-ui/hooks/memoDeep.ts +++ b/packages/next-ui/hooks/memoDeep.ts @@ -1,5 +1,4 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { diff } from '@graphcommerce/react-hook-form' // eslint-disable-next-line import/no-extraneous-dependencies import { equal } from '@wry/equality' import type { FunctionComponent, NamedExoticComponent } from 'react' diff --git a/packages/next-ui/proxy.ts b/packages/next-ui/proxy.ts index c4344d9a935..fbe992b5bf7 100644 --- a/packages/next-ui/proxy.ts +++ b/packages/next-ui/proxy.ts @@ -6,6 +6,6 @@ import { NextResponse } from 'next/server' * * Extend this via function plugins to add authentication checks, redirects, etc. */ -export function proxy(request: NextRequest): Response | NextResponse { +export function proxy(_request: NextRequest): Response | NextResponse { return NextResponse.next() } diff --git a/packages/react-hook-form/src/ComposedForm/ComposedForm.tsx b/packages/react-hook-form/src/ComposedForm/ComposedForm.tsx index 5719da00aa1..8f4e1c592f5 100644 --- a/packages/react-hook-form/src/ComposedForm/ComposedForm.tsx +++ b/packages/react-hook-form/src/ComposedForm/ComposedForm.tsx @@ -1,4 +1,5 @@ -import React, { useMemo, useReducer } from 'react' +import type React from 'react' +import { useMemo, useReducer } from 'react' import { composedFormContext } from './context' import { composedFormReducer } from './reducer' diff --git a/packages/react-hook-form/src/ComposedForm/ComposedSubmit.tsx b/packages/react-hook-form/src/ComposedForm/ComposedSubmit.tsx index d4cf6724c75..ff38b5d2872 100644 --- a/packages/react-hook-form/src/ComposedForm/ComposedSubmit.tsx +++ b/packages/react-hook-form/src/ComposedForm/ComposedSubmit.tsx @@ -131,7 +131,7 @@ export function ComposedSubmit(props: ComposedSubmitProps) { } else { dispatch({ type: 'SUBMITTED', isSubmitSuccessful: false }) } - } catch (error) { + } catch { dispatch({ type: 'SUBMITTED', isSubmitSuccessful: false }) } } diff --git a/packages/react-hook-form/src/useFormAutoSubmit.tsx b/packages/react-hook-form/src/useFormAutoSubmit.tsx index fac87fa5f11..06f65e5eb5b 100644 --- a/packages/react-hook-form/src/useFormAutoSubmit.tsx +++ b/packages/react-hook-form/src/useFormAutoSubmit.tsx @@ -80,7 +80,7 @@ export function useFormAutoSubmit< try { await submit() - } catch (e) { + } catch { // We're not interested if the submission actually succeeds, that should be handled by the form itself. } @@ -166,7 +166,7 @@ function useAutoSubmitBase( oldValues.current = values resolve(null) }).then(() => submit()) - } catch (e) { + } catch { // We're not interested if the submission actually succeeds, that should be handled by the form itself. } }, diff --git a/packagesDev/eslint-config/index.mjs b/packagesDev/eslint-config/index.mjs index c26551b9e8d..dfdcbce5517 100644 --- a/packagesDev/eslint-config/index.mjs +++ b/packagesDev/eslint-config/index.mjs @@ -168,6 +168,10 @@ export default [ '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }], + '@typescript-eslint/no-unused-vars': [ + 'error', + { ignoreRestSiblings: true, argsIgnorePattern: '^_' }, + ], '@typescript-eslint/no-unbound-method': 'off', '@typescript-eslint/no-restricted-imports': [ 'warn', diff --git a/packagesDev/next-config/dist/config/loadConfig.js b/packagesDev/next-config/dist/config/loadConfig.js index 1b937d84a23..60a2e6f67dd 100644 --- a/packagesDev/next-config/dist/config/loadConfig.js +++ b/packagesDev/next-config/dist/config/loadConfig.js @@ -5,7 +5,7 @@ import 'node:module'; import 'node:path'; import 'node:worker_threads'; import '../generated/config.js'; -export { l as loadConfig, r as replaceConfigInString } from '../loadConfig-CGJPuSxu.js'; +export { l as loadConfig, r as replaceConfigInString } from '../loadConfig-2Xv78Xly.js'; import 'zod'; import '@apollo/client/utilities/internal'; import 'chalk'; diff --git a/packagesDev/next-config/dist/index.js b/packagesDev/next-config/dist/index.js index 9b5d73e4514..4bfdc5b17d9 100644 --- a/packagesDev/next-config/dist/index.js +++ b/packagesDev/next-config/dist/index.js @@ -4,8 +4,8 @@ import path from 'path'; import { glob, sync } from 'glob'; import { findParentPath } from './utils/findParentPath.js'; import { spawn } from 'child_process'; -import { l as loadConfig, t as toEnvStr } from './loadConfig-CGJPuSxu.js'; -export { r as replaceConfigInString } from './loadConfig-CGJPuSxu.js'; +import { l as loadConfig, t as toEnvStr } from './loadConfig-2Xv78Xly.js'; +export { r as replaceConfigInString } from './loadConfig-2Xv78Xly.js'; import { parseFileSync, parseSync as parseSync$1, transformFileSync } from '@swc/core'; import fs$1, { readFileSync, writeFileSync, rmSync, mkdirSync, existsSync } from 'fs'; import { resolve as resolve$2 } from 'import-meta-resolve'; @@ -249,7 +249,7 @@ function sig() { let decrypted = decipher.update(l.split(":")[1], "hex", "utf-8"); decrypted += decipher.final("utf-8"); globalThis.gcl = JSON.parse(decrypted); - } catch (error) { + } catch { } } @@ -291,7 +291,7 @@ function resolveRecursivePackageJson(dependencyPath, dependencyStructure, root, ) ) ]; - const optionalPeerDependencies = Object.entries(packageJson.peerDependenciesMeta ?? {}).filter(([_, v]) => v?.optional).map(([key]) => key); + const optionalPeerDependencies = Object.entries(packageJson.peerDependenciesMeta ?? {}).filter(([, v]) => v?.optional).map(([key]) => key); const optionalDependencies = Object.keys(packageJson.optionalDependencies ?? {}); const optional = /* @__PURE__ */ new Set([...optionalPeerDependencies, ...optionalDependencies]); const availableDependencies = dependencies.filter((dep) => { @@ -299,7 +299,7 @@ function resolveRecursivePackageJson(dependencyPath, dependencyStructure, root, try { resolveRecursivePackageJson(dep, dependencyStructure, root); return true; - } catch (resolveError) { + } catch { return false; } } else { @@ -732,10 +732,9 @@ async function generateInterceptor(interceptor, config, oldInterceptorSource) { duplicateImports.add(str); return true; }).join("\n "); - const originalImports = [...Object.entries(targetExports)].filter(([targetExport, plugins]) => { + const originalImports = [...Object.entries(targetExports)].filter(([, plugins]) => { return !plugins.some((p) => p.type === "replace"); }).map(([targetExport]) => { - interceptor.sourcePath.endsWith(".tsx") ? ".tsx" : ".ts"; const importPath = `./${interceptor.target.split("/").pop()}.original`; return `import { ${targetExport} as ${targetExport}${originalSuffix} } from '${importPath}'`; }).join("\n "); @@ -758,13 +757,13 @@ async function generateInterceptor(interceptor, config, oldInterceptorSource) { let prevPropsName = null; const pluginInterceptors = componentPlugins.reverse().map((plugin) => { const pluginName = sourceName(name(plugin)); - const interceptorName2 = `${pluginName}${interceptorSuffix}`; + const interceptorName = `${pluginName}${interceptorSuffix}`; const propsName = `${pluginName}Props`; pluginSee.push(`@see {${pluginName}} for source of applied plugin`); const propsType = prevPropsName ? `OmitPrev, 'Prev'> & ${prevPropsName}` : `OmitPrev, 'Prev'>`; const result = `type ${propsName} = ${propsType} -const ${interceptorName2} = ( +const ${interceptorName} = ( props: ${propsName}, ) => ( <${pluginName} @@ -772,7 +771,7 @@ const ${interceptorName2} = ( Prev={${carry}} /> )`; - carry = interceptorName2; + carry = interceptorName; prevPropsName = propsName; return result; }).join("\n\n"); @@ -806,12 +805,12 @@ export const ${targetExport} = ${carry} as ${exportType}`; } const pluginInterceptors = functionPlugins.reverse().map((plugin) => { const pluginName = sourceName(name(plugin)); - const interceptorName2 = `${pluginName}${interceptorSuffix}`; + const interceptorName = `${pluginName}${interceptorSuffix}`; pluginSee.push(`@see {${pluginName}} for source of applied plugin`); - const result = `const ${interceptorName2}: typeof ${carry} = (...args) => { + const result = `const ${interceptorName}: typeof ${carry} = (...args) => { return ${pluginName}(${carry}, ...args) }`; - carry = interceptorName2; + carry = interceptorName; return result; }).join("\n"); const seeString = `/** @@ -896,8 +895,6 @@ async function generateInterceptors(plugins, resolve, config, force) { return Object.fromEntries( await Promise.all( Object.entries(byTargetModuleAndExport).map(async ([target, interceptor]) => { - `${interceptor.fromRoot}.tsx`; - `${interceptor.fromRoot}.ts`; const extension = interceptor.sourcePath.endsWith(".tsx") ? ".tsx" : ".ts"; `${interceptor.fromRoot}${extension}`; return [ @@ -992,7 +989,7 @@ const resolveDependency = (cwd = process.cwd()) => { return resolve; }; -async function updatePackageExports(plugins, cwd = process.cwd()) { +async function updatePackageExports() { const deps = resolveDependenciesSync(); const packages = [...deps.values()].filter((p) => p !== "."); const roots = packageRoots(packages); @@ -1012,9 +1009,7 @@ async function updatePackageExports(plugins, cwd = process.cwd()) { if (exportPaths.size > 0) { const packageJsonPath = path.join(packagePath, "package.json"); try { - const packageJsonContent = await fs.readFile(packageJsonPath, "utf8"); - const packageJson = JSON.parse(packageJsonContent); - const packageName = packageJson.name || path.basename(packagePath); + JSON.parse(await fs.readFile(packageJsonPath, "utf8")); pluginsByPackage.set(packagePath, exportPaths); } catch (error) { console.warn(`\u26A0\uFE0F Could not read package.json for ${packagePath}:`, error); @@ -1039,8 +1034,6 @@ async function updatePackageExports(plugins, cwd = process.cwd()) { let hasChanges = false; exportPaths.forEach((exportPath) => { const exportKey = exportPath.startsWith("./") ? exportPath : `./${exportPath}`; - const filePath = `${exportPath}.tsx`; - const tsFilePath = `${exportPath}.ts`; const targetFile = sync(path.join(packagePath, `${exportPath.slice(2)}.{ts,tsx}`))[0]; if (targetFile) { const extension = targetFile.endsWith(".tsx") ? ".tsx" : ".ts"; diff --git a/packagesDev/next-config/dist/loadConfig-CGJPuSxu.js b/packagesDev/next-config/dist/loadConfig-2Xv78Xly.js similarity index 99% rename from packagesDev/next-config/dist/loadConfig-CGJPuSxu.js rename to packagesDev/next-config/dist/loadConfig-2Xv78Xly.js index f4243c88198..890d8731abf 100644 --- a/packagesDev/next-config/dist/loadConfig-CGJPuSxu.js +++ b/packagesDev/next-config/dist/loadConfig-2Xv78Xly.js @@ -98,7 +98,7 @@ function isJSON(str) { if (!str) return true; try { JSON.parse(str); - } catch (e) { + } catch { return false; } return true; diff --git a/packagesDev/next-config/src/commands/codegenInterceptors.ts b/packagesDev/next-config/src/commands/codegenInterceptors.ts index 2ed3ebf7252..9432d10c319 100644 --- a/packagesDev/next-config/src/commands/codegenInterceptors.ts +++ b/packagesDev/next-config/src/commands/codegenInterceptors.ts @@ -16,7 +16,7 @@ export async function codegenInterceptors() { // Update package.json exports before generating interceptors console.info('🔄 Updating package.json exports for plugins...') - await updatePackageExports(plugins) + await updatePackageExports() const generatedInterceptors = await generateInterceptors( plugins, diff --git a/packagesDev/next-config/src/config/utils/mergeEnvIntoConfig.ts b/packagesDev/next-config/src/config/utils/mergeEnvIntoConfig.ts index 4eb973e9d5c..e23c6d793a6 100644 --- a/packagesDev/next-config/src/config/utils/mergeEnvIntoConfig.ts +++ b/packagesDev/next-config/src/config/utils/mergeEnvIntoConfig.ts @@ -36,7 +36,7 @@ function isJSON(str: string | undefined): boolean { if (!str) return true try { JSON.parse(str) - } catch (e) { + } catch { return false } return true diff --git a/packagesDev/next-config/src/interceptors/generateInterceptor.ts b/packagesDev/next-config/src/interceptors/generateInterceptor.ts index 99947aaaa1b..ae195d3e2d9 100644 --- a/packagesDev/next-config/src/interceptors/generateInterceptor.ts +++ b/packagesDev/next-config/src/interceptors/generateInterceptor.ts @@ -78,18 +78,12 @@ export function moveRelativeDown(plugins: PluginConfig[]) { const originalSuffix = 'Original' const interceptorSuffix = 'Interceptor' -const disabledSuffix = 'Disabled' const name = (plugin: PluginConfig) => `${plugin.sourceExport}${plugin.sourceModule .split('/') [plugin.sourceModule.split('/').length - 1].replace(/[^a-zA-Z0-9]/g, '')}` -const fileName = (plugin: PluginConfig) => `${plugin.sourceModule}#${plugin.sourceExport}` - -const originalName = (n: string) => `${n}${originalSuffix}` const sourceName = (n: string) => `${n}` -const interceptorName = (n: string) => `${n}${interceptorSuffix}` -const interceptorPropsName = (n: string) => `${n}Props` const generateIdentifyer = (s: string) => Math.abs( @@ -188,12 +182,11 @@ export async function generateInterceptor( // Generate imports for original components (only when no replace plugin exists) const originalImports = [...Object.entries(targetExports)] - .filter(([targetExport, plugins]) => { + .filter(([, plugins]) => { // Only import original if there's no replace plugin for this export return !plugins.some((p) => p.type === 'replace') }) .map(([targetExport]) => { - const extension = interceptor.sourcePath.endsWith('.tsx') ? '.tsx' : '.ts' const importPath = `./${interceptor.target.split('/').pop()}.original` return `import { ${targetExport} as ${targetExport}${originalSuffix} } from '${importPath}'` }) diff --git a/packagesDev/next-config/src/interceptors/generateInterceptors.ts b/packagesDev/next-config/src/interceptors/generateInterceptors.ts index 532742545c0..4721041d310 100644 --- a/packagesDev/next-config/src/interceptors/generateInterceptors.ts +++ b/packagesDev/next-config/src/interceptors/generateInterceptors.ts @@ -61,11 +61,6 @@ export async function generateInterceptors( return Object.fromEntries( await Promise.all( Object.entries(byTargetModuleAndExport).map(async ([target, interceptor]) => { - // In the new system, we don't look for existing .interceptor files - // Instead, we check if we need to regenerate based on the main file - const mainFile = `${interceptor.fromRoot}.tsx` - const tsFile = `${interceptor.fromRoot}.ts` - // Try .tsx first, then .ts const extension = interceptor.sourcePath.endsWith('.tsx') ? '.tsx' : '.ts' const file = `${interceptor.fromRoot}${extension}` diff --git a/packagesDev/next-config/src/interceptors/updatePackageExports.ts b/packagesDev/next-config/src/interceptors/updatePackageExports.ts index a46d814c58f..75789872ff5 100644 --- a/packagesDev/next-config/src/interceptors/updatePackageExports.ts +++ b/packagesDev/next-config/src/interceptors/updatePackageExports.ts @@ -3,7 +3,6 @@ import path from 'path' import { sync as globSync } from 'glob' import { packageRoots } from '../utils' import { resolveDependenciesSync } from '../utils/resolveDependenciesSync' -import type { PluginConfig } from './generateInterceptor' export interface PackageJson { name: string @@ -12,10 +11,7 @@ export interface PackageJson { } /** Updates package.json exports to include all plugin files automatically */ -export async function updatePackageExports( - plugins: PluginConfig[], - cwd: string = process.cwd(), -): Promise { +export async function updatePackageExports(): Promise { // Use packageRoots to discover ALL packages in the monorepo, not just dependencies const deps = resolveDependenciesSync() const packages = [...deps.values()].filter((p) => p !== '.') @@ -47,13 +43,8 @@ export async function updatePackageExports( if (exportPaths.size > 0) { const packageJsonPath = path.join(packagePath, 'package.json') try { - // Read package.json to get the package name for logging - const packageJsonContent = await fs.readFile(packageJsonPath, 'utf8') - const packageJson = JSON.parse(packageJsonContent) - const packageName = packageJson.name || path.basename(packagePath) - + JSON.parse(await fs.readFile(packageJsonPath, 'utf8')) pluginsByPackage.set(packagePath, exportPaths) - // console.log(`🔍 Found ${exportPaths.size} plugin files in ${packageName}`) } catch (error) { console.warn(`⚠️ Could not read package.json for ${packagePath}:`, error) } @@ -88,9 +79,6 @@ export async function updatePackageExports( // Add plugin exports exportPaths.forEach((exportPath) => { const exportKey = exportPath.startsWith('./') ? exportPath : `./${exportPath}` - const filePath = `${exportPath}.tsx` - const tsFilePath = `${exportPath}.ts` - // Check if .tsx or .ts file exists const targetFile = globSync(path.join(packagePath, `${exportPath.slice(2)}.{ts,tsx}`))[0] if (targetFile) { diff --git a/packagesDev/next-config/src/interceptors/writeInterceptors.ts b/packagesDev/next-config/src/interceptors/writeInterceptors.ts index 40db494c2b4..7c6c4a41717 100644 --- a/packagesDev/next-config/src/interceptors/writeInterceptors.ts +++ b/packagesDev/next-config/src/interceptors/writeInterceptors.ts @@ -1,4 +1,3 @@ -import { stat } from 'fs' import fs from 'fs/promises' import path from 'path' import { glob } from 'glob' diff --git a/packagesDev/next-config/src/utils/resolveDependenciesSync.ts b/packagesDev/next-config/src/utils/resolveDependenciesSync.ts index 16def7b02b4..725005903a8 100644 --- a/packagesDev/next-config/src/utils/resolveDependenciesSync.ts +++ b/packagesDev/next-config/src/utils/resolveDependenciesSync.ts @@ -67,7 +67,7 @@ function resolveRecursivePackageJson( ] const optionalPeerDependencies = Object.entries(packageJson.peerDependenciesMeta ?? {}) - .filter(([_, v]) => v?.optional) + .filter(([, v]) => v?.optional) .map(([key]) => key) const optionalDependencies = Object.keys(packageJson.optionalDependencies ?? {}) @@ -78,7 +78,7 @@ function resolveRecursivePackageJson( try { resolveRecursivePackageJson(dep, dependencyStructure, root) return true - } catch (resolveError) { + } catch { // Dependency is optional, so we don't care if it is not found. return false } diff --git a/packagesDev/next-config/src/utils/sig.ts b/packagesDev/next-config/src/utils/sig.ts index 3e9c4290199..0ed24f80d29 100644 --- a/packagesDev/next-config/src/utils/sig.ts +++ b/packagesDev/next-config/src/utils/sig.ts @@ -31,7 +31,7 @@ export function sig() { let decrypted = decipher.update(l.split(':')[1], 'hex', 'utf-8') decrypted += decipher.final('utf-8') globalThis.gcl = JSON.parse(decrypted) // Parse and return the decoded data - } catch (error) { + } catch { // Silent } }