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

can't generate a route without a router.coffee #99

Open ibroadfo opened 8 years ago

ibroadfo commented 8 years ago

brand new app:

$ ember g route open-bar version: 2.3.0 installing route create app/routes/open-bar.coffee create app/templates/open-bar.hbs ENOENT: no such file or directory, open '/Users/ibroadfo/scratchy/bourbon/app/router.coffee'

kimroen commented 8 years ago

Hi! Sorry about that.

This is not unexpected, but it's not great. Let's brainstorm some solutions!

What would be the expected behavior for you? Some options I can think of:

The first two are absolutely the easiest to get done. The last one is something that has been discussed in an issue here before, but would be a pretty big undertaking. Any kind of prompting would ideally have some kind of way to permanently ignore the warning, and I don't think we have a good system for that.

Any thoughts on these ideas, or maybe some I didn't think of?

Thanks!

ibroadfo commented 8 years ago

I think modifying existing files sounds right to me; they'll always have a router.js probably so that's simplest and least disruptive.

Converting files to coffeescript sounds like a separate task yeah. On Tue, 1 Mar 2016 at 12:23, Kim Røen notifications@github.com wrote:

Hi! Sorry about that.

This is not unexpected, but it's not great. Let's brainstorm some solutions!

What would be the expected behavior for you? Some options I can think of:

  • Prompt the user to create the missing file
  • Fall back to modifying router.js instead if router.coffee can't be found
  • The same as above, but alert the user about it somehow
  • Ask the user if they want to convert the router written in JavaScript to CoffeeScript and do that for them.

The first two are absolutely the easiest to get done. The last one is something that has discussed in an issue here before, but would be a pretty big undertaking. Any kind of prompting would ideally have some kind of way to permanently ignore the warning, and I don't think we have a good system for that.

Any thoughts on these ideas, or maybe some I didn't think of?

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/kimroen/ember-cli-coffeescript/issues/99#issuecomment-190697766 .