t3-oss / create-t3-app

The best way to start a full-stack, typesafe Next.js app
https://create.t3.gg
MIT License
24.77k stars 1.14k forks source link

feat: nx plusing #1282

Open 0x15F9 opened 1 year ago

0x15F9 commented 1 year ago

Is your feature request related to a problem? Please describe.

There is no generator for t3 in NX

Describe the solution you'd like to see

A plugin to easily scaffold t3 apps in nx

Describe alternate solutions

-

Additional information

No response

c-ehrlich commented 1 year ago

Would definitely be up to add this if someone from Narwhal or the community wants to help out :)

olehmelnyk commented 1 year ago

I've just read the article by @ZackDeRose - https://dev.to/nx/create-your-own-trpc-stack-3lg7 then found this feature request. Would be nice to start a new t3 project with vite/vitest and to be able to update t3 with migrations scripts like (cypress/storybook have).

c-ehrlich commented 1 year ago

A big difference between what we are doing and what something like Cypress and Storybook do is that their involvement in the app is limited to a fairly specific subset of files. Building this seems like a cool project, but I think it might work better as a separate thing from create-t3-app.

ZackDeRose commented 1 year ago

Would definitely be up to add this if someone from Narwhal or the community wants to help out :)

Hey @c-ehrlich, we'd definitely be in if Nx can be helpful here! Let me know if you had something specific in mind.

A big difference between what we are doing and what something like Cypress and Storybook do is that their involvement in the app is limited to a fairly specific subset of files. Building this seems like a cool project, but I think it might work better as a separate thing from create-t3-app.

Yeah I would envision Nx's involvement might be an option to add Nx when first creating your t3 repo? If a user opts into Nx, they should be able add any nx plugins on top (so separate from create-t3-app at that point)

endalk200 commented 1 year ago

I am a big fan of t3 and Nx. I have been using both of them in different projects. I would like the option to have both things. I can contribute this or help out. I want to know if there is someone working on it right now.

endalk200 commented 1 year ago

I have started working on this if anybody is interested.

endalk200 commented 1 year ago

Here is a link to the repo https://github.com/endalk200/create-t3-nx

So far I was able to add end-validator, api, auth, and db packages. There are many potential improvements and things to add but try it and let me know what you think.

maritz commented 1 year ago

I'm relatively new to using nx, so I might have some misconceptions.

nx plugin that uses t3's opinionated stack code/principles would be cool. I get that the files t3 makes are more directly involved and might be a bit more difficult to write migrations for as a result.
But on the other hand updating your already created app to newer create-t3-app versions (to take advantage of improvements here) is currently a very painful process and an nx plugin could greatly improve this.