Skip to content

fix(cli): the export reader follows an alias of an imported binding - #10471

Merged
cixzhang merged 4 commits into
mainfrom
fix/export-alias-origin
Nov 7, 2026
Merged

cixzhang merged 4 commits into
mainfrom
fix/export-alias-origin

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

User impact

This is groundwork for astryx swizzle (#10197), and it also changes two experimental icon-set commands (below). Core's public @astryxdesign/core/i18n entry exports InternationalizationContext as an alias (export const InternationalizationContext = ProviderContext). The shared export reader stopped at the alias, so swizzle saw the context as defined in the alias module and carried its own copy of i18n/InternationalizationContext.ts into 62 Core copies (Button, Dialog, Table, DateInput, PowerSearch and others). A copied Button then read a different React context than the app's provider and showed "Loading" under an fr-FR provider where the package shows "Chargement".

Change

  • An export const X = Y whose value is another binding is that binding: the reader follows Y (through its import, when it is one) in moduleExportOrigin and moduleExportOrigins alike.
  • Effect on experimental icon sets: astryx integration check now compares a theme map written as export const themeIcons = base (it can report icon_theme_map_mismatch where it listed the map as not checked), and astryx experimental icon new-set records an icon exported as export const X = Y.

Evidence

  • Red first: the new module-exports.test.mjs case (an alias of an imported binding) fails on main for both readers.
  • After: it passes; packages/cli/foundation/discovery, packages/cli/api/swizzle and packages/cli/api/doctor pass (1,252 tests); the CLI's strict tsc passes.

Scope

  • One change: the reader follows export aliases.
  • No new public API.
  • Public text contains no internal Meta context.

CLI owner review requested.

An exported const whose value is another binding is that binding: an
alias of an imported value (Core's public i18n context re-exports the
provider's context this way) now has the imported value's origin in
moduleExportOrigin and moduleExportOrigins alike.
@vercel

vercel Bot commented Nov 7, 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 Nov 7, 2026 7:44am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 7, 2026
@astracat-bot

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 7:52 AM UTC

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 16c9ef0

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 3.48 MB packed (+262 B); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 25 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes: the reader change looks correct and CI is green, but the release note does not describe what it changes.

  • .changeset/cli-export-alias-origin.md files this as [chore] Internal, but astryx integration check now compares an icon set's theme map written as export const themeIcons = base (and reports icon_theme_map_mismatch where it used to list the map as not checked), and astryx experimental icon new-set now records icons exported as export const X = Y, so AST-084 FR0 and AST-017 FR22 call for an [experimental] changeset that names those icon-set effects.

Please also correct the description's "no command output changes" line. Optional: a case in icon-set-checks.test.mjs with an aliased theme map would lock in the new check path.

[Automated review]

Comment thread .changeset/cli-export-alias-origin.md Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes: the changeset now describes the icon-set effects correctly, but its new swizzle sentence describes a change this pull request does not make.

  • .changeset/cli-export-alias-origin.md says astryx swizzle "uses the same reader, so a component that imports an aliased public export imports it from the package", but swizzle does not call moduleExportOrigin or moduleExportOrigins here and astryx swizzle Button writes identical files before and after this change, so please delete that sentence and let #10197's changeset describe the swizzle effect.

The reader change and its red-first test look correct. Optional: a case in icon-set-checks.test.mjs with an aliased theme map would lock in the new check path.

[Automated review]

Comment thread .changeset/cli-export-alias-origin.md Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: the required test, build and docsite-test checks are deferred on this head and run in the pre-merge re-run.

The changeset now names exactly the two experimental icon-set commands whose results change, and the new reader test fails before the change and passes after it. Two optional follow-ups:

  • An icon-set-checks test with an aliased theme map would keep the new icon_theme_map_mismatch path from regressing.
  • The description's User impact could say the 62-copy symptom occurs with #10197's swizzle, as its opening line does.

[Automated review]

@cixzhang
cixzhang merged commit adb7566 into main Nov 7, 2026
105 of 108 checks passed
@github-actions
github-actions Bot deleted the fix/export-alias-origin branch November 8, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 16c9ef05 Deployed Nov 7, 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