gluegun icon indicating copy to clipboard operation
gluegun copied to clipboard

Typescript starter fails test

Open cogoo opened this issue 5 years ago • 9 comments

Hey!

Starting a new project with TypeScript has some issues.

  • The initial tests don't pass. This is due to some inconsistencies with the initial generate command. It's looking for a model.js.ejs template, but the actual template is model.ts.ejs.

  • When you build the project, the model.ts.ejs file doesnt get compiled to a js file.

How can we fix this for the JS build, as we have to reference a template file for the generate command. How do we handle the TS to JS change

cogoo avatar Feb 06 '19 23:02 cogoo

Would love to submit a PR for this if I can be pointed in the right direction

cogoo avatar Feb 06 '19 23:02 cogoo

Hey @cogoo ! Apologies for how long this has taken me to respond to.

I'd love some help with this. I'm a little behind on Gluegun and working hard to catch up.

jamonholmgren avatar Mar 05 '19 00:03 jamonholmgren

Thats fine, your hard work already on Gluegun is appreciated.

Will try and help on this issue, do you have any insight to share that could help with this

cogoo avatar Mar 05 '19 01:03 cogoo

I'd have to look into it a bit, but is it just a matter of changing the js to ts in the generator script?

jamonholmgren avatar Mar 07 '19 07:03 jamonholmgren

That would be part one.

Will also need the TS Compiler to compile the model.ts.ejs file to model.js.ejs

cogoo avatar Mar 07 '19 10:03 cogoo

I see, yeah, that seems doable but just needs someone to take the task on.

jamonholmgren avatar Mar 17 '19 23:03 jamonholmgren

Looked into this, unfortunately the TS compiler doesn't accept "custom" extensions, in this case '.ejs'. An alternative could be in the npm build script, we copy the template folder into the output directory

cogoo avatar Mar 23 '19 14:03 cogoo

Possibly related to #509.

jamonholmgren avatar May 05 '19 21:05 jamonholmgren

Hello, just wanted to comment that im running into same issue but it looks almost like it's intermittent(i swore it worked once). Still playing around with this atm but following the guide i get the same error but only when i TS starter.

JeffBeltran avatar Aug 01 '19 19:08 JeffBeltran