jscodeshift + rails migrations = jscodemigrate

December 5, 2015
development jscodeshift codemods recast migration

I’ve worked on lots of projects big and small, but as time went on they all suffered from the same problem. Changing standards and updated api’s left code fragmented as the codebase grew.

From the time I started working on coffeelint, the problem has been stewing in my head. Subconciously on the lookout for a solution, I heard about codemods. Let me preface by saying I’ve been quite obsessed with everything facebook engineering has been doing in open source lately. Needless to say I took notice.

I tried to jump in to the game but after playing around with jscodeshift in the super nifty ast explorer I noticed there was a peice missing. Only this time, a mortal human like myself could fill it.

We have been told that facebook has a codemod runner and I have no doubt that there is a bit of process in place governing it. But outside of facebook, we only have a one off runner that is hard to work into a team’s process.

Inspired by my desire to solve this problem and an admiration for the way rails handles database migrations I decided to build a code migration tool that wraps jscodeshift. It might be a little rough, since it is hot off the vim, but I’m eager to hear what people think about the concept.

TRY IT OUT

https://github.com/brysgo/jscodemigrate

GitHub Inbox Zero

August 14, 2020
development devops quarantine open source

the yin and yang of utility

August 8, 2020
development quirky life shower thoughts philosophy

coming soon: peerstate

August 6, 2020
development backstory open source
comments powered by Disqus