Back in 2012 there was an effort to update path.{exists,existsSync} to fs.{exists,existsSync}. One of the folks at Nodejitsu wrote up a bot to automate this PR process.
Here is an example of one of those PRs. It looks like the bot made over 700 PRs.
Would there be interest from package maintainers for a more generic code mod bot for Node-specific API changes (e.g. new Buffer vs. Buffer.from);
I think this would be great, especially if it supported more than just node-specific api changes. Most of the work would be on forking and opening the pr (as I think you mentioned on the meeting today) so if the code change mechanic was up to the user, then this could have broad usage. For example, creating a pr bot which changed packages which depend on one deprecated/unmaintained package to another forked implementation might be a good use case.
@wesleytodd good idea, re-usable tooling would be a great to have in our arsenal.
Hi, I assign this task to me in order to work on this bot.
As suggested I'll implement a generic bot with a pluggable "updater" (the first one could be the example of Buffer constructor).
Meanwhile feel free to suggest other types of updating problem.
I was thinking that the changelog of node.js could be a good starting point.
This bot will also be helpful for upgrading private source code to new Node and node modules.
@Eomm Have you had any plan on it?
Hi @truongminh , I have started it here (I ashamed because it is quick and dirty solution only to implement the main steps). I was also thinking to write it down in a "protobot-compatible" way in order to add it on a github repo - if the maintainer want to - instead of run it in a local pc)
I think to end it in March 馃憤
Feel free to add suggestion of course
@Eomm once you make enough progress I think it would be good to schedule time in one of the package-maintenance meeting for you to go over what you have so far. It might make sense to do that a few things. For the first I think it would be good to do this once you have experimented enough to have a good idea of how/what you think it should do.
There is also this https://github.com/facebook/jscodeshift