Skip to content

Commit aebae80

Browse files
authored
fix: make sure codemods are included in react-query (#5340)
1 parent c94bf4c commit aebae80

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/react/guides/migrating-to-v5.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ If you want to run it against `.js` or `.jsx` files, please use the command belo
108108
```
109109
npx jscodeshift ./path/to/src/ \
110110
--extensions=js,jsx \
111-
--transform=./node_modules/@tanstack/react-query/codemods/v5/remove-overloads/remove-overloads.js
111+
--transform=./node_modules/@tanstack/react-query/build/codemods/v5/remove-overloads/remove-overloads.js
112112
```
113113

114114
If you want to run it against `.ts` or `.tsx` files, please use the command below:
@@ -117,7 +117,7 @@ If you want to run it against `.ts` or `.tsx` files, please use the command belo
117117
npx jscodeshift ./path/to/src/ \
118118
--extensions=ts,tsx \
119119
--parser=tsx \
120-
--transform=./node_modules/@tanstack/react-query/codemods/v5/remove-overloads/remove-overloads.js
120+
--transform=./node_modules/@tanstack/react-query/build/codemods/v5/remove-overloads/remove-overloads.js
121121
```
122122

123123
Please note in the case of `TypeScript` you need to use `tsx` as the parser; otherwise, the codemod won't be applied properly!

packages/react-query/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,17 @@
2828
"test:types": "tsc",
2929
"test:lib": "vitest run --coverage",
3030
"test:lib:dev": "pnpm run test:lib --watch",
31+
"build": "mkdir ./build && cp -R ../codemods/src ./build/codemods",
3132
"build:types": "tsc --build"
3233
},
3334
"files": [
3435
"build/lib/*",
3536
"build/umd/*",
36-
"src"
37+
"src",
38+
"build/codemods",
39+
"!build/codemods/jest.config.js",
40+
"!build/codemods/**/__testfixtures__",
41+
"!build/codemods/**/__tests__"
3742
],
3843
"devDependencies": {
3944
"@types/react": "^18.0.14",

0 commit comments

Comments
 (0)