Migrates the deprecated Label component to Badge, and Badge's deprecated
isOutline/isEmphasized props to their color replacements — the removals
land in 3.0.0. The codemod can be run as soon as your app is on
@customerio/pluma-components 2.190.0, where Badge absorbed Label's colors,
bold text, and status indicator; migrating ahead of the major is recommended.
Label → Badge (React Label, Ember PlumaLabel):
Badge/PlumaBadge. If
Badge is already imported (React), the Label specifier is dropped and
usages reuse the existing local name.color gains color="grey" — Label defaulted to a grey
square chip, while a bare Badge renders a neutral pill, so the default must
become explicit to preserve the rendered output.color="outline" becomes color="neutral-outline".Badge deprecated props:
isEmphasized becomes color="accent".isOutline becomes color="neutral-outline".color="accent-outline".false values are simply removed.Dynamic expressions are left unchanged and reported as warnings for manual review:
color (e.g. @color={{if @tracked 'outline' 'grey'}}) —
"outline" must become "neutral-outline" by hand, and expressions that can
yield undefined relied on Label's grey default, which Badge does not share.isOutline/isEmphasized bindings.color with the deprecated props (invalid —
throws at runtime).Run it through the Pluma CLI from inside your consuming app:
Both codemods support dry runs. The React codemod uses jscodeshift flags, so
--dry/-d skips writes and -p prints the transformed output:
The Ember codemod has its own --dry flag:
LabelProps type imports are not rewritten — replace with BadgeProps
manually.Label aliases (import { Label as X }) keep their local name; the
import specifier switches to Badge as X.@customerio/pluma-components/ember and the /ember/label subpath default
import. Renamed templates whose PlumaLabel import takes any other form are
flagged for a manual import update.<span> while Badge currently renders a <div>. Migrated
badges inside text flow (paragraphs, headings, links, buttons) are invalid
phrasing content until 3.0, where Badge switches to a <span> by default
(see the breaking changes);
pass as="span" in the interim where it matters.