ember-computed-decorators-codemod
This codemod uses jscodeshift
to update an Ember application using ember-computed-decorators
to ember-decorators
. This update allows applications to migrate to babel 6 and beyond without having to rely on the babel-plugin-transform-decorators-legacy
.
For example, it will rewrite code that looks like this:
;; const Component = Ember;
Into this:
;;; const Component = Ember;
Usage
WARNING: jscodeshift
, and thus this codemod, edit your files in place.
It does not make a copy. Make sure your code is checked into a source control
repository like Git and that you have no outstanding changes to commit before
running this tool.
The simplest way to use the codemod is like this:
yarn global add ember-computed-decorators-codemodcd my-ember-appember-computed-decorators-codemod
https://github.com/ember-decorators/auto-computed
Running Tests
yarn test // run all tests onceyarn test -- --watchAll // continuously run tests
Tests for this codemod work by comparing a paired input and output file in the __testfixtures__
directory. Pre-transform files should be of format <test-name>.input.js
, expected output after the transform should be named <test-name>.output.js
. Files must use the same <test-name>
in their names so they can be compared.
Credit
All code present in this repo was derived from the excellent work in ember-modules-codemod
.