Skip to content

Commit 01e6b67

Browse files
committedApr 8, 2025
update README.md
1 parent 579943e commit 01e6b67

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎packages/dev/codemods/src/s1-to-s2/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ Run `npx @react-spectrum/codemods s1-to-s2` from the directory you want to upgra
1313
## How it works
1414

1515
The upgrade assistant use codemods written with [jscodeshift](https://github.com/facebook/jscodeshift).
16+
17+
## Adding a new codemod
18+
19+
To add a new codemod for `Button`, for example, you would:
20+
21+
1. Create a new transform function in `src/codemods/components/Button/transform.ts` and export it as `default`
22+
2. Implement the transform logic
23+
3. Add tests for the transform in `__tests__/button.test.ts`

0 commit comments

Comments
 (0)