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

[RFC]: Ability to use redwood generate scaffold as a standalone tool #10700

Closed
1 task
Tsimopak opened this issue May 30, 2024 · 5 comments
Closed
1 task

[RFC]: Ability to use redwood generate scaffold as a standalone tool #10700

Tsimopak opened this issue May 30, 2024 · 5 comments
Labels
p3 Low priority. The Core team will not prioritize this for now topic/generators-&-scaffolds

Comments

@Tsimopak
Copy link

Summary

Hi,

I would like to suggest (or perhaps ask if) using Redwood generate scaffold tool as a standalone one.

Motivation

This scaffold tool is very powerful and had the ability to do the following: (taken from redwood's docs):

A scaffold quickly creates a CRUD for a model by generating the following files and corresponding routes:
sdl
service
layout
pages
cells
components

I would very much like to get the backend abilities - the jest testing, sdl file + mutations, crud operations and the ability to also get the typescript version of it as a standalone tool.

I think that the output of this tool at its current state is very much generic and can fit to so many other projects as well, so it will be very excited to tweak it up to be a bit more generic.

Detailed proposal

It could either stick with current scaffold convention or serve as an official prisma generator as other do:
https://www.prisma.io/docs/orm/prisma-schema/overview/generators#community-generators

An example to CLI structure as it is right now

npx redwood generate scaffold <MODEL> <FLAGS>

Would generate in a certain folder, the CRUD operations, SDL that can be imported and used in any project.

Are you interested in working on this?

  • I'm interested in working on this
@Tsimopak Tsimopak changed the title [RFC]: Ability to use redwood prisma generator as a standalone tool [RFC]: Ability to use redwood generate scaffold as a standalone tool May 30, 2024
@Tobbe
Copy link
Member

Tobbe commented May 31, 2024

@Tsimopak Thanks for your RFC. First time I heard someone ask this 🙂 Very interesting!
How would you use the generated files? With some other web frontend? Or some other way?

@Tsimopak
Copy link
Author

Thanks for the fast response @Tobbe,
I want to build my server a bit differently and explore different tools.
I also feel like exporting the scaffold tool to be a Prisma generator for CRUD + SDL could very much be benefitial for others to use outside of redwood ecosystem :)

@Tobbe
Copy link
Member

Tobbe commented Jun 1, 2024

I think it's going to be very difficult to use it outside of RW. Especially outside of Redwood's API side. We have a special way of doing gql resolvers (that we think is much easier!). But that does mean they're not so easy to transfer to some other server.
Also, a lot of what our scaffold generator does is generate the frontend, with List, Details and Edit views, (including things like tables, forms, mutations, queries, loading states etc)

@Tobbe Tobbe added p3 Low priority. The Core team will not prioritize this for now labels Jun 1, 2024
@Tsimopak
Copy link
Author

Tsimopak commented Jun 1, 2024

@Tobbe Thanks!, is it possible to use only the backend of RedwoodJS?

@Tobbe
Copy link
Member

Tobbe commented Jun 2, 2024

@Tobbe Thanks!, is it possible to use only the backend of RedwoodJS?

Yes! We've had people do that before 🙂 There is not automatic way to do it, but it is doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 Low priority. The Core team will not prioritize this for now topic/generators-&-scaffolds
Projects
None yet
Development

No branches or pull requests

3 participants