hypermod-community
hypermod-community copied to clipboard
fix standalone transform runs - resolve path of transform
in the issue you linked [1] from jscodeshift, i think you forgot the path.resolve for non-http(s) imports (not even sure how they'd work tbh).
i tried running a local transform and it didn't work, but with this fix it did regardless of where i called the packages/cli/bin/codeshift-cli.js from. i think you might've been using the packages and not the --transforms flag so i understand why you could've missed it 😅
tbh there are more improvements to make w/ the local transforms (see [2] & I'll create more later) but this is the first step :D
seen here: https://github.com/facebook/jscodeshift/blob/aea20523d9d616e7debc7bc00b66835284278555/bin/jscodeshift.js#L142
[1] https://github.com/facebook/jscodeshift/issues/398 [2] https://github.com/CodeshiftCommunity/CodeshiftCommunity/issues/48#issuecomment-955049880
This is fantastic mate! Thanks so much for contributing 🤙
Could you please run yarn changeset and follow the prompts to make sure the CLI gets versioned?
A patch should do :)
Also looks like there are some tests that need to be updated 🙏
Thank you c:
Could you please run
yarn changesetand follow the prompts to make sure the CLI gets versioned?
Will try tmr.
A patch should do :)
Pretty sure this would be a breaking change since it will make broken behavior no longer broken but i assume nobody was using it so should be fine lol
Also looks like there are some tests that need to be updated 🙏
uh oh, seems that they are marking the now-correct behavior as wrong? not sure if i have the time to dig into them tbh, any chance you could take a look?
also, should we consider the https? imports, as mentioned in [1]?
/^https?/.test(options.transform) ? options.transform : path.resolve(options.transform),
Can do, I'll have a look at this asap!
in addition to this, i stopped using require.resolve in the codeshift.config.js.
fyi @danieldelcore i've rebased again (same w/ #97 which depends on this). i see you removed the path import so i had to re-add it again hehe
hey @danieldelcore - any updates on this? this is a prerequisite for https://github.com/CodeshiftCommunity/CodeshiftCommunity/pull/97 which would help get rid of our fork!
i can solve the merge conflicts but that's less relevant -- main question is - how do i fix the tests not passing, and what else should i do to get it merged? thanks!