-
Notifications
You must be signed in to change notification settings - Fork 32
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
Trouble getting codemod to run on my project #217
Comments
@samselikoff if I remember you use pods for EmberMap. The codemod does not support pods layout. |
My apologies that this is not in the readme. I will update it. |
Oh wow that’s surprising. Even if I point at a specific file? Does it have to do with the resolver? Is there a manual way to run it on a pods app? |
@samselikoff Just throwing it from the top of my head, will this help find ./app/pods -name "*.hbs" | xargs npx ember-angle-brackets-codemod http://localhost:4200 I haven't tried it. |
The thing is I originally ran this
so I already pointed to an individual file, so I don't think that's it. Think it's something else in the code. |
There is also the issue with telemetry. Some of the logic works only with non-pod structures to determine helpers and components. The good news however is I am working on reducing the need to rely on telemetry and file paths to more of a “type of invocation” to figure out what is component/helper. In regards to single file, it should work, but again the telemetry will likely block you. |
@samselikoff In order to use it with pods you'll have to use 1.4.12 version You can install it locally like:
After that you can run it like:
And if you set config file correctly you'll be able to update some folder with templates at once |
I ran into the problem as well, after Installing 1.4.12 I combined everything above into the following command, which worked for me:
Edit: I needed to remove the codemod from package.json afterwards, as running the server failed with an error: |
I'm just curious, b/c I see both of the above examples mention |
I believe that the codemod cannot infer anything from telemetry when pods structure is in use. |
Thank you. So if #287 lands npx ember-angle-brackets-codemod --no-telemetry ./app/pods/**/*.hbs or non npx ember-angle-brackets-codemod --no-telemetry ./app/**/*.hbs right? |
Yes, I think that is correct. |
@rwjblue is there anything fundamentally preventing this codemod from being used with pods with telemetry or is it just a matter of someone putting in the work? |
@runspired I know I'm not @rwjblue 😂 but the transform "should work" now since we infer as much as possible without using telemetry. I believe you can use the I ran this on a 700+ file codebase with minimal interaction. I hope this helps. |
thanks, @tomwayson! worked for my app with pods structure like a charm 👍 |
For those who land on this issue, I wrote a codemod to un-pod Ember projects. Feel free to give it a try. |
I tried to run this codemod on one of EmberMap's templates and I'm having trouble getting it to work. It's strange because I just used this on a different project the other day.
Here's the command I ran:
And the template seems pretty standard:
View template
The codemod runs then says that there was 1 unmodified file. There were some errors.
View terminal output
Would appreciate any tips on how to go about debugging this!
The text was updated successfully, but these errors were encountered: