Skip to content

Export the account links and the prop types v5 left unreachable - #947

Merged
acasazza merged 1 commit into
mainfrom
fix/export-account-links-and-prop-types
Nov 20, 2026
Merged

acasazza merged 1 commit into
mainfrom
fix/export-account-links-and-prop-types

Conversation

@acasazza

Copy link
Copy Markdown
Member

What

Re-exports from the root barrel what v5 left unreachable after dropping the subpath exports:

  • Components: MyAccountLink, MyIdentityLink. Both were absent from dist in every v5 release (tree-shaken out, since nothing referenced them).
  • Prop types of public components: Country, States (AddressCountrySelector, AddressStateSelector), TypeAccepted (LineItemsCount), CustomerCardsTemplateChildren (PaymentSource), BaseInputProps (PrivacyAndTermsCheckbox).

Fixes #946

Guard against the next one

specs/utils/public-api.spec.ts imports every module under src/components and fails if any of its named exports is missing from src/index.ts. payment_gateways/*, payment_source/*Payment and components/utils/* are excluded, since those are internal on purpose (see #834).

Checked red/green: without the barrel change the spec fails on exactly MyAccountLink and MyIdentityLink; 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 built dist/index.d.ts.

Side fix in vitest.config.mts

No 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 #typings key came before #typings/errors and rewrote it to src/typings/index/errors. The specific keys now come first.

Verification

  • pnpm typecheck clean
  • pnpm build: all seven names are in the export {} of dist/index.d.ts, and MyAccountLink is back in dist/index.js
  • Full suite via pre-commit: 1340/1340

🤖 Generated with Claude Code

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
@acasazza acasazza added bug Something isn't working components Components package labels Nov 20, 2026
@acasazza acasazza self-assigned this Nov 20, 2026
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for commercelayer-react-components ready!

Name Link
🔨 Latest commit 27430c3
🔍 Latest deploy log https://app.netlify.com/projects/commercelayer-react-components/deploys/6b0075caecfb5ade766f86b3
😎 Deploy Preview https://deploy-preview-947--commercelayer-react-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@acasazza
acasazza merged commit 7a4a268 into main Nov 20, 2026
8 checks passed
@acasazza
acasazza deleted the fix/export-account-links-and-prop-types branch November 20, 2026 17:11
This was referenced Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working components Components package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MyAccountLink, MyIdentityLink and five component prop types are not exported in v5

2 participants