-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
temp: x
script for quickly running & seeing the diff
#71
Conversation
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]) but this is the first step :D [1] facebook/jscodeshift#398 [2] #48 (comment)
Signed-off-by: Kipras Melnikovas <[email protected]>
Signed-off-by: Kipras Melnikovas <[email protected]>
Signed-off-by: Kipras Melnikovas <[email protected]>
…ter in main cli) Signed-off-by: Kipras Melnikovas <[email protected]>
maybe would be nicer if the interface would be `-t t1 -t t2 -t t3` instead of current `-t t1,t2,t3` (you could separate into multiple lines and keep it cleaner), but don't know how to do that so this works just fine. Signed-off-by: Kipras Melnikovas <[email protected]>
depends on: https://github.com/pipedrive/CodeshiftCommunity/pull/5 Signed-off-by: Kipras Melnikovas <[email protected]>
…-run-local-codemods
Signed-off-by: Kipras Melnikovas <[email protected]> (cherry picked from commit d53171e)
Signed-off-by: Kipras Melnikovas <[email protected]>
Great work on all of this! Sorry I've been MIA lately. I'll have a look at this tomorrow hopefully! Keep it up |
yeah no worries. i think i've realized that this is nice for convenience for small things, but when you start adding more stuff, you're likely to miss it unless you also have tests - something to keep in mind. |
554c39c
to
ad71e7b
Compare
Hey @kiprasmel 👋 How's it going? I just noticed that you've done loads of work in your fork to setup this codeshift package: Since it's quite bespoke and has its own build configuration (jest, ts, etc) have you thought about creating this as a standalone package? This means you wont need to fork and maintain the rest of the repository and just focus the codemod package that you've setup here. This guide should show you how it's done: Also the authoring guides explain the different publishing options and why you might want to use one over the other: In short
Then your codemods should be runnable like so:
The community folder is designed to be a bit restrictive so additional dependencies and build configuration to add complexity to the community etc. |
hey @danieldelcore, thanks! how are you? this branch specifically was just to showcase the the proper branch of ours is the as for the community folder vs standalone package, i saw that you introduced this capability a little while ago. thanks! |
the run.js is cool, but it became annoying to create source files & undo the changes, so this just helps.
x
probably shouldn't be tracked here; i myself move it into a script directory that's inside my $PATH, e.g.~/.local/bin/
.i edit the content directly there, most often at the bottom because that's the latest stuff you see in the terminal when you run it.
running is the same as run.js -
x flow cui5 path/to/dir/or/file/or/whatever