Migrates the removed LabelIcon component to Coin
with a child Icon. LabelIcon
was a thin wrapper that rendered a single Icon inside a colored circle/square;
Coin is the general-purpose replacement and takes the icon as a child.
LabelIcon | Coin | Notes |
|---|---|---|
name | child <Icon name> | Moved onto the child Icon. |
label | child <Icon label> | Moved onto the child Icon. |
color | colorVariant | Same value set (red…grey); only the prop name changes. |
shape="square" | shape="rounded-square" | shape="circle" is unchanged. |
size (omitted) | size="sm" | LabelIcon defaulted to sm; Coin defaults to md. The codemod adds an explicit size="sm" so appearance is preserved. |
size="sm"/"md" | size="sm"/"md" | Passed through unchanged. |
| other props | kept on Coin | Box passthrough props (className, as, spacing, …) stay put. |
Run it through the Pluma CLI from inside your consuming app. Always start with a dry run to review the diff and warning summary before applying:
Both frameworks accept --dry / -d. The React path also forwards standard
jscodeshift flags.
React. JSX elements whose tag resolves (via the import in the same file) to
LabelIcon from @customerio/pluma-components/react (or the bare
@customerio/pluma-components entry). The import specifier is rewritten to
Coin, an Icon import is added if missing, and aliased imports
(import { LabelIcon as X } from …) are handled.
Ember. <PlumaLabelIcon …> element nodes in .gts/.gjs/.hbs templates
are rewritten to <PlumaCoin …> with a child <PlumaIcon …>.
.gts/.gjs files that import
PlumaLabelIcon, update the import by hand: replace PlumaLabelIcon with
PlumaCoin and add PlumaIcon. The codemod only rewrites template contents,
not module imports (classic .hbs templates resolve these globally and need
no import change).size="lg". LabelIcon rendered an xl icon at size="lg"; Coin
renders an lg icon at size="lg". If you relied on the larger icon, set the
child Icon size explicitly.shape. A shape value the codemod can't read as a literal is
reported (not rewritten) because Coin uses rounded-square where
LabelIcon used square. Update those by hand.Both transforms print a summary listing dynamic shape values and any
LabelIcon with no name (which can't be wrapped in an Icon automatically).
The React transform is a bespoke jscodeshift transform; the Ember transform is
built on @codemod-utils/ast-template and reuses the shared CLI runner under
../../_shared/. There's a test suite under tests/:
It uses Node's built-in test runner (node --test).