Skip to content
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

Migrate to codemod-cli #28

Merged
merged 1 commit into from
Jul 31, 2018
Merged

Migrate to codemod-cli #28

merged 1 commit into from
Jul 31, 2018

Conversation

simonihmig
Copy link
Collaborator

This removes much of the custom boilerplate (test setup, bin-support) in favor of codemod-cli. 🎉

/cc @rwjblue @chriskrycho

The invocation of the CLI is now a bit different, e.g.:
Before: ember-test-helpers-codemod --type=integration tests/integration
After: ember-test-helpers-codemod integration tests/integration

I could write a little check in cli.js to also support the old --type param, to remain backwards compatible, or bump the major version (which I would have to do anyways because of dropping node 4). Leaning towards the latter...

@kellyselden updating the invocation for ember-cli-update would just be a matter of updating the "manifest" (https://github.com/ember-cli/ember-cli-update-codemods-manifest/blob/v2/manifest.json#L19-L20), right? This would automatically get pulled in, users would not have to update their ember-cli-update version, right?

This removes much of the custom boilerplate (test setup, bin-support) in favor of `codemod-cli`.
@simonihmig simonihmig mentioned this pull request Jul 30, 2018
@rwjblue
Copy link
Member

rwjblue commented Jul 30, 2018

This removes much of the custom boilerplate (test setup, bin-support) in favor of codemod-cli. 🎉

Awesome! How was it? Please shoot me any issues with your thoughts on what can be made better/easier...

@simonihmig
Copy link
Collaborator Author

How was it?

@rwjblue pretty straightforward actually! Mainly moving files around, fixing imports etc. Given this was an existing codemod, I just had to figure out how codemod-cli expects to have things laid out, for a new codemod I would expect this to be even easier. So nothing to complain, nice job btw! 😆

Just one thing I wondered: if it makes sense to have some test harness for testing that cli.js is working. I guess the underlying function from codemod-cli (runTransform) is probably tested, but as there is some code in cli.js itself (that users might customize, as I was thinking about) it might be useful to have this tested in the codemod itself as well? There was some bin-test.js before (in parts stolen from ember-modules-codemod iirc), that test coverage seems to be missing now...

@kellyselden
Copy link
Contributor

yep just a manifest update

@rwjblue
Copy link
Member

rwjblue commented Jul 31, 2018

Ya, @simonihmig that makes total sense. We should definitely add a cli/bin script test harness.

@simonihmig simonihmig merged commit 6d70d5c into master Jul 31, 2018
@simonihmig simonihmig deleted the codemod-cli branch July 31, 2018 15:37
simonihmig added a commit to simonihmig/ember-cli-update-codemods-manifest that referenced this pull request Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants