-
Notifications
You must be signed in to change notification settings - Fork 143
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
Improved codemod scope management #2264
Conversation
I still have one more bug to investigate in this area. I have an app where the codemod fails on the first run (where a prebuild is done) and succeeds the second time (when reusing prebuild). |
@ef4 I've been working on something this weekend and I don't think that problem is isolated to just the codemod 🤔 I'm seeing the same behaviour when converting an app to Vite and it essentially fails the first run and then gets farther on the second (haven't fixed all the issues yet so can't say it succeeds on the second run 😂) |
Yeah, I agree. I think the codemod is just a good example to exercise the bug. I'm going to land this. I regret not hitting merge on Friday because it would have avoided confusion and conflicts with #2271 |
sorry that was my bad 🙈 I looked for this PR to see if it was merged before merging that, I just missed it 🙃 |
This fixes #2264 (comment) and also addresses automatically adding `exports` to package.json, since they're both in the same function. The problem with first-run failures was that Resolver expects to get constructed after any prebuilding is done. We were constructing it in ensureAppSetup before the prebuild.
This refactors template-tag-codemod so that all cases can handle arbitrary existing scope collisions.