diff --git a/docs/react/guides/migrating-to-v5.md b/docs/react/guides/migrating-to-v5.md index e8cdfdbfe4..e16f15e9eb 100644 --- a/docs/react/guides/migrating-to-v5.md +++ b/docs/react/guides/migrating-to-v5.md @@ -108,7 +108,7 @@ If you want to run it against `.js` or `.jsx` files, please use the command belo ``` npx jscodeshift ./path/to/src/ \ --extensions=js,jsx \ - --transform=./node_modules/@tanstack/react-query/codemods/v5/remove-overloads/remove-overloads.js + --transform=./node_modules/@tanstack/react-query/build/codemods/v5/remove-overloads/remove-overloads.js ``` 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 npx jscodeshift ./path/to/src/ \ --extensions=ts,tsx \ --parser=tsx \ - --transform=./node_modules/@tanstack/react-query/codemods/v5/remove-overloads/remove-overloads.js + --transform=./node_modules/@tanstack/react-query/build/codemods/v5/remove-overloads/remove-overloads.js ``` Please note in the case of `TypeScript` you need to use `tsx` as the parser; otherwise, the codemod won't be applied properly! diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 8b3935cccd..f32390ae3e 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -28,12 +28,17 @@ "test:types": "tsc", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", + "build": "mkdir ./build && cp -R ../codemods/src ./build/codemods", "build:types": "tsc --build" }, "files": [ "build/lib/*", "build/umd/*", - "src" + "src", + "build/codemods", + "!build/codemods/jest.config.js", + "!build/codemods/**/__testfixtures__", + "!build/codemods/**/__tests__" ], "devDependencies": { "@types/react": "^18.0.14",