babel/babel-upgrade

Intro

Open

#7 opened on 2018年2月17日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)JavaScript (1,307 stars) (71 forks)batch import
discussionhelp wanted

説明

Hello everyone!

I'm writing down a lot of the todos just in the readme since this feels so early in the progress of this idea/tool. If we get closer we can start with individual issues, since I feel like we would just make 100 issues atm.

Philosophy

  • Works with one command npx babel-upgrade.
  • Have nice logging on what has changed, or suggestions where we can't guarantee the change is correct.
  • But allow configurability where useful
    • Allow option to specify paths for various things like source code/babelrc/package.json for fine-grained changed on specific workflows/projects. npx babel-upgrade babelrc=path packagejson=path?

Code

This is a codemod and also something you would ideally only run once on a codebase (at least for each upgrade).

  • Thus don't worry too much about doing something "slow" if the logic is simpler.
  • Needs to handle the base case, so we need testing to make sure it doesn't mess up anything it's not supposed to. Wrap any changes to the file in if checks, like if (package.dependencies) { package.dependencies = ... }
  • Organize the code in such a way that it's easy to add one-off changes, but having lots of tests/fixtures is fine.

コントリビューターガイド