Skip to content

Commit

Permalink
Further cleanup of unused methods and files
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Dec 17, 2024
1 parent 7a92df9 commit 818a66e
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 550 deletions.
8 changes: 7 additions & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ const asPackageDir: WorkspaceEntry = {
'index.js',
'src/index.ts',
],
entry: ['plugins/**/*.{ts,tsx}', 'src/bin/*.ts', '**/resolvers.ts', '**/resolver.ts'],
entry: [
'plugins/**/*.{ts,tsx}',
'src/bin/*.ts',
'**/resolvers.ts',
'**/resolver.ts',
'**/*Resolver.ts',
],
}

const asNextjsDir: WorkspaceEntry = {
Expand Down
46 changes: 0 additions & 46 deletions packages/framer-next-pages/example/components/StackedDrawer.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export type AccountLatestOrderProps = AccountOrdersFragment & {
loading: boolean
}

/**
* @deprecated
* @public
*/
export function AccountLatestOrder(props: AccountLatestOrderProps) {
const { orders, loading } = props
const latestOrderCard = orders?.items?.[(orders?.items?.length ?? 1) - 1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import type { FieldPath, FieldValues } from '@graphcommerce/ecommerce-ui'
import { SelectElement, TextFieldElement, useWatch } from '@graphcommerce/ecommerce-ui'
import { useQuery } from '@graphcommerce/graphql'
import { CountryRegionsDocument } from '@graphcommerce/magento-store'
import { FormRow, filterNonNullableKeys } from '@graphcommerce/next-ui'
import { filterNonNullableKeys, FormRow } from '@graphcommerce/next-ui'
import { Trans } from '@lingui/react'
import { useMemo } from 'react'
import type { AddressFieldsOptions } from './useAddressFieldsForm'
import { useAddressFieldsForm } from './useAddressFieldsForm'

/** @public */
export function useAddressCountryRegion<
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export type OrderCardItemProps = OrderCardItemFragment & {
thumbnail?: Pick<ProductImage, 'label' | 'url'>
}

/**
* @deprecated
* @public
*/
export function OrderCardItem(props: OrderCardItemProps) {
const { product_sku, product_url_key, thumbnail } = props

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type InlineSignInFormProps = Omit<SignInMutationVariables, 'password'> &

const { classes } = extendableComponent('SignInFormInline', ['form', 'button'] as const)

/** @public */
export function SignInFormInline(props: InlineSignInFormProps) {
const { email, children, sx = [] } = props
const form = useSignInForm({ email })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export type AdyenPaymentResponse = {
additionalData?: Types.checkout.PaymentResponse['additionalData']
}

/**
* @deprecated Will be removed
* @public
*/
export function parsePaymentResponse(
status?: AdyenPaymentResponseFragment | null,
): AdyenPaymentResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const Field = React.forwardRef<any, { ownerState: unknown; as: string }>((props,
return <Box {...rest} ref={ref} sx={{ height: 54, width: '100%' }} />
})

/** @public */
export function BraintreeField<T extends FieldValues>(
props: {
hostedFields: HostedFields | undefined
Expand Down Expand Up @@ -259,7 +260,10 @@ export function PaymentMethodOptions(props: PaymentOptionsProps) {

const loading = !hostedFields

/** This is the form that the user can fill in. In this case we don't wat the user to fill in anything. */
/**
* This is the form that the user can fill in. In this case we don't wat the user to fill in
* anything.
*/
return (
<FormProvider {...form}>
<form onSubmit={submit}>
Expand Down
2 changes: 2 additions & 0 deletions packages/magento-payment-braintree/utils/isBraintreeError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import type { BraintreeError } from 'braintree-web'

const errorTypes = ['CUSTOMER', 'MERCHANT', 'NETWORK', 'INTERNAL', 'UNKNOWN']

/** @public */
export function isBraintreeError(e: unknown): e is BraintreeError {
return errorTypes.includes((e as BraintreeError).type) && e instanceof Error
}

/** @public */
export function isBraintreeCustomerError(e: unknown): e is BraintreeError {
return isBraintreeError(e) && e.type === 'CUSTOMER'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { Money } from '@graphcommerce/magento-store'
import { Typography } from '@mui/material'
import type { BundleProductCartItemOptionsProps } from '../BundleProductCartItemOptions/BundleProductCartItemOptions'

/**
* @deprecated
* @public
*/
export function BundleCartItem(props: BundleProductCartItemOptionsProps) {
const { bundle_options } = props
return (
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 818a66e

Please sign in to comment.