From d5d9d39883daca68b74946bc04bbae8df057873b Mon Sep 17 00:00:00 2001 From: Alessandro Casazza Date: Fri, 20 Nov 2026 19:29:59 +0100 Subject: [PATCH] Export the utils prop types #947 left out v4 exposed every type in components/utils through ./component_utils/*. #947 restored CustomerCardsTemplateChildren for PaymentSource but not its twin AddressCardsTemplateChildren for Address, nor BaseFieldProps (OrderNumber) and TGenericChildrenProps (the *Field components), which needs TResources to be usable. The public-api spec cannot catch these: it checks runtime exports only and skips components/utils. Say so in its comment. --- packages/react-components/specs/utils/public-api.spec.ts | 4 ++++ packages/react-components/src/index.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/packages/react-components/specs/utils/public-api.spec.ts b/packages/react-components/specs/utils/public-api.spec.ts index a430e187..57adbfd9 100644 --- a/packages/react-components/specs/utils/public-api.spec.ts +++ b/packages/react-components/specs/utils/public-api.spec.ts @@ -7,6 +7,10 @@ import * as barrel from "../../src/index" * `dist` entirely. Its own spec still passes, because specs import from the * source file. This guard fails as soon as a component module exports * something the root barrel does not. + * + * Runtime exports only: types vanish at runtime, and `components/utils` is + * skipped below, so the types public props rely on are listed by hand in + * `src/index.ts`. */ // Internal on purpose: gateways are picked by `PaymentGateway` from the diff --git a/packages/react-components/src/index.ts b/packages/react-components/src/index.ts index 3c846a20..5c7fbc2d 100644 --- a/packages/react-components/src/index.ts +++ b/packages/react-components/src/index.ts @@ -132,7 +132,10 @@ export type { PaypalConfig } from "#components/payment_source/PaypalPayment" export type { StripeConfig } from "#components/payment_source/StripePayment" export type { WireTransferConfig } from "#components/payment_source/WireTransferPayment" export type { PaymentMethodConfig, PaymentResource } from "#reducers/PaymentMethodReducer" +export type { AddressCardsTemplateChildren } from "#components/utils/AddressCardsTemplate" export type { BaseInputProps } from "#components/utils/BaseInput" +export type { BaseFieldProps } from "#components/utils/BaseField" export type { CustomerCardsTemplateChildren } from "#components/utils/PaymentCardsTemplate" +export type { TGenericChildrenProps, TResources } from "#components/utils/GenericFieldComponent" export type { Country, States } from "#utils/countryStateCity" export type { TypeAccepted } from "#utils/getLineItemsCount"