packages/codemods/v5-0-0/08-divider-dual-rename.md
type/orientation SwapThe Divider block has a dual rename where both type and orientation change meaning:
type (direction: horizontal/vertical) → becomes orientationorientation (text position: left/center/right) → becomes titlePlacement with value mappingThis is tricky because both properties exist and their meanings swap. A naive rename would break the config.
For each Divider block, apply both renames simultaneously:
| Old Property | Old Values | New Property | New Values |
|---|---|---|---|
type: horizontal | horizontal, vertical | orientation: horizontal | horizontal, vertical |
type: vertical | orientation: vertical | ||
orientation: left | left, center, right | titlePlacement: start | start, center, end |
orientation: center | titlePlacement: center | ||
orientation: right | titlePlacement: end |
Important: Apply both changes in one pass to avoid the intermediate state where type is renamed to orientation and then conflicts with the existing orientation.
Glob: **/*.{yaml,yml}
Grep: type: Divider
- id: section_divider
type: Divider
properties:
type: horizontal
orientation: left
children: Section Title
- id: section_divider
type: Divider
properties:
orientation: horizontal
titlePlacement: start
children: Section Title
- id: vert_divider
type: Divider
properties:
type: vertical
- id: vert_divider
type: Divider
properties:
orientation: vertical
- id: centered_divider
type: Divider
properties:
orientation: center
children: OR
- id: centered_divider
type: Divider
properties:
titlePlacement: center
children: OR
type, only orientation, or both — handle each casetype: on a Divider is NOT the block-level type: key (which identifies the component). The block-level type: Divider stays unchanged. Only rename type: that is under properties:type or orientation use operator expressions, rename the key but flag the value for manual reviewSearch for Divider blocks and check for old property names:
grep -rn 'type: Divider' --include='*.yaml' --include='*.yml' . -A 10 | grep -E '^\s+(type|orientation):'
Under Divider properties, type: should not appear (replaced by orientation:), and orientation: with values left/right should not appear (replaced by titlePlacement:).