@backstage/migrate-avatar-to-custom
Migrates Avatar component usage from the Base UI implementation to the custom implementation introduced in @backstage/ui@0.9.0 (Backstage v1.45.0).
What it transforms
renderprop removal — removes therenderprop and inserts a// TODO(backstage-codemod)comment so you can review custom renderingsize="large"→size="x-large"— the oldlargesize maps to the newx-largetoken- Handles named imports (
import { Avatar } from '@backstage/ui'), aliased imports, and namespace imports (import * as UI from '@backstage/ui')
Installation
bash
Usage (from this repo)
bash
Development
From the repo root:
bash
Known limitations
- When a
renderprop is removed, the codemod cannot mechanically migrate the custom rendering logic — review the TODO comment and manually adjust - Namespace imports are supported for detection, but the namespace prefix is preserved as-is