kimroen / ember-cli-coffeescript

Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
MIT License
72 stars 49 forks source link

Simplified exports in blueprints #137

Closed mriska closed 7 years ago

mriska commented 7 years ago

This PR changes the blueprints from using a named variable to doing direct exports of the code. In addition to being more easy on the eyes, it fixes a problem with the compiled javascript file containing an undeclared variable in newer versions of the CoffeeScript compiler.

Fixes #135 Fixes #134

I have tested to create all of the blueprints changed:

ember g adapter foo-foo
ember g component foo-foo
ember g controller foo-foo
ember g helper foo-foo
ember g mixin foo-foo
ember g model foo-foo
ember g route foo-foo
ember g serializer foo-foo
ember g service foo-foo
ember g transform foo-foo
ember g util foo-foo
ember g view foo-foo

And the tests pass with the exception of view which I assume is due to the fact that a fairly recent Ember version is used which no longer supports views. I guess this blueprint can be removed at some point unless we want to keep it for people using it with older Ember version. On the other hand a case can be made for not helping them to create code that is deprecated in newer versions of Ember.

mriska commented 7 years ago

I didn't know there were node tests in here as well, I'll get those fixed.

mriska commented 7 years ago

@kimroen pushed updated code with amended tests. There is only one failure (beta) in Travis right now that looks like it needs poking to be rerun.

mriska commented 7 years ago

@kimroen, All builds are green now, do you think it should be merged, or are you still missing something?

kimroen commented 7 years ago

This looks good - thanks again! 🎉

kimroen commented 7 years ago

I noticed now that this missed some files, like the initializers.

mriska commented 7 years ago

@kimroen I'll check those out later today/tonight

mriska commented 7 years ago

@kimroen Created a new PR #139 that fixes initializer blueprint.