codemod icon indicating copy to clipboard operation
codemod copied to clipboard

3.1.0 Breaking Changes?

Open Nantris opened this issue 3 years ago • 1 comments

Thanks for the great work on this package!

Codemods that used to work with 2.3.2/3.0.1 no longer work in 3.1.0 and above. I don't see any breaking changes listed. Were there any? Or any ideas what we should investigate?

This codemod no longer works for us after the update: https://www.npmjs.com/package/import-move-codemod

Nantris avatar Jun 08 '22 20:06 Nantris

I guess it's only broken on Windows (Both PowerShell and Cygwin.)

@eventualbuddha

Nantris avatar Jun 08 '22 21:06 Nantris

The instructions in the README for import-move-codemod don't work because they include --printer prettier, and the --printer option was removed in @codemod/[email protected]. I tried it with the current version without --printer prettier and it seemed to work.

eventualbuddha avatar Dec 24 '22 14:12 eventualbuddha

Thanks for taking a look into this @eventualbuddha, much appreciated.

Nantris avatar Jan 04 '23 00:01 Nantris

Actually I'm pretty sure that that wasn't the issue because I had already removed it from our command and it still failed. I thought you meant they invoked it themselves in their package, but that's not the case.

As I mentioned later, the issue only affects Windows (which wouldn't be the case if it was --printer pretter that was the option.

Nantris avatar Jan 04 '23 00:01 Nantris

Can you provide some steps for reproducing the issue and the error output? Doesn't need to be too detailed.

eventualbuddha avatar Jan 04 '23 00:01 eventualbuddha

Thanks again for your reply @eventualbuddha. All this time later I can't be certain, but the failing command likely looked something like this:

yarn codemod -p import-move-codemod -o import-move-codemod=@./internals/codemods/some-codemod.json app/desktop/**/!(*browserified*).{js,ts,jsx,tsx}

This is a newer glob than what we were using back then, but I'm pretty certain that the glob was not to blame or in any way related - but again going by 7 month old memory.

Nantris avatar Jan 04 '23 01:01 Nantris