Repository navigation
fix(cli): the export reader follows an alias of an imported binding - #10471
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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.mdfiles this as[chore] Internal, butastryx integration checknow compares an icon set's theme map written asexport const themeIcons = base(and reportsicon_theme_map_mismatchwhere it used to list the map as not checked), andastryx experimental icon new-setnow records icons exported asexport 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]
There was a problem hiding this comment.
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.mdsaysastryx swizzle"uses the same reader, so a component that imports an aliased public export imports it from the package", but swizzle does not callmoduleExportOriginormoduleExportOriginshere andastryx swizzle Buttonwrites 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]
There was a problem hiding this comment.
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-checkstest with an aliased theme map would keep the newicon_theme_map_mismatchpath 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]
User impact
This is groundwork for
astryx swizzle(#10197), and it also changes two experimental icon-set commands (below). Core's public@astryxdesign/core/i18nentry exportsInternationalizationContextas 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 ofi18n/InternationalizationContext.tsinto 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 anfr-FRprovider where the package shows "Chargement".Change
export const X = Ywhose value is another binding is that binding: the reader followsY(through its import, when it is one) inmoduleExportOriginandmoduleExportOriginsalike.astryx integration checknow compares a theme map written asexport const themeIcons = base(it can reporticon_theme_map_mismatchwhere it listed the map as not checked), andastryx experimental icon new-setrecords an icon exported asexport const X = Y.Evidence
module-exports.test.mjscase (an alias of an imported binding) fails onmainfor both readers.packages/cli/foundation/discovery,packages/cli/api/swizzleandpackages/cli/api/doctorpass (1,252 tests); the CLI's stricttscpasses.Scope
CLI owner review requested.