Skip to content

fix: transform Message inside generics #7695

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 2 commits into
base: v5-gr2m/6552-codemods
Choose a base branch
from

Conversation

imranbarbhuiya
Copy link

@imranbarbhuiya imranbarbhuiya commented Aug 1, 2025

Background

Currently the codemod doesnt changes generic types like

const [message, setMessage] = useState<UIMessage>()

Summary

This pr fixes the above issue. Im not sure if u would accept this pr. Problem is I couldnt make root.find(t.TSTypeReference to work for this as jscodeshift wasnt returning results for this generic function part. So I asked claude and it tried various ways, tested but none worked so it ended up giving this manual approach that works so if there's a better way to fix it, let me know

Verification

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

Probably make root.find(t.TSTypeReference work for it

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