lamabiker / atom-ember-cli-helper

Ember CLI integration for the Atom editor
https://atom.io/packages/ember-cli-helper
MIT License
26 stars 13 forks source link

Doesn't work with pod structure #18

Closed elbeezi closed 8 years ago

elbeezi commented 9 years ago

e.g., switching component view from template.hbs via hotkey will open template.js (even if there's no such file)

mariusandra commented 9 years ago

Hey,

I don't use the pod structure myself. That's probably why I desperately wanted a hotkey in the first place to navigate between all the folders.

So please walk me through how it works and what should happen. Googling around I see that the directory structure should look something like this:

app/taco/controller.js
app/taco/route.js
app/taco/model.js
app/taco/template.hbs

Is there only "controller.js" in a pod structure or can there also be a "component.js"? Are there any other files that can be in the pod?

So basically CTRL+ALT+E should then toggle between controller.js and template.hbs, correct? And CTRL+ALT+R between controller.js and route.js?

elbeezi commented 9 years ago

Unfortunately it's a bit more complicated than that, especially since there isn't a single source of truth for application-wide pod structure. By default (in ember-cli 1.13.8), all pod-enabled blueprints will generate into {model-name}/{filename}, regardless of type. However, people currently seem to use different strategies for separating models, routes, and components. For example, I tend to split up my pods in the following way (adopted & adapted from this ember-cli issue comment):

/app
|_helpers/
|_components/
        |_ myComponent/
            |_ component.js
            |_ template.hbs
|_initializers/
|_models
    |_foo/
        |_adapter.js
        |_serializer.js
        |_model.js
|_ myRoute
    |_ route.js
    |_ controller.js
    |_ template.hbs
|_ utils/

Also note that there may be significant changes to this pattern when routable components land.

mariusandra commented 8 years ago

Hey, unfortunately I haven't found time to work on this since the issue was opened. If you still need this, feel free to hack on the component and send a PR. :)

Closing for now, will reopen if needed.