From f890d847e401fbefef85d3e402851f7e4af6cd98 Mon Sep 17 00:00:00 2001 From: Robert Field Date: Wed, 1 May 2024 10:49:01 +0100 Subject: [PATCH] feat: update examples use latest hooks (#204) * build: bump moltin sdk and fix the version * feat: update schematics to use latest shopper hooks * chore: add changesets * chore: update examples --- .changeset/fresh-bulldogs-shake.md | 6 ++++ .changeset/nice-dolphins-agree.md | 5 +++ .changeset/rich-planets-work.md | 9 +++++ examples/algolia/package.json | 2 +- .../(checkout)/checkout/checkout-provider.tsx | 5 +-- .../algolia/src/app/(store)/cart/CartItem.tsx | 5 ++- .../src/app/(store)/cart/CartItemWide.tsx | 5 ++- .../src/components/cart/CartDiscounts.tsx | 8 +++-- .../algolia/src/components/cart/CartSheet.tsx | 6 ++-- .../number-input/EditQuantityButton.tsx | 5 ++- .../src/components/product/SimpleProduct.tsx | 5 ++- .../product/bundles/BundleProduct.tsx | 5 ++- .../product/variations/VariationProduct.tsx | 5 ++- examples/payments/package.json | 2 +- .../(checkout)/checkout/checkout-provider.tsx | 5 +-- .../src/app/(store)/cart/CartItem.tsx | 5 ++- .../src/app/(store)/cart/CartItemWide.tsx | 5 ++- .../src/components/cart/CartDiscounts.tsx | 8 +++-- .../src/components/cart/CartSheet.tsx | 6 ++-- .../number-input/EditQuantityButton.tsx | 5 ++- .../src/components/product/SimpleProduct.tsx | 5 ++- .../product/bundles/BundleProduct.tsx | 5 ++- .../product/variations/VariationProduct.tsx | 5 ++- examples/simple/package.json | 2 +- .../(checkout)/checkout/checkout-provider.tsx | 5 +-- .../simple/src/app/(store)/cart/CartItem.tsx | 5 ++- .../src/app/(store)/cart/CartItemWide.tsx | 5 ++- .../src/components/cart/CartDiscounts.tsx | 8 +++-- .../simple/src/components/cart/CartSheet.tsx | 6 ++-- .../number-input/EditQuantityButton.tsx | 5 ++- .../src/components/product/SimpleProduct.tsx | 5 ++- .../product/bundles/BundleProduct.tsx | 5 ++- .../product/variations/VariationProduct.tsx | 5 ++- packages/composable-cli/package.json | 2 +- packages/composable-common/package.json | 2 +- .../EditQuantityButton.tsx.template | 5 ++- .../app/(store)/cart/CartItem.tsx.template | 5 ++- .../(store)/cart/CartItemWide.tsx.template | 5 ++- .../cart/CartDiscounts.tsx.template | 8 +++-- .../components/cart/CartSheet.tsx.template | 6 ++-- .../checkout/checkout-provider.tsx.template | 5 +-- .../checkout/checkout-provider.tsx.template | 5 +-- packages/d2c-schematics/package.json | 2 +- .../product/SimpleProduct.tsx.template | 5 ++- .../bundles/BundleProduct.tsx.template | 5 ++- .../variations/VariationProduct.tsx.template | 5 ++- .../utility/latest-versions/package.json | 6 ++-- packages/react-shopper-hooks/package.json | 4 +-- packages/react-shopper-hooks/tsconfig.json | 2 +- packages/shopper-common/package.json | 2 +- pnpm-lock.yaml | 36 +++++++++---------- 51 files changed, 146 insertions(+), 137 deletions(-) create mode 100644 .changeset/fresh-bulldogs-shake.md create mode 100644 .changeset/nice-dolphins-agree.md create mode 100644 .changeset/rich-planets-work.md diff --git a/.changeset/fresh-bulldogs-shake.md b/.changeset/fresh-bulldogs-shake.md new file mode 100644 index 00000000..2cae3d82 --- /dev/null +++ b/.changeset/fresh-bulldogs-shake.md @@ -0,0 +1,6 @@ +--- +"@elasticpath/react-shopper-hooks": minor +"@elasticpath/shopper-common": minor +--- + +Bump and fix moltin sdk dependency diff --git a/.changeset/nice-dolphins-agree.md b/.changeset/nice-dolphins-agree.md new file mode 100644 index 00000000..e0f8436c --- /dev/null +++ b/.changeset/nice-dolphins-agree.md @@ -0,0 +1,5 @@ +--- +"@elasticpath/d2c-schematics": minor +--- + +Use latest shopper hooks in schematics diff --git a/.changeset/rich-planets-work.md b/.changeset/rich-planets-work.md new file mode 100644 index 00000000..ae66fb3d --- /dev/null +++ b/.changeset/rich-planets-work.md @@ -0,0 +1,9 @@ +--- +"@elasticpath/react-shopper-hooks": minor +"@elasticpath/composable-common": minor +"composable-cli": minor +"@elasticpath/d2c-schematics": minor +"@elasticpath/shopper-common": minor +--- + +Bump moltin version and fix it diff --git a/examples/algolia/package.json b/examples/algolia/package.json index 13f5dab1..a9bcd2b9 100644 --- a/examples/algolia/package.json +++ b/examples/algolia/package.json @@ -27,7 +27,7 @@ "@heroicons/react": "^2.0.18", "@hookform/error-message": "^2.0.1", "@hookform/resolvers": "^3.3.2", - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-dialog": "^1.0.5", diff --git a/examples/algolia/src/app/(checkout)/checkout/checkout-provider.tsx b/examples/algolia/src/app/(checkout)/checkout/checkout-provider.tsx index b03b4f94..a555c047 100644 --- a/examples/algolia/src/app/(checkout)/checkout/checkout-provider.tsx +++ b/examples/algolia/src/app/(checkout)/checkout/checkout-provider.tsx @@ -10,6 +10,7 @@ import { CartState, useAuthedAccountMember, useCart, + useCartClear, } from "@elasticpath/react-shopper-hooks"; import { zodResolver } from "@hookform/resolvers/zod"; import { Form } from "../../../components/form/Form"; @@ -35,9 +36,9 @@ type CheckoutProviderProps = { }; export function CheckoutProvider({ children }: CheckoutProviderProps) { - const { state, useClearCart } = useCart(); + const { state } = useCart(); - const { mutateAsync: mutateClearCart } = useClearCart(); + const { mutateAsync: mutateClearCart } = useCartClear(); const [confirmationData, setConfirmationData] = useState["data"]>(undefined); diff --git a/examples/algolia/src/app/(store)/cart/CartItem.tsx b/examples/algolia/src/app/(store)/cart/CartItem.tsx index 30fd205d..f2507c48 100644 --- a/examples/algolia/src/app/(store)/cart/CartItem.tsx +++ b/examples/algolia/src/app/(store)/cart/CartItem.tsx @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import { NumberInput } from "../../../components/number-input/NumberInput"; import Link from "next/link"; @@ -11,8 +11,7 @@ export type CartItemProps = { }; export function CartItem({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/examples/algolia/src/app/(store)/cart/CartItemWide.tsx b/examples/algolia/src/app/(store)/cart/CartItemWide.tsx index 935733a7..b7421e3c 100644 --- a/examples/algolia/src/app/(store)/cart/CartItemWide.tsx +++ b/examples/algolia/src/app/(store)/cart/CartItemWide.tsx @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import Link from "next/link"; import { NumberInput } from "../../../components/number-input/NumberInput"; @@ -7,8 +7,7 @@ import { CartItemProps } from "./CartItem"; import { LoadingDots } from "../../../components/LoadingDots"; export function CartItemWide({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/examples/algolia/src/components/cart/CartDiscounts.tsx b/examples/algolia/src/components/cart/CartDiscounts.tsx index f9ec771d..d6090d4e 100644 --- a/examples/algolia/src/components/cart/CartDiscounts.tsx +++ b/examples/algolia/src/components/cart/CartDiscounts.tsx @@ -2,7 +2,10 @@ import { forwardRef, Fragment, HTMLAttributes } from "react"; import { Separator } from "../separator/Separator"; -import { PromotionCartItem, useCart } from "@elasticpath/react-shopper-hooks"; +import { + PromotionCartItem, + useCartRemoveItem, +} from "@elasticpath/react-shopper-hooks"; import { LoadingDots } from "../LoadingDots"; import { XMarkIcon } from "@heroicons/react/24/solid"; import * as React from "react"; @@ -13,8 +16,7 @@ export function CartDiscounts({ }: { promotions: PromotionCartItem[]; }) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return ( promotions && diff --git a/examples/algolia/src/components/cart/CartSheet.tsx b/examples/algolia/src/components/cart/CartSheet.tsx index 6fc6633d..a9bdec9e 100644 --- a/examples/algolia/src/components/cart/CartSheet.tsx +++ b/examples/algolia/src/components/cart/CartSheet.tsx @@ -11,7 +11,7 @@ import { import { Button } from "../button/Button"; import { LockClosedIcon, XMarkIcon } from "@heroicons/react/24/solid"; import { CartItem } from "../../app/(store)/cart/CartItem"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCart, useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { Separator } from "../separator/Separator"; import { ShoppingBagIcon } from "@heroicons/react/24/outline"; import { Fragment } from "react"; @@ -20,11 +20,11 @@ import Link from "next/link"; import { LoadingDots } from "../LoadingDots"; export function Cart() { - const { state, useScopedRemoveCartItem } = useCart(); + const { state } = useCart(); const { items, __extended } = state ?? {}; - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); const discountedValues = ( state?.meta?.display_price as diff --git a/examples/algolia/src/components/number-input/EditQuantityButton.tsx b/examples/algolia/src/components/number-input/EditQuantityButton.tsx index bc37c8f9..eed2eb2b 100644 --- a/examples/algolia/src/components/number-input/EditQuantityButton.tsx +++ b/examples/algolia/src/components/number-input/EditQuantityButton.tsx @@ -4,7 +4,7 @@ import { cn } from "../../lib/cn"; import { MinusIcon, PlusIcon } from "@heroicons/react/24/outline"; import { LoadingDots } from "../LoadingDots"; import type { CartItem } from "@moltin/sdk"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartUpdateItem } from "@elasticpath/react-shopper-hooks"; export function EditItemQuantityButton({ item, @@ -13,8 +13,7 @@ export function EditItemQuantityButton({ item: CartItem; type: "plus" | "minus"; }) { - const { useScopedUpdateCartItem } = useCart(); - const { mutate, isPending } = useScopedUpdateCartItem(); + const { mutate, isPending } = useCartUpdateItem(); return ( <> diff --git a/examples/algolia/src/components/product/SimpleProduct.tsx b/examples/algolia/src/components/product/SimpleProduct.tsx index 4b1e1bf7..dbc28d73 100644 --- a/examples/algolia/src/components/product/SimpleProduct.tsx +++ b/examples/algolia/src/components/product/SimpleProduct.tsx @@ -2,7 +2,7 @@ import type { SimpleProduct } from "@elasticpath/react-shopper-hooks"; import { SimpleProductProvider, - useCart, + useCartAddProduct, useSimpleProduct, } from "@elasticpath/react-shopper-hooks"; import ProductCarousel from "./carousel/ProductCarousel"; @@ -27,8 +27,7 @@ function SimpleProductDetail({ function SimpleProductContainer(): JSX.Element { const { product } = useSimpleProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { main_image, response, otherImages } = product; const { extensions } = response.attributes; diff --git a/examples/algolia/src/components/product/bundles/BundleProduct.tsx b/examples/algolia/src/components/product/bundles/BundleProduct.tsx index 1113c3f9..39f88f94 100644 --- a/examples/algolia/src/components/product/bundles/BundleProduct.tsx +++ b/examples/algolia/src/components/product/bundles/BundleProduct.tsx @@ -5,7 +5,7 @@ import { BundleProduct, BundleProductProvider, useBundle, - useCart, + useCartAddBundleItem, } from "@elasticpath/react-shopper-hooks"; import { useCallback, useMemo } from "react"; import { @@ -37,9 +37,8 @@ const BundleProductDetail = ({ function BundleProductContainer(): JSX.Element { const { configuredProduct, selectedOptions, components } = useBundle(); - const { useScopedAddBundleProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddBundleProductToCart(); + const { mutate, isPending } = useCartAddBundleItem(); const submit = useCallback( async (values: { selectedOptions: FormSelectedOptions }) => { diff --git a/examples/algolia/src/components/product/variations/VariationProduct.tsx b/examples/algolia/src/components/product/variations/VariationProduct.tsx index e486c43d..77fb2bc4 100644 --- a/examples/algolia/src/components/product/variations/VariationProduct.tsx +++ b/examples/algolia/src/components/product/variations/VariationProduct.tsx @@ -1,6 +1,6 @@ "use client"; import { - useCart, + useCartAddProduct, useVariationProduct, VariationProduct, VariationProductProvider, @@ -26,8 +26,7 @@ export const VariationProductDetail = ({ export function VariationProductContainer(): JSX.Element { const { product } = useVariationProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { response, main_image, otherImages } = product; const { extensions } = response.attributes; diff --git a/examples/payments/package.json b/examples/payments/package.json index d02580de..e07d2a8b 100644 --- a/examples/payments/package.json +++ b/examples/payments/package.json @@ -26,7 +26,7 @@ "@heroicons/react": "^2.0.18", "@hookform/error-message": "^2.0.1", "@hookform/resolvers": "^3.3.2", - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-dialog": "^1.0.5", diff --git a/examples/payments/src/app/(checkout)/checkout/checkout-provider.tsx b/examples/payments/src/app/(checkout)/checkout/checkout-provider.tsx index 7ceb6a2c..b236c72a 100644 --- a/examples/payments/src/app/(checkout)/checkout/checkout-provider.tsx +++ b/examples/payments/src/app/(checkout)/checkout/checkout-provider.tsx @@ -10,6 +10,7 @@ import { CartState, useAuthedAccountMember, useCart, + useCartClear, } from "@elasticpath/react-shopper-hooks"; import { zodResolver } from "@hookform/resolvers/zod"; import { Form } from "../../../components/form/Form"; @@ -47,9 +48,9 @@ type CheckoutProviderProps = { }; export function StripeCheckoutProvider({ children }: CheckoutProviderProps) { - const { state, useClearCart } = useCart(); + const { state } = useCart(); - const { mutateAsync: mutateClearCart } = useClearCart(); + const { mutateAsync: mutateClearCart } = useCartClear(); const [confirmationData, setConfirmationData] = useState["data"]>(undefined); diff --git a/examples/payments/src/app/(store)/cart/CartItem.tsx b/examples/payments/src/app/(store)/cart/CartItem.tsx index 30fd205d..f2507c48 100644 --- a/examples/payments/src/app/(store)/cart/CartItem.tsx +++ b/examples/payments/src/app/(store)/cart/CartItem.tsx @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import { NumberInput } from "../../../components/number-input/NumberInput"; import Link from "next/link"; @@ -11,8 +11,7 @@ export type CartItemProps = { }; export function CartItem({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/examples/payments/src/app/(store)/cart/CartItemWide.tsx b/examples/payments/src/app/(store)/cart/CartItemWide.tsx index 935733a7..b7421e3c 100644 --- a/examples/payments/src/app/(store)/cart/CartItemWide.tsx +++ b/examples/payments/src/app/(store)/cart/CartItemWide.tsx @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import Link from "next/link"; import { NumberInput } from "../../../components/number-input/NumberInput"; @@ -7,8 +7,7 @@ import { CartItemProps } from "./CartItem"; import { LoadingDots } from "../../../components/LoadingDots"; export function CartItemWide({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/examples/payments/src/components/cart/CartDiscounts.tsx b/examples/payments/src/components/cart/CartDiscounts.tsx index f9ec771d..d6090d4e 100644 --- a/examples/payments/src/components/cart/CartDiscounts.tsx +++ b/examples/payments/src/components/cart/CartDiscounts.tsx @@ -2,7 +2,10 @@ import { forwardRef, Fragment, HTMLAttributes } from "react"; import { Separator } from "../separator/Separator"; -import { PromotionCartItem, useCart } from "@elasticpath/react-shopper-hooks"; +import { + PromotionCartItem, + useCartRemoveItem, +} from "@elasticpath/react-shopper-hooks"; import { LoadingDots } from "../LoadingDots"; import { XMarkIcon } from "@heroicons/react/24/solid"; import * as React from "react"; @@ -13,8 +16,7 @@ export function CartDiscounts({ }: { promotions: PromotionCartItem[]; }) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return ( promotions && diff --git a/examples/payments/src/components/cart/CartSheet.tsx b/examples/payments/src/components/cart/CartSheet.tsx index 6fc6633d..a9bdec9e 100644 --- a/examples/payments/src/components/cart/CartSheet.tsx +++ b/examples/payments/src/components/cart/CartSheet.tsx @@ -11,7 +11,7 @@ import { import { Button } from "../button/Button"; import { LockClosedIcon, XMarkIcon } from "@heroicons/react/24/solid"; import { CartItem } from "../../app/(store)/cart/CartItem"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCart, useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { Separator } from "../separator/Separator"; import { ShoppingBagIcon } from "@heroicons/react/24/outline"; import { Fragment } from "react"; @@ -20,11 +20,11 @@ import Link from "next/link"; import { LoadingDots } from "../LoadingDots"; export function Cart() { - const { state, useScopedRemoveCartItem } = useCart(); + const { state } = useCart(); const { items, __extended } = state ?? {}; - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); const discountedValues = ( state?.meta?.display_price as diff --git a/examples/payments/src/components/number-input/EditQuantityButton.tsx b/examples/payments/src/components/number-input/EditQuantityButton.tsx index bc37c8f9..eed2eb2b 100644 --- a/examples/payments/src/components/number-input/EditQuantityButton.tsx +++ b/examples/payments/src/components/number-input/EditQuantityButton.tsx @@ -4,7 +4,7 @@ import { cn } from "../../lib/cn"; import { MinusIcon, PlusIcon } from "@heroicons/react/24/outline"; import { LoadingDots } from "../LoadingDots"; import type { CartItem } from "@moltin/sdk"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartUpdateItem } from "@elasticpath/react-shopper-hooks"; export function EditItemQuantityButton({ item, @@ -13,8 +13,7 @@ export function EditItemQuantityButton({ item: CartItem; type: "plus" | "minus"; }) { - const { useScopedUpdateCartItem } = useCart(); - const { mutate, isPending } = useScopedUpdateCartItem(); + const { mutate, isPending } = useCartUpdateItem(); return ( <> diff --git a/examples/payments/src/components/product/SimpleProduct.tsx b/examples/payments/src/components/product/SimpleProduct.tsx index 4b1e1bf7..dbc28d73 100644 --- a/examples/payments/src/components/product/SimpleProduct.tsx +++ b/examples/payments/src/components/product/SimpleProduct.tsx @@ -2,7 +2,7 @@ import type { SimpleProduct } from "@elasticpath/react-shopper-hooks"; import { SimpleProductProvider, - useCart, + useCartAddProduct, useSimpleProduct, } from "@elasticpath/react-shopper-hooks"; import ProductCarousel from "./carousel/ProductCarousel"; @@ -27,8 +27,7 @@ function SimpleProductDetail({ function SimpleProductContainer(): JSX.Element { const { product } = useSimpleProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { main_image, response, otherImages } = product; const { extensions } = response.attributes; diff --git a/examples/payments/src/components/product/bundles/BundleProduct.tsx b/examples/payments/src/components/product/bundles/BundleProduct.tsx index 1113c3f9..39f88f94 100644 --- a/examples/payments/src/components/product/bundles/BundleProduct.tsx +++ b/examples/payments/src/components/product/bundles/BundleProduct.tsx @@ -5,7 +5,7 @@ import { BundleProduct, BundleProductProvider, useBundle, - useCart, + useCartAddBundleItem, } from "@elasticpath/react-shopper-hooks"; import { useCallback, useMemo } from "react"; import { @@ -37,9 +37,8 @@ const BundleProductDetail = ({ function BundleProductContainer(): JSX.Element { const { configuredProduct, selectedOptions, components } = useBundle(); - const { useScopedAddBundleProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddBundleProductToCart(); + const { mutate, isPending } = useCartAddBundleItem(); const submit = useCallback( async (values: { selectedOptions: FormSelectedOptions }) => { diff --git a/examples/payments/src/components/product/variations/VariationProduct.tsx b/examples/payments/src/components/product/variations/VariationProduct.tsx index e486c43d..77fb2bc4 100644 --- a/examples/payments/src/components/product/variations/VariationProduct.tsx +++ b/examples/payments/src/components/product/variations/VariationProduct.tsx @@ -1,6 +1,6 @@ "use client"; import { - useCart, + useCartAddProduct, useVariationProduct, VariationProduct, VariationProductProvider, @@ -26,8 +26,7 @@ export const VariationProductDetail = ({ export function VariationProductContainer(): JSX.Element { const { product } = useVariationProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { response, main_image, otherImages } = product; const { extensions } = response.attributes; diff --git a/examples/simple/package.json b/examples/simple/package.json index 9f295723..35381544 100644 --- a/examples/simple/package.json +++ b/examples/simple/package.json @@ -19,7 +19,7 @@ "start:e2e": "NODE_ENV=test next start" }, "dependencies": { - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "@elasticpath/react-shopper-hooks": "workspace:*", "@elasticpath/shopper-common": "workspace:*", "clsx": "^1.2.1", diff --git a/examples/simple/src/app/(checkout)/checkout/checkout-provider.tsx b/examples/simple/src/app/(checkout)/checkout/checkout-provider.tsx index b03b4f94..a555c047 100644 --- a/examples/simple/src/app/(checkout)/checkout/checkout-provider.tsx +++ b/examples/simple/src/app/(checkout)/checkout/checkout-provider.tsx @@ -10,6 +10,7 @@ import { CartState, useAuthedAccountMember, useCart, + useCartClear, } from "@elasticpath/react-shopper-hooks"; import { zodResolver } from "@hookform/resolvers/zod"; import { Form } from "../../../components/form/Form"; @@ -35,9 +36,9 @@ type CheckoutProviderProps = { }; export function CheckoutProvider({ children }: CheckoutProviderProps) { - const { state, useClearCart } = useCart(); + const { state } = useCart(); - const { mutateAsync: mutateClearCart } = useClearCart(); + const { mutateAsync: mutateClearCart } = useCartClear(); const [confirmationData, setConfirmationData] = useState["data"]>(undefined); diff --git a/examples/simple/src/app/(store)/cart/CartItem.tsx b/examples/simple/src/app/(store)/cart/CartItem.tsx index 30fd205d..f2507c48 100644 --- a/examples/simple/src/app/(store)/cart/CartItem.tsx +++ b/examples/simple/src/app/(store)/cart/CartItem.tsx @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import { NumberInput } from "../../../components/number-input/NumberInput"; import Link from "next/link"; @@ -11,8 +11,7 @@ export type CartItemProps = { }; export function CartItem({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/examples/simple/src/app/(store)/cart/CartItemWide.tsx b/examples/simple/src/app/(store)/cart/CartItemWide.tsx index 935733a7..b7421e3c 100644 --- a/examples/simple/src/app/(store)/cart/CartItemWide.tsx +++ b/examples/simple/src/app/(store)/cart/CartItemWide.tsx @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import Link from "next/link"; import { NumberInput } from "../../../components/number-input/NumberInput"; @@ -7,8 +7,7 @@ import { CartItemProps } from "./CartItem"; import { LoadingDots } from "../../../components/LoadingDots"; export function CartItemWide({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/examples/simple/src/components/cart/CartDiscounts.tsx b/examples/simple/src/components/cart/CartDiscounts.tsx index f9ec771d..d6090d4e 100644 --- a/examples/simple/src/components/cart/CartDiscounts.tsx +++ b/examples/simple/src/components/cart/CartDiscounts.tsx @@ -2,7 +2,10 @@ import { forwardRef, Fragment, HTMLAttributes } from "react"; import { Separator } from "../separator/Separator"; -import { PromotionCartItem, useCart } from "@elasticpath/react-shopper-hooks"; +import { + PromotionCartItem, + useCartRemoveItem, +} from "@elasticpath/react-shopper-hooks"; import { LoadingDots } from "../LoadingDots"; import { XMarkIcon } from "@heroicons/react/24/solid"; import * as React from "react"; @@ -13,8 +16,7 @@ export function CartDiscounts({ }: { promotions: PromotionCartItem[]; }) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return ( promotions && diff --git a/examples/simple/src/components/cart/CartSheet.tsx b/examples/simple/src/components/cart/CartSheet.tsx index 6fc6633d..a9bdec9e 100644 --- a/examples/simple/src/components/cart/CartSheet.tsx +++ b/examples/simple/src/components/cart/CartSheet.tsx @@ -11,7 +11,7 @@ import { import { Button } from "../button/Button"; import { LockClosedIcon, XMarkIcon } from "@heroicons/react/24/solid"; import { CartItem } from "../../app/(store)/cart/CartItem"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCart, useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { Separator } from "../separator/Separator"; import { ShoppingBagIcon } from "@heroicons/react/24/outline"; import { Fragment } from "react"; @@ -20,11 +20,11 @@ import Link from "next/link"; import { LoadingDots } from "../LoadingDots"; export function Cart() { - const { state, useScopedRemoveCartItem } = useCart(); + const { state } = useCart(); const { items, __extended } = state ?? {}; - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); const discountedValues = ( state?.meta?.display_price as diff --git a/examples/simple/src/components/number-input/EditQuantityButton.tsx b/examples/simple/src/components/number-input/EditQuantityButton.tsx index bc37c8f9..eed2eb2b 100644 --- a/examples/simple/src/components/number-input/EditQuantityButton.tsx +++ b/examples/simple/src/components/number-input/EditQuantityButton.tsx @@ -4,7 +4,7 @@ import { cn } from "../../lib/cn"; import { MinusIcon, PlusIcon } from "@heroicons/react/24/outline"; import { LoadingDots } from "../LoadingDots"; import type { CartItem } from "@moltin/sdk"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartUpdateItem } from "@elasticpath/react-shopper-hooks"; export function EditItemQuantityButton({ item, @@ -13,8 +13,7 @@ export function EditItemQuantityButton({ item: CartItem; type: "plus" | "minus"; }) { - const { useScopedUpdateCartItem } = useCart(); - const { mutate, isPending } = useScopedUpdateCartItem(); + const { mutate, isPending } = useCartUpdateItem(); return ( <> diff --git a/examples/simple/src/components/product/SimpleProduct.tsx b/examples/simple/src/components/product/SimpleProduct.tsx index 4b1e1bf7..dbc28d73 100644 --- a/examples/simple/src/components/product/SimpleProduct.tsx +++ b/examples/simple/src/components/product/SimpleProduct.tsx @@ -2,7 +2,7 @@ import type { SimpleProduct } from "@elasticpath/react-shopper-hooks"; import { SimpleProductProvider, - useCart, + useCartAddProduct, useSimpleProduct, } from "@elasticpath/react-shopper-hooks"; import ProductCarousel from "./carousel/ProductCarousel"; @@ -27,8 +27,7 @@ function SimpleProductDetail({ function SimpleProductContainer(): JSX.Element { const { product } = useSimpleProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { main_image, response, otherImages } = product; const { extensions } = response.attributes; diff --git a/examples/simple/src/components/product/bundles/BundleProduct.tsx b/examples/simple/src/components/product/bundles/BundleProduct.tsx index 1113c3f9..39f88f94 100644 --- a/examples/simple/src/components/product/bundles/BundleProduct.tsx +++ b/examples/simple/src/components/product/bundles/BundleProduct.tsx @@ -5,7 +5,7 @@ import { BundleProduct, BundleProductProvider, useBundle, - useCart, + useCartAddBundleItem, } from "@elasticpath/react-shopper-hooks"; import { useCallback, useMemo } from "react"; import { @@ -37,9 +37,8 @@ const BundleProductDetail = ({ function BundleProductContainer(): JSX.Element { const { configuredProduct, selectedOptions, components } = useBundle(); - const { useScopedAddBundleProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddBundleProductToCart(); + const { mutate, isPending } = useCartAddBundleItem(); const submit = useCallback( async (values: { selectedOptions: FormSelectedOptions }) => { diff --git a/examples/simple/src/components/product/variations/VariationProduct.tsx b/examples/simple/src/components/product/variations/VariationProduct.tsx index e486c43d..77fb2bc4 100644 --- a/examples/simple/src/components/product/variations/VariationProduct.tsx +++ b/examples/simple/src/components/product/variations/VariationProduct.tsx @@ -1,6 +1,6 @@ "use client"; import { - useCart, + useCartAddProduct, useVariationProduct, VariationProduct, VariationProductProvider, @@ -26,8 +26,7 @@ export const VariationProductDetail = ({ export function VariationProductContainer(): JSX.Element { const { product } = useVariationProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { response, main_image, otherImages } = product; const { extensions } = response.attributes; diff --git a/packages/composable-cli/package.json b/packages/composable-cli/package.json index 8170b8f8..dfed071c 100644 --- a/packages/composable-cli/package.json +++ b/packages/composable-cli/package.json @@ -25,7 +25,7 @@ "@elasticpath/d2c-schematics": "workspace:*", "@inquirer/prompts": "^3.3.0", "@listr2/prompt-adapter-inquirer": "^2.0.1", - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "@trpc/client": "^10.14.1", "@types/ink": "^2.0.3", "@types/react": "18", diff --git a/packages/composable-common/package.json b/packages/composable-common/package.json index 22d9d7c0..0ed06c42 100644 --- a/packages/composable-common/package.json +++ b/packages/composable-common/package.json @@ -46,7 +46,7 @@ "@angular-devkit/core": "^16.2.8", "@angular-devkit/schematics": "^16.2.8", "@graphql-typed-document-node/core": "^3.2.0", - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "@types/uuid": "^9.0.1", "@urql/core": "^3.2.2", "graphql": "^16.6.0", diff --git a/packages/d2c-schematics/application/files/src/components/number-input/EditQuantityButton.tsx.template b/packages/d2c-schematics/application/files/src/components/number-input/EditQuantityButton.tsx.template index bc37c8f9..eed2eb2b 100644 --- a/packages/d2c-schematics/application/files/src/components/number-input/EditQuantityButton.tsx.template +++ b/packages/d2c-schematics/application/files/src/components/number-input/EditQuantityButton.tsx.template @@ -4,7 +4,7 @@ import { cn } from "../../lib/cn"; import { MinusIcon, PlusIcon } from "@heroicons/react/24/outline"; import { LoadingDots } from "../LoadingDots"; import type { CartItem } from "@moltin/sdk"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartUpdateItem } from "@elasticpath/react-shopper-hooks"; export function EditItemQuantityButton({ item, @@ -13,8 +13,7 @@ export function EditItemQuantityButton({ item: CartItem; type: "plus" | "minus"; }) { - const { useScopedUpdateCartItem } = useCart(); - const { mutate, isPending } = useScopedUpdateCartItem(); + const { mutate, isPending } = useCartUpdateItem(); return ( <> diff --git a/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItem.tsx.template b/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItem.tsx.template index 30fd205d..f2507c48 100644 --- a/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItem.tsx.template +++ b/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItem.tsx.template @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import { NumberInput } from "../../../components/number-input/NumberInput"; import Link from "next/link"; @@ -11,8 +11,7 @@ export type CartItemProps = { }; export function CartItem({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItemWide.tsx.template b/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItemWide.tsx.template index 935733a7..b7421e3c 100644 --- a/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItemWide.tsx.template +++ b/packages/d2c-schematics/cart/files/src/app/(store)/cart/CartItemWide.tsx.template @@ -1,5 +1,5 @@ "use client"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { ProductThumbnail } from "../account/orders/[orderId]/ProductThumbnail"; import Link from "next/link"; import { NumberInput } from "../../../components/number-input/NumberInput"; @@ -7,8 +7,7 @@ import { CartItemProps } from "./CartItem"; import { LoadingDots } from "../../../components/LoadingDots"; export function CartItemWide({ item }: CartItemProps) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return (
diff --git a/packages/d2c-schematics/cart/files/src/components/cart/CartDiscounts.tsx.template b/packages/d2c-schematics/cart/files/src/components/cart/CartDiscounts.tsx.template index f9ec771d..d6090d4e 100644 --- a/packages/d2c-schematics/cart/files/src/components/cart/CartDiscounts.tsx.template +++ b/packages/d2c-schematics/cart/files/src/components/cart/CartDiscounts.tsx.template @@ -2,7 +2,10 @@ import { forwardRef, Fragment, HTMLAttributes } from "react"; import { Separator } from "../separator/Separator"; -import { PromotionCartItem, useCart } from "@elasticpath/react-shopper-hooks"; +import { + PromotionCartItem, + useCartRemoveItem, +} from "@elasticpath/react-shopper-hooks"; import { LoadingDots } from "../LoadingDots"; import { XMarkIcon } from "@heroicons/react/24/solid"; import * as React from "react"; @@ -13,8 +16,7 @@ export function CartDiscounts({ }: { promotions: PromotionCartItem[]; }) { - const { useScopedRemoveCartItem } = useCart(); - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); return ( promotions && diff --git a/packages/d2c-schematics/cart/files/src/components/cart/CartSheet.tsx.template b/packages/d2c-schematics/cart/files/src/components/cart/CartSheet.tsx.template index 6fc6633d..a9bdec9e 100644 --- a/packages/d2c-schematics/cart/files/src/components/cart/CartSheet.tsx.template +++ b/packages/d2c-schematics/cart/files/src/components/cart/CartSheet.tsx.template @@ -11,7 +11,7 @@ import { import { Button } from "../button/Button"; import { LockClosedIcon, XMarkIcon } from "@heroicons/react/24/solid"; import { CartItem } from "../../app/(store)/cart/CartItem"; -import { useCart } from "@elasticpath/react-shopper-hooks"; +import { useCart, useCartRemoveItem } from "@elasticpath/react-shopper-hooks"; import { Separator } from "../separator/Separator"; import { ShoppingBagIcon } from "@heroicons/react/24/outline"; import { Fragment } from "react"; @@ -20,11 +20,11 @@ import Link from "next/link"; import { LoadingDots } from "../LoadingDots"; export function Cart() { - const { state, useScopedRemoveCartItem } = useCart(); + const { state } = useCart(); const { items, __extended } = state ?? {}; - const { mutate, isPending } = useScopedRemoveCartItem(); + const { mutate, isPending } = useCartRemoveItem(); const discountedValues = ( state?.meta?.display_price as diff --git a/packages/d2c-schematics/ep-payments-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template b/packages/d2c-schematics/ep-payments-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template index 7ceb6a2c..b236c72a 100644 --- a/packages/d2c-schematics/ep-payments-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template +++ b/packages/d2c-schematics/ep-payments-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template @@ -10,6 +10,7 @@ import { CartState, useAuthedAccountMember, useCart, + useCartClear, } from "@elasticpath/react-shopper-hooks"; import { zodResolver } from "@hookform/resolvers/zod"; import { Form } from "../../../components/form/Form"; @@ -47,9 +48,9 @@ type CheckoutProviderProps = { }; export function StripeCheckoutProvider({ children }: CheckoutProviderProps) { - const { state, useClearCart } = useCart(); + const { state } = useCart(); - const { mutateAsync: mutateClearCart } = useClearCart(); + const { mutateAsync: mutateClearCart } = useCartClear(); const [confirmationData, setConfirmationData] = useState["data"]>(undefined); diff --git a/packages/d2c-schematics/manual-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template b/packages/d2c-schematics/manual-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template index b03b4f94..a555c047 100644 --- a/packages/d2c-schematics/manual-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template +++ b/packages/d2c-schematics/manual-payment-gateway/files/src/app/(checkout)/checkout/checkout-provider.tsx.template @@ -10,6 +10,7 @@ import { CartState, useAuthedAccountMember, useCart, + useCartClear, } from "@elasticpath/react-shopper-hooks"; import { zodResolver } from "@hookform/resolvers/zod"; import { Form } from "../../../components/form/Form"; @@ -35,9 +36,9 @@ type CheckoutProviderProps = { }; export function CheckoutProvider({ children }: CheckoutProviderProps) { - const { state, useClearCart } = useCart(); + const { state } = useCart(); - const { mutateAsync: mutateClearCart } = useClearCart(); + const { mutateAsync: mutateClearCart } = useCartClear(); const [confirmationData, setConfirmationData] = useState["data"]>(undefined); diff --git a/packages/d2c-schematics/package.json b/packages/d2c-schematics/package.json index febef97c..29a82a45 100644 --- a/packages/d2c-schematics/package.json +++ b/packages/d2c-schematics/package.json @@ -24,7 +24,7 @@ "@angular-devkit/schematics": "^16.2.8", "@elasticpath/composable-common": "workspace:*", "@elasticpath/composable-integration-hub-deployer": "workspace:*", - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "@trpc/client": "^10.14.1", "algoliasearch": "^4.15.0", "ansi-colors": "4.1.3", diff --git a/packages/d2c-schematics/product-details-page/files/src/components/product/SimpleProduct.tsx.template b/packages/d2c-schematics/product-details-page/files/src/components/product/SimpleProduct.tsx.template index 4b1e1bf7..dbc28d73 100644 --- a/packages/d2c-schematics/product-details-page/files/src/components/product/SimpleProduct.tsx.template +++ b/packages/d2c-schematics/product-details-page/files/src/components/product/SimpleProduct.tsx.template @@ -2,7 +2,7 @@ import type { SimpleProduct } from "@elasticpath/react-shopper-hooks"; import { SimpleProductProvider, - useCart, + useCartAddProduct, useSimpleProduct, } from "@elasticpath/react-shopper-hooks"; import ProductCarousel from "./carousel/ProductCarousel"; @@ -27,8 +27,7 @@ function SimpleProductDetail({ function SimpleProductContainer(): JSX.Element { const { product } = useSimpleProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { main_image, response, otherImages } = product; const { extensions } = response.attributes; diff --git a/packages/d2c-schematics/product-details-page/files/src/components/product/bundles/BundleProduct.tsx.template b/packages/d2c-schematics/product-details-page/files/src/components/product/bundles/BundleProduct.tsx.template index 1113c3f9..39f88f94 100644 --- a/packages/d2c-schematics/product-details-page/files/src/components/product/bundles/BundleProduct.tsx.template +++ b/packages/d2c-schematics/product-details-page/files/src/components/product/bundles/BundleProduct.tsx.template @@ -5,7 +5,7 @@ import { BundleProduct, BundleProductProvider, useBundle, - useCart, + useCartAddBundleItem, } from "@elasticpath/react-shopper-hooks"; import { useCallback, useMemo } from "react"; import { @@ -37,9 +37,8 @@ const BundleProductDetail = ({ function BundleProductContainer(): JSX.Element { const { configuredProduct, selectedOptions, components } = useBundle(); - const { useScopedAddBundleProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddBundleProductToCart(); + const { mutate, isPending } = useCartAddBundleItem(); const submit = useCallback( async (values: { selectedOptions: FormSelectedOptions }) => { diff --git a/packages/d2c-schematics/product-details-page/files/src/components/product/variations/VariationProduct.tsx.template b/packages/d2c-schematics/product-details-page/files/src/components/product/variations/VariationProduct.tsx.template index e486c43d..77fb2bc4 100644 --- a/packages/d2c-schematics/product-details-page/files/src/components/product/variations/VariationProduct.tsx.template +++ b/packages/d2c-schematics/product-details-page/files/src/components/product/variations/VariationProduct.tsx.template @@ -1,6 +1,6 @@ "use client"; import { - useCart, + useCartAddProduct, useVariationProduct, VariationProduct, VariationProductProvider, @@ -26,8 +26,7 @@ export const VariationProductDetail = ({ export function VariationProductContainer(): JSX.Element { const { product } = useVariationProduct(); - const { useScopedAddProductToCart } = useCart(); - const { mutate, isPending } = useScopedAddProductToCart(); + const { mutate, isPending } = useCartAddProduct(); const { response, main_image, otherImages } = product; const { extensions } = response.attributes; diff --git a/packages/d2c-schematics/utility/latest-versions/package.json b/packages/d2c-schematics/utility/latest-versions/package.json index bebe55dd..f15dc628 100644 --- a/packages/d2c-schematics/utility/latest-versions/package.json +++ b/packages/d2c-schematics/utility/latest-versions/package.json @@ -3,9 +3,9 @@ "comment": "This file is needed so that dependencies are synced by Renovate.", "private": true, "dependencies": { - "@moltin/sdk": "^27.6.0", - "@elasticpath/react-shopper-hooks": "0.7.1", - "@elasticpath/shopper-common": "0.2.1", + "@moltin/sdk": "28.12.0", + "@elasticpath/react-shopper-hooks": "0.9.0", + "@elasticpath/shopper-common": "0.3.0", "clsx": "^1.2.1", "cookies-next": "^4.0.0", "focus-visible": "^5.2.0", diff --git a/packages/react-shopper-hooks/package.json b/packages/react-shopper-hooks/package.json index 6a95a5b2..45573450 100644 --- a/packages/react-shopper-hooks/package.json +++ b/packages/react-shopper-hooks/package.json @@ -31,7 +31,7 @@ "dist" ], "devDependencies": { - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "@storybook/addon-essentials": "^7.5.3", "@storybook/addon-interactions": "^7.5.3", "@storybook/addon-links": "^7.5.3", @@ -59,7 +59,7 @@ "vitest": "^0.31.1" }, "peerDependencies": { - "@moltin/sdk": "^27.0.0", + "@moltin/sdk": "28.12.0", "@tanstack/react-query": "^5.8.4", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/packages/react-shopper-hooks/tsconfig.json b/packages/react-shopper-hooks/tsconfig.json index 8126eff5..6ca94e42 100644 --- a/packages/react-shopper-hooks/tsconfig.json +++ b/packages/react-shopper-hooks/tsconfig.json @@ -14,7 +14,7 @@ "sourceMap": true, "resolveJsonModule": true, "esModuleInterop": true, - "skipLibCheck": true, + "skipLibCheck": true, // TODO remove this when we fix the js-sdk "types": [ "vite/client" ], diff --git a/packages/shopper-common/package.json b/packages/shopper-common/package.json index 17ef2ab6..f4b7b911 100644 --- a/packages/shopper-common/package.json +++ b/packages/shopper-common/package.json @@ -37,7 +37,7 @@ "vitest": "^0.29.7" }, "dependencies": { - "@moltin/sdk": "^27.6.0", + "@moltin/sdk": "28.12.0", "tslib": "^2.6.2" }, "publishConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 383e06e9..d336a7a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -154,8 +154,8 @@ importers: specifier: ^3.3.2 version: 3.3.4(react-hook-form@7.49.3) '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) '@radix-ui/react-accordion': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) @@ -368,8 +368,8 @@ importers: specifier: ^3.3.2 version: 3.3.4(react-hook-form@7.49.3) '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) '@radix-ui/react-accordion': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) @@ -576,8 +576,8 @@ importers: specifier: ^3.3.2 version: 3.3.4(react-hook-form@7.49.3) '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) '@radix-ui/react-accordion': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) @@ -775,8 +775,8 @@ importers: specifier: ^2.0.1 version: 2.0.1(@inquirer/prompts@3.3.0) '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) '@trpc/client': specifier: ^10.14.1 version: 10.42.0(@trpc/server@10.42.0) @@ -987,8 +987,8 @@ importers: specifier: ^3.2.0 version: 3.2.0(graphql@16.8.1) '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) '@types/uuid': specifier: ^9.0.1 version: 9.0.6 @@ -1112,8 +1112,8 @@ importers: specifier: workspace:* version: link:../composable-integration-hub-deployer '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) '@trpc/client': specifier: ^10.14.1 version: 10.42.0(@trpc/server@10.42.0) @@ -1238,8 +1238,8 @@ importers: version: 7.5.7 devDependencies: '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) '@storybook/addon-essentials': specifier: ^7.5.3 version: 7.5.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) @@ -1319,8 +1319,8 @@ importers: packages/shopper-common: dependencies: '@moltin/sdk': - specifier: ^27.6.0 - version: 27.6.0(encoding@0.1.13) + specifier: 28.12.0 + version: 28.12.0(encoding@0.1.13) tslib: specifier: ^2.6.2 version: 2.6.2 @@ -8824,8 +8824,8 @@ packages: resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} dev: true - /@moltin/sdk@27.6.0(encoding@0.1.13): - resolution: {integrity: sha512-g+90RgESjP1uuZ1XjxxNWzXRpGTnf6jxnTL7ieKpUe263QNq5ISgUA+VqPdyuCdMrXuu3BlRRFjlxmCiSbogIw==} + /@moltin/sdk@28.12.0(encoding@0.1.13): + resolution: {integrity: sha512-dSR1TKxAVBLu7VqXW7mVcvl0/fRP0DnCUpwyfvPnsytnlAXVrs1NrScsjnBZypLty1ytJaz0QsMziIv6qPR/TA==} dependencies: cross-fetch: 3.1.8(encoding@0.1.13) es6-promise: 4.2.8