Skip to content

fix(cli): integration verify reads exports with the reader discovery uses - #7660

Merged
josephfarina merged 1 commit into
mainfrom
josephfarina/verify-folder-reexport
Oct 18, 2026
Merged

josephfarina merged 1 commit into
mainfrom
josephfarina/verify-folder-reexport

Conversation

@josephfarina

@josephfarina josephfarina commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

astryx integration verify and discovery read a package's exports with two different readers, so verify can contradict what component, search and the list already accept:

  • An integration whose entry re-exports a folder (export * from './primitives', with primitives/index.ts re-exporting the components) fails verify with component_export_missing for every component reached through that folder. TypeScript and bundlers load the folder's index file, so the package works in apps built with them, but it cannot pass the check that comes before publishing without rewriting its re-exports to name files.
  • A type-only re-export (export type {AcmeWidget} from './AcmeWidget') passes verify as if it exported the component, though an app importing it gets nothing at runtime.

Problem and solution fit

  • Why verify disagrees: the pack check kept a private copy of the static export reader. The copy resolves a relative specifier to the first candidate that exists, so a folder resolves to itself and cannot be read, and it counts a type-only export as a runtime one. Discovery's reader in foundation/discovery/module-exports.mjs resolves a folder to its index file and skips type-only and declare exports.
  • Why it matters: integration verify is the gate before publishing. A false failure blocks a correct package, and a false pass ships a component apps cannot import.
  • The fix: verify uses discovery's reader, and the private copy is deleted, so the two cannot drift apart again.

Expected behavior and authority

architecture:cli-surface INV17: integration verify fails when the packed artifact has no usable public export, not when it has one. Discovery's reader already implements that reading for every other surface.

Smallest restoration

api/integration/pack-check.mjs imports moduleExportsName from foundation/discovery/module-exports.mjs and deletes its private reader: the jscodeshift parser, its module resolver and its own moduleExportsName. The call sites are unchanged. No other behavior changes.

Evidence

  • Reproduction before the change: the folder test fails with component_export_missing, "packed module does not export "AcmeWidget"", and the type-only test passes verify with no issue.
  • Result after the change: the folder package is packable with no issues, and the type-only package reports component_export_missing.
  • Representative unchanged path: all 14 test files under api/integration pass (321 tests), including the existing re-export, exports-map and missing-export cases.
  • Regression tests: pack-check.test.mjs › "follows a re-export of a folder to its index file" and "does not count a type-only re-export as the component". Each fails on the private reader.

Overlaps

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 18, 2026 1:18am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 18, 2026, 1:41 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 17, 2026
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

40 of 478 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 20 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review recommends approving the fix: integration verify now follows a folder re-export to its index file, the new regression test fails without the change and passes with it, and the existing integration tests still pass. No changes are required. One optional wording fix: the new test's comment says Node loads a folder's index file, but Node's ESM loader rejects directory imports, so "TypeScript and bundlers", as in the code comment and changeset, is the accurate reason.

[Automated review]

});

it('follows a re-export of a folder to its index file', async () => {
// `./primitives` names a folder: Node and TypeScript load its index file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional wording: Node's ESM loader rejects directory imports (ERR_UNSUPPORTED_DIR_IMPORT); only CommonJS require, TypeScript and bundlers load the folder's index. Matching the code comment and changeset avoids implying the check models Node ESM:

    // `./primitives` names a folder: TypeScript and bundlers load its index file.

…uses

The pack check kept a private copy of the static export reader. It read a
folder named by a relative re-export as a module and counted a type-only
re-export as the component, so integration verify disagreed with discovery.
Verify now uses the shared reader in foundation/discovery/module-exports.mjs,
and the private copy is deleted.
@josephfarina
josephfarina force-pushed the josephfarina/verify-folder-reexport branch from 83b061e to 35cf936 Compare October 18, 2026 01:13
@josephfarina josephfarina changed the title fix(cli): integration verify follows a folder re-export to its index file fix(cli): integration verify reads exports with the reader discovery uses Oct 18, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

Widened this fix: instead of patching the folder case in the pack check's private export reader, integration verify now uses the reader discovery uses, and the private copy is deleted. An audit of the doc-names work found the two readers disagreeing beyond folders. For example, a type-only re-export passed verify as if it exported the component. One shared reader closes the whole class. The folder test is unchanged, and a type-only test was added; it fails on the private reader. The description is updated.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review recommends approving the change: integration verify now reads exports with the shared reader, so a component re-exported through a folder's index file passes and a type-only re-export no longer counts as the component, and both new tests fail without the change and pass with it. No changes are required. One optional follow-up outside this diff: for an extensionless re-export the shared reader tries a same-stem .cjs before .ts and .tsx, which TypeScript and common bundlers do not, so a source folder holding both files would now fail verify.

[Automated review]

This branch was successfully deployed

1 active deployment
Preview — 35cf936d Deployed Oct 18, 2026 by vercel[bot]
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