Skip to content

Commit 38dcb2c

Browse files
authored
fix: codemods build command (#5776)
1 parent 31d43d9 commit 38dcb2c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
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/build/codemods/v5/remove-overloads/remove-overloads.js
111+
--transform=./node_modules/@tanstack/react-query/build/codemods/src/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/build/codemods/v5/remove-overloads/remove-overloads.js
120+
--transform=./node_modules/@tanstack/react-query/build/codemods/src/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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
"test:build": "publint --strict && attw --pack",
3838
"build": "pnpm build:tsup && pnpm build:codemods",
3939
"build:tsup": "tsup",
40-
"build:codemods": "cpy ../codemods/src/**/* ./build/codemods"
40+
"build:codemods": "cpy ../codemods/* ./build/codemods"
4141
},
4242
"files": [
4343
"build",
4444
"src",
45-
"!build/codemods/jest.config.js",
45+
"!build/codemods/node_modules",
46+
"!build/codemods/vitest.config.ts",
4647
"!build/codemods/**/__testfixtures__",
4748
"!build/codemods/**/__tests__"
4849
],

0 commit comments

Comments
 (0)