Skip to content

fix: track generateText usage before transform #7693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: v5-gr2m/6552-codemods
Choose a base branch
from

Conversation

imranbarbhuiya
Copy link

Background

this is based #6554 (comment)
The current approach replaces all places where result.text, response.text is used. Its very common to use these functions and replacing all is incorrect. Also it doesnt transform when the variable name is different than result or response (and other common names). So this pr tracks for generateText usage, gets the variable name and replaces them only. This still has issue like if same name variable is there in the file for other use too, this'll transform that too, but ig this approach is still better than prev one.

Summary

I'm tracking usage of generateText, getting the variables then transforming them.

Verification

I ran the tests, all existing one are passing and added a new test to make sure it doesnt transform all. The jsshift is returning empty when no transforms are applied for me, ig its expected behaviour so the output file is kept empty

Tasks

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

Future Work

This pr still has issue like if same name variable is there in the file for other use too, this'll transform that too, but ig this approach is still better than prev one.

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant