For @devigner-ui/icons. Upgrade, then run the codemod:
npm install @devigner-ui/icons@^3.5.0
npx @devigner-ui/icons migrateEvery old name is still exported, from the package root and from its own subpath, and renders the renamed icon:
import { IconBag2 } from "@devigner-ui/icons"; // still works
import { IconBag2 } from "@devigner-ui/icons/Bag2"; // still works
import { IconBagStraps } from "@devigner-ui/icons/BagStraps"; // the new nameAn old name is marked @deprecated, so your editor strikes it through and
shows the new name on hover, and it logs one warning per name in development.
It is silent in production builds. Props, ref forwarding and styles are
unchanged: only the name moved.
IconName values. The IconName type lists current names only, so a
string such as const name: IconName = "Bag2" stops type-checking. That is the
compiler pointing at a rename for you: use the new name the error suggests, or
look it up in the list.
metadata.json lookups. Icons in metadata.json carry their current
name. A lookup by an old name finds nothing; each icon now lists its old
names in formerly:
import metadata from "@devigner-ui/icons/metadata.json";
const find = (name: string) =>
metadata.icons.find((i) => i.name === name || i.formerly.includes(name));
find("Bag2")?.name; // "BagStraps"embeddings.json keys are current names too, for the same reason.
Names built at runtime, such as Icons[`Icon${name}`] with name from
your data. Map the stored names once with renames.json; see the
codemod page.
Twenty-seven renames change only capitalisation, such as IconAdditem to
IconAddItem. Both work until 4.0, including the old subpath
(@devigner-ui/icons/Additem), on every operating system.