You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Number of files/instances missed by the codemod (FN): 106
Number of files/instances mistakenly transformed (FP): 0
I fixed my issue with a workaround, but I'm reporting this for other community members.
Note: the workaround involved copying the codemod files directly to my project and not using codemod package at all. Instead I created a small wrapper that runs the codemod with ts-morph and globby directly:
(last two lines are repeated multiple times; probably once per sub-codemod)
Additional context
I'd like to report two problems actually:
the codemods not working (but only in context of codemod repository)
silent failures when --logs is not used; as you can see in the output of the provided script, if you don't use --logs you won't know that codemods didn't work, the process will have exit code 0 and there is no indication that something went wrong; when --logs is used then the process will fail and you can see the logs but they are still not very helpful
I wasn't able to figure out why point 1 is happening, it's very strange issue. What's making it even worse is that one of the codemods worked and changed the import so you can see it partially working but you have no idea why other changes weren't applied.
Regarding point 2, I believe better logging would be useful for cases like this. Most likely issues like this one won't be reported because people may not realized codemods are failing (and they only may have assumption that their code is too complicated to be handled by codemod or similar).
The text was updated successfully, but these errors were encountered:
Faulty codemod
msw/2/upgrade-recipe
sourceSample code
https://github.com/jiri-prokop-pb/codemod-msw2-repro
There is
test.spec.ts
that usemsw
.You can also find
upgrade-msw-v2.sh
script there that runs the codemo and shows the problems mentioned below.Original
Expected
Actual
Estimated impact
Numbers about your specific codemod run:
Total number of files/instances transformed: 106
Number of files/instances missed by the codemod (FN): 106
Number of files/instances mistakenly transformed (FP): 0
I fixed my issue with a workaround, but I'm reporting this for other community members.
Note: the workaround involved copying the codemod files directly to my project and not using
codemod
package at all. Instead I created a small wrapper that runs the codemod withts-morph
andglobby
directly:wrapper script
Logs:
(last two lines are repeated multiple times; probably once per sub-codemod)
Additional context
I'd like to report two problems actually:
codemod
repository)--logs
is not used; as you can see in the output of the provided script, if you don't use--logs
you won't know that codemods didn't work, the process will have exit code 0 and there is no indication that something went wrong; when--logs
is used then the process will fail and you can see the logs but they are still not very helpfulI wasn't able to figure out why point 1 is happening, it's very strange issue. What's making it even worse is that one of the codemods worked and changed the import so you can see it partially working but you have no idea why other changes weren't applied.
Regarding point 2, I believe better logging would be useful for cases like this. Most likely issues like this one won't be reported because people may not realized codemods are failing (and they only may have assumption that their code is too complicated to be handled by codemod or similar).
The text was updated successfully, but these errors were encountered: