ember-codemods / ember-native-class-codemod

A codemod-cli project for converting Ember objects to es6 native classes
68 stars 38 forks source link

Unmodified when running codemod #530

Open Filoteemo opened 1 year ago

Filoteemo commented 1 year ago

Working on a app running Ember v 3.15. When trying to mod any files to native class I get 200 in response but it won't modify any of the files specified. This is the cli output: image

And the codemods logfile says "Could not find runtime data NO_RUNTIME_DATA".

Example of file that is being specified in the path of the command:

`import { computed } from '@ember/object' import Component from 'eea/component'

export default Component.extend({ classNames: ['go-card'], classNameBindings: ['hasImage', 'hasAction'], tagName: 'button', title: '', subtitle: '', icon: 'arrow-right', hasImage: computed('image', function () { return this.get('image') ? 'has-image' : '' }), hasAction: computed('action', function () { return this.get('action') ? 'has-action' : '' }), click: function () { if (this.hasAction) this.cardAction() }, })`

gitKrystan commented 1 year ago

Hi @Filoteemo. Sorry you're having issues. I'm happy to help!

When you are running the codemod, are you running a server and pointing the codemod to it, e.g.:

npx ember-native-class-codemod http://localhost:4200/path/to/server [OPTIONS] path/of/files/ or/some**/*glob.js
Filoteemo commented 1 year ago

Thanks @gitKrystan. Yes correct. And as from the cli output it processes the file but doesn't modify it.

gitKrystan commented 1 year ago

@Filoteemo Can you try the latest version of this codemod, released yesterday. It's very unlikely that it will resolve your issue, but I did some work around error handling that might surface more useful information.

At this point, I suspect some issue w/ your setup + ember-codemods-telemetry-helpers, which unfortunately I have no experience debugging.

Filoteemo commented 1 year ago

Thanks! I will give it a try.