Skip to content

Commit 0548d30

Browse files
authored
chore: Refactor codemods (#8056)
* initial codemod refactor * fix TableView * fix selectionStyle * fix key to id * clean up comments * lint * clean up * update README.md * improve transform function/option names * update action group comments
1 parent 804cc82 commit 0548d30

File tree

50 files changed

+2359
-2940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2359
-2940
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`

packages/dev/codemods/src/s1-to-s2/src/codemods/button.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)