Repository navigation
fix(cli): a kept template icon from a library subpath names the library the set wraps - #12412
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
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
sourcenames the package: verified (icon-set spec FR3, FR9 and FR10). - Description: the reproduction block imports
HomeIconfrom 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: clearpackages/cli/foundation/discovery/template-icons.mjs: clearpackages/cli/foundation/discovery/template-icons.test.mjs: clear
PR Analysis Report🔎 Preview ·
|
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 (HomeIconfrom@heroicons/react/24/solid) keeps the import, as it should. But the copy report saysit 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
source.packagewith the module or a subpath of it.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
sourcenames 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
@heroicons/react, andastryx template AppShellTopNavWithSideNav src/Shell.tsxprintedicons: kept HomeIcon (@heroicons/react/24/solid): it already comes from @heroicons/react/24/solid, which <set> wraps(the same text in JSONicons.kept[].reason).it already comes from @heroicons/react/24/solid, part of @heroicons/react, which <set> wraps.it already comes from @acme/library, which @acme/wrapper/wrapper wraps(existing tests).names the library a set wraps when the template imports one of its subpathsintemplate-icons.test.mjs, for the main set and for a backup set. It failed before the fix.Scope
Components: cli (template icon copy report)
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.