Repository navigation
Export the account links and the prop types v5 left unreachable - #947
Merged
Merged
Conversation
v5 dropped the subpath exports, and these were public only through them: the two account links (./customers/*) and the prop types of AddressCountrySelector, AddressStateSelector, LineItemsCount, PaymentSource and PrivacyAndTermsCheckbox. The links were tree-shaken out of dist entirely, so consumers could not recover them. Add a guard spec that imports every component module and fails when a named export is missing from the root barrel. Importing the barrel from vitest required reordering the #typings aliases: the bare key matched first and rewrote #typings/errors to src/typings/index/errors. Fixes #946
✅ Deploy Preview for commercelayer-react-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
malessani
approved these changes
Nov 20, 2026
This was referenced Nov 20, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Re-exports from the root barrel what v5 left unreachable after dropping the subpath exports:
MyAccountLink,MyIdentityLink. Both were absent fromdistin every v5 release (tree-shaken out, since nothing referenced them).Country,States(AddressCountrySelector,AddressStateSelector),TypeAccepted(LineItemsCount),CustomerCardsTemplateChildren(PaymentSource),BaseInputProps(PrivacyAndTermsCheckbox).Fixes #946
Guard against the next one
specs/utils/public-api.spec.tsimports every module undersrc/componentsand fails if any of its named exports is missing fromsrc/index.ts.payment_gateways/*,payment_source/*Paymentandcomponents/utils/*are excluded, since those are internal on purpose (see #834).Checked red/green: without the barrel change the spec fails on exactly
MyAccountLinkandMyIdentityLink; with it, 121/121 pass.It covers runtime exports only. Types disappear at runtime and specs are outside
tsconfig.typecheck.json, so the five types are added explicitly and were verified in the builtdist/index.d.ts.Side fix in
vitest.config.mtsNo spec had ever imported the barrel, and doing so failed with
Failed to resolve import "#typings/errors". Vite object aliases match by prefix in insertion order, so the bare#typingskey came before#typings/errorsand rewrote it tosrc/typings/index/errors. The specific keys now come first.Verification
pnpm typecheckcleanpnpm build: all seven names are in theexport {}ofdist/index.d.ts, andMyAccountLinkis back indist/index.js🤖 Generated with Claude Code