ember-cli-typescript
ember-cli-typescript copied to clipboard
Should `router.ts` also be supported?
I've changed my router.js into router.ts. However with v2.0.0 of ember-cli-typescript, generating a new route expects router.js to exist. Should router.ts also be supported?
ember generate route account/change-password
installing route
create app\routes\account\change-password.ts
create app\templates\account\change-password.hbs
ENOENT: no such file or directory, open '..\app\router.js'
We'd need to update the route blueprint to check for router.ts and make changes to ember-router-generator, which uses recast to add a this.route() call. Recast itself just landed initial TS support, but I'm not sure how much effort it's going to be to actually get that up and running (or whether it's even made it into a published release yet).
One option for the short term would be to just avoid throwing an error if we don't find router.js and emit a message instead warning the user that they'll need to update router.ts by hand.
One option for the short term would be to just avoid throwing an error if we don't find router.js and emit a message instead warning the user that they'll need to update router.ts by hand.
sounds like a good thing to do for now
@championswimmer if we don't get somewhere in the next bit, yep; but I know @jamescdavis actually has a spike where he's gotten a good part of the way through it, so I'm waiting to hear on that (and a lot of us were at EmberConf and had travel to/from/after this week).
Any updates on this?
Thanks for checking! No progress at the moment (or for the last very many moments!) but hopefully relatively soon. Supporting this dovetails with a couple other things I’m hoping to tackle in the next few months!
Just ran into this too
Making a router.ts possible would be great. Any news?
This got implemented natively via ember-cli/ember-cli#9972! Huzzah!