Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

¿TypeScript support? #125

Open
sant123 opened this issue Jul 17, 2016 · 10 comments
Open

¿TypeScript support? #125

sant123 opened this issue Jul 17, 2016 · 10 comments
Labels

Comments

@sant123
Copy link

sant123 commented Jul 17, 2016

Hi, ¿what would you think about TypeScript in the generator? People would generate robust applications with full rich intellisense and more!

Let me now in order to make a pull request.

Thank you!

@dougwilson
Copy link
Contributor

Can you explain what adding TypeScript support would look like? I guess you can make a PR if that is easier than explaining the idea, though I'm not saying we'd accept the PR, since I don't understand what it would entail.

@sant123
Copy link
Author

sant123 commented Oct 7, 2016

Hi @dougwilson, the reason is for a better Javascript writing. I mean, with types support you know what you are writing, you can get intellisense from request and response objects, also for Router object, and so on. I'm not saying replace the Javascript generator, because not all like Typescript; but in other hand other people do, and them (even me) would start a express project with Typescript out of the box.

@dougwilson
Copy link
Contributor

Hi @sant123 , sorry, I guess I didn't ask right :) So what I was asking was what the code would look like to add the TypeScript support here. I don't really have any TypeScript experience, so wouldn't be able to implement this functionality myself, so I'm not sure how to really proceed even if we wanted this.

@tobymurray
Copy link
Contributor

Not sure if it's what @sant123 was trying to say, but perhaps he meant a TypeScript-ified version of the presently generated files? I read a blog post here: http://brianflove.com/2016/11/08/typescript-2-express-node/ where the author essentially recreates the seed project but with classes and typing.

I know I would be interested in something like that - the context for me is coming from an Angular front end world and looking for a server to back it. Staying with TypeScript has a lot of appeal for back end development, so a generator that provides the basic wiring (typings and a compile step I guess?) would be cool.

@bluzi
Copy link

bluzi commented Jul 18, 2017

Supporting TypeScript basically means changing the generated files from plain JavaScript to TypeScript. You can see an example for an Express-TypeScript seed here: https://github.com/lokeshthegenius/express-typescript-gulp-seed

The following steps should be made:

  • Change the template files to match TypeScript syntax (add types to functions, ES2015 modules and etc)

  • Add typecsript to devDependencies in the package.json, and change the npm start script

  • Add --typescript argument that will use the above templates instead of the regular JS templates

Many people use TypeScript nowadays, so in my opinion that's kind of a must have feature.

@ghost
Copy link

ghost commented Oct 16, 2017

As well as the above an agreed upon tslint.json and tsconfig.json would be necessary. So some thought regarding Typescript standards for express is also required.

@bluzi
Copy link

bluzi commented Oct 16, 2017

Well, TypeScript is getting more and more popular, and I think it will be a nice addition to the generator.

@dougwilson, will you accept a PR?

@FlopiVG
Copy link

FlopiVG commented Jul 11, 2018

Any info about this topic?

@rromanv
Copy link

rromanv commented Oct 26, 2018

👍 This would be really nice, somebody have something?

@bineetNaidu
Copy link

So, with this problem, I came up with a solution, create-ts-api. here the github repo and link to npm registry.

Feel free to raise an issue for more improvements...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants