lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.57k stars 503 forks source link

Could we find a way to support Deno? #1270

Open lukeautry opened 2 years ago

lukeautry commented 2 years ago

I've been using Deno more and more. I like it a lot for back-end services, but the ecosystem is pretty fresh.

I'd really like to have a tsoa-like options in Deno, but a straight up port from Node to Deno for tsoa itself is probably not possible with existing APIs. But, I think we could continue to use Node for tsoa generation, but generate Deno compatible routes, just as we do for Express/Koa/Hapi/etc.

I think we would have to create a special Deno package to support some of the runtime elements, but I don't think it would be a huge lift to get something like this working, and it would be a tremendously valuable thing in the Deno world; nothing like this exists today.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

markusahlstrand commented 1 year ago

Just saw this ticket and think the library I did for cloudflare should work with deno as well: https://www.npmjs.com/package/tsoa-hono

louis-amhild commented 7 months ago

Hi @lukeautry, I think TSOA is such a great library - thank you for bringing it to the world! I also started playing with Deno and really love Supabase, so I wanted to bring these two worlds together.

For that reason, I spent the last couple of months, on and off, making a port of TSOA for Deno (and Supabase Edge functions). As you suggested, I have made an implementation with heavy inspiration from the existing Koa/Hapi implementation, using Hono as a router.

What took the longest time was integrating the tests and making lint happy, as Deno is obviously a bit different from Node. I only have two minor issues/questions left - and maybe I overlooked something, as I'm not (was not) that familiar with the TSOA codebase. It is obviously a fairly big change to introduce Deno in TSOA, but would you maybe be willing to look through a PR and assist me a bit with these last issues, @lukeautry?

I have released a package called tsoa-deno on npm and released a Deno runtime library on Deno Land. Please try it out if you like - https://github.com/louis-amhild/tsoa-deno

fatihaziz commented 1 month ago

i really need this since deno@2.0.0 is out, i must migrate from node to deno since my API is very slow