Closed artsyca closed 9 years ago
OK! After much research, and looking at the ember-cli branch of EmberUI, Here are the steps needed to use coffeescript in your addons!
/addon
directory of your addon..coffee
file in your app/
folder that imports from the folder above, make it a .js
file, with the following syntax:import Ember from 'ember';
import MySnazzyComponent from 'my-addon/components/my-snazzy-component';
export default MySnazzyComponent;
"ember-cli-coffeescript": "^0.XX.X"
to dependencies
(not devDependencies
!) in package.json
.coffee
within the addon and should continue working as usual!Thank you very much for looking in to this! I started researching some on friday, but had to stop because of some work things that came up.
I pretty much came to the same conclusion you did, but I think this might be a slightly nicer syntax that would allow for the same overriding:
export { default } from 'my-crafty-addon/components/my-component';
This is actually the default in ember-cli as of not very long ago.
I'll finish up the pull request for in-addon component generators to be the way you suggest here (#67) (I actually ran in to this exact issue there, but the syntax was a bit in flux so I put it on hold), and then it should all be good times :)
Almost midnight here though, so I'll do this tomorrow morning and then release a new version with this and some other things.
Thanks again!
:+1: awesome! look forward to pulling the latest release!
This may not be an ember-cli-coffeescript issue per se, but I really want to make ember-cli addons more compatible for users of this excellent addon.
Steps to reproduce:
ember g my-crafty-addon
andnpm install --save-dev ember-cli-coffeescript
inside the addon.So far so good. Begin coding away.
Create (for example) a component in the
addon/components
folder. (Manually since components can't be generated inside addons?).Mirror this component in
app/components
and import/export as described here: http://edgycircle.com/blog/2014-creating-a-datepicker-ember-addon/ (a common practice for merging into the application namespace while still allowing further subclassing)addon/components/my-component:
app/components/my-component:
my-crafty-addon
no longer functions! The importing app will complain about not be able to findmy-crafty-addon/components/my-component
While the above steps work great for
.js
files, there seems to be a globbing issue that doesn't pick up.coffee
files in the same configuration.I believe this is an issue somewhat closer to the ember-cli core but I really would like to know what steps we can take to increase compatibility?