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

Updates to support custom extensions in codemod-cli #4

Conversation

NullVoxPopuli
Copy link
Collaborator

@rwjblue
Copy link
Member

rwjblue commented Jul 10, 2019

rwjblue/codemod-cli#62 is merged and released, should be ready to update...

bin/cli.js Outdated Show resolved Hide resolved
bin/cli.js Outdated
@@ -1,9 +1,15 @@
#!/usr/bin/env node
'use strict';


const extensionArgs = ['--extensions', 'hbs'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const extensionArgs = ['--extensions', 'hbs'];

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this broke things :-\

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think because previously, the file path was the last thing, and now the extension is. The path needs to be last :-\

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, I'm pulled to thin, and don't know how this works:
await execa('../../../bin/cli.js', ['http://localhost:4200', 'app'], execOpts);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyway, to make this PR worth merging, the integration tests should pass *

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path needs to be last :-\

Ya, not sure why you think that. runTransform is defined like:

function runTransform(binRoot, transformName, args, extensions = DEFAULT_EXTENSIONS) {

So the paths aren't last, they are the third argument, and the extensions (comma separated string) is last.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll poke at the branch though, maybe I made a mistake in the impl

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, not sure why you think that. runTransform is defined like:

legit! I did not check that out. I think my assumption was a red herring.

…operly

run the integration tests (and, in general, invoke the codemod)
Should be good for external testing to begin once this is merged.

update the cli.js

update deps

Update bin/cli.js

Co-Authored-By: Robert Jackson <[email protected]>

idk

they run! yay!

try to get input and output the same

fix linting
@NullVoxPopuli NullVoxPopuli force-pushed the updates-to-work-with-codemod-clis-extension-support branch from 7dcaa8c to a28968c Compare July 13, 2019 03:00
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review July 13, 2019 16:12
@NullVoxPopuli
Copy link
Collaborator Author

@rwjblue integrate tests pass now :)
(not that they do anything yet, but we can do another PR to add real world:tm: stuff)

@rwjblue rwjblue merged commit b06dccd into ember-codemods:master Jul 14, 2019
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.

2 participants