Skip to content

fix(cli): a kept template icon from a library subpath names the library the set wraps - #12412

Merged
josephfarina merged 1 commit into
mainfrom
josephfarina/template-kept-icon-wrapped-library
Nov 17, 2026
Merged

josephfarina merged 1 commit into
mainfrom
josephfarina/template-kept-icon-wrapped-library

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

User impact

In a project whose main icon set wraps a library (for example a set made from @heroicons/react/24/outline), copying a template that imports an icon from another subpath of that library (HomeIcon from @heroicons/react/24/solid) keeps the import, as it should. But the copy report says it already comes from @heroicons/react/24/solid, which <set> wraps. The set wraps the library package, not that subpath, so the reason tells the reader something false about their set.

Problem and solution fit

  1. Why is it wrong? The kept reason prints the import's module, while the decision to keep it compares the set's source.package with the module or a subpath of it.
  2. Why does it matter? A reader who trusts the report thinks the set was built from the solid icons, and may look for a variant or a set that does not exist.
  3. Why this fix? The reason now names both: the module the template imports and, when it is a subpath, the library the set wraps. The copied file is unchanged.

Expected behavior and authority

AST-084 FR10: a template icon from the library a listed set wraps is kept, and the report says why. The set's source names the library package.

Smallest restoration

One change to the kept reason text in foundation/discovery/template-icons.mjs. An import from the package root reads as before.

Evidence

  • Reproduction before the change: the main set wraps @heroicons/react, and astryx template AppShellTopNavWithSideNav src/Shell.tsx printed icons: kept HomeIcon (@heroicons/react/24/solid): it already comes from @heroicons/react/24/solid, which <set> wraps (the same text in JSON icons.kept[].reason).
  • Result after the change: it already comes from @heroicons/react/24/solid, part of @heroicons/react, which <set> wraps.
  • Representative unchanged path: an import from the package root keeps it already comes from @acme/library, which @acme/wrapper/wrapper wraps (existing tests).
  • Regression test: names the library a set wraps when the template imports one of its subpaths in template-icons.test.mjs, for the main set and for a backup set. It failed before the fix.

Scope

Components: cli (template icon copy report)

  • 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

CI=1 pnpm exec vitest run --project node packages/cli/foundation/discovery packages/cli/api/template packages/cli/clients/cli/commands/template*.test.mjs: all pass except the two locale example tests (use-collator, use-locale), which fail the same way on clean main on this machine.

@vercel

vercel Bot commented Nov 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 Nov 17, 2026 9:00pm UTC

Request Review

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

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 9:06 PM UTC

@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 test, typecheck and build jobs have not finished on this head yet, and the merge guard waits for them.

The kept-icon reason now names the package a set's source records when a template imports from one of its subpaths, which is the library the icon-set spec says the set wraps, and the new test fails before the fix and passes after it. Nothing else needs to change.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset: an experimental patch note for the CLI: verified (changeset lines 2 and 5).
  • Changeset and description: a kept icon from a subpath now reads …/24/solid, part of @heroicons/react, which <set> wraps: verified (template-icons.mjs:1247-1259, template-icons.test.mjs:822).
  • Description: the keep decision compares the set's source package with the module or a subpath of it, while the old reason printed only the module: verified (template-icons.mjs:520-525).
  • Description: the copied file is unchanged: verified (template-icons.test.mjs:821, and the mapper run over the shipped block).
  • Description: an import from the package root reads as before: verified (template-icons.test.mjs:778, :782, :806, template-icons-variant.test.mjs:193).
  • Description: the regression test covers the main set and a backup and failed before the fix: verified (it fails against the base code with the old text).
  • Description: the spec keeps an import from the wrapped library, asks for the reason, and the set's source names the package: verified (icon-set spec FR3, FR9 and FR10).
  • Description: the reproduction block imports HomeIcon from the solid subpath: verified (AppShellTopNavWithSideNav.tsx:17).
  • Description: the listed test suites pass: verified (127 test files pass on this head).
  • Description: no new public API and no internal context: verified.
  • .changeset/template-kept-icon-library.md: clear
  • packages/cli/foundation/discovery/template-icons.mjs: clear
  • packages/cli/foundation/discovery/template-icons.test.mjs: clear

Automated review (maintainer link)

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 2502f63

Storybook · Sandbox · built from this PR's head

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@josephfarina
josephfarina merged commit be5d290 into main Nov 17, 2026
78 checks passed
@github-actions
github-actions Bot deleted the josephfarina/template-kept-icon-wrapped-library branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 2502f639 Deployed Nov 17, 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