Skip to content

fix(packaging): auto-discover component exports in source tarball - #199

Merged
cixzhang merged 1 commit into
mainfrom
navi/fix/package-source-exports
Feb 20, 2026
Merged

cixzhang merged 1 commit into
mainfrom
navi/fix/package-source-exports

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

What

The package-source.js script only included exports that were already in packages/core/package.json. 20 component directories (TopNav, TabList, Slider, Switch, NumberInput, RadioList, Table, StatusDot, etc.) were missing from the tarball's exports map.

Why

Consumers using subpath imports like @xds/core/TopNav got Module not found errors even though the source files were in the tarball. This was hit during the theme builder v2 exercise on cixzhang/xds_sandbox.

Fix

Auto-discovers all component directories with an index.ts in packages/core/src/ and adds them to the exports map if not already present. This is a fallback — the core package.json should still be the source of truth, but consumers won't hit silent failures when new components are added.

Before: 22 exports. After: 43 exports (all component directories covered).


Crafted with care by Navi

The package-source.js script only included exports that were already
in packages/core/package.json. Components like TopNav, TabList, Slider,
Switch, NumberInput, RadioList, Table, StatusDot, and 12 others were
missing from the tarball's exports map — causing 'Module not found'
errors when consumers used subpath imports like @xds/core/TopNav.

Now auto-discovers all component directories with an index.ts and adds
them to exports if not already present. This is a fallback — the core
package.json should still be the source of truth, but consumers won't
hit silent failures when new components are added without updating the
exports map.

Co-authored-by: Navi <[email protected]>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 6.2KB 10.2KB 1.6KB

Accessibility Audit

Status: 49 accessibility violation(s) found.

XDSAspectRatio - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSAvatar - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSBadge - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSButton - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCalendar - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCard - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSCenter - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCheckboxInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCloseButton - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDateInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDialog - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDivider - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDropdownMenu - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSEmptyState - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSField - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSFontWrapper - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSGrid - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSHStack - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSHeading - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSHoverCard - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSIcon - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSLayout - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSLink - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSNumberInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSProgressBar - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSRadioList - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSection - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSSelector - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSkeleton - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSlider - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSpinner - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSStackItem - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSStatusDot - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSwitch - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTabList - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTable - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
Selection - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSText - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSTextArea - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTextInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTimeInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTooltip - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTopNav - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSVStack - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name

Generated by PR Enrichment workflow | Storybook | View full report

@cixzhang
cixzhang merged commit 2f7cb83 into main Feb 20, 2026
5 checks passed
@cixzhang
cixzhang deleted the navi/fix/package-source-exports branch February 20, 2026 14:41
cixzhang added a commit that referenced this pull request Apr 26, 2026
The package-source.js script only included exports that were already
in packages/core/package.json. Components like TopNav, TabList, Slider,
Switch, NumberInput, RadioList, Table, StatusDot, and 12 others were
missing from the tarball's exports map — causing 'Module not found'
errors when consumers used subpath imports like @xds/core/TopNav.

Now auto-discovers all component directories with an index.ts and adds
them to exports if not already present. This is a fallback — the core
package.json should still be the source of truth, but consumers won't
hit silent failures when new components are added without updating the
exports map.

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
The package-source.js script only included exports that were already
in packages/core/package.json. Components like TopNav, TabList, Slider,
Switch, NumberInput, RadioList, Table, StatusDot, and 12 others were
missing from the tarball's exports map — causing 'Module not found'
errors when consumers used subpath imports like @xds/core/TopNav.

Now auto-discovers all component directories with an index.ts and adds
them to exports if not already present. This is a fallback — the core
package.json should still be the source of truth, but consumers won't
hit silent failures when new components are added without updating the
exports map.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant