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

implemented better type safety for adding future prompts #15

Merged
merged 8 commits into from
Jun 20, 2022
Merged

implemented better type safety for adding future prompts #15

merged 8 commits into from
Jun 20, 2022

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Jun 18, 2022

Put all the prompts into an array with some type safety so that future prompts can be added and get some warnings.

The packages are now enables as a multi-select so adding more packages is easier and doesn't require a new prompt to be added.

Also put in some response messages such as when leaving name blank (Closing #11 in the process). See a demo here (CleanShot link).

There is a limitation however. If selecting Next-Auth, but not Prisma, it will go ahead and create a project with both of them due to there only being one Next-Auth template available. I can look into perhaps making it so that every individual package is installed separately, and configs copied over accordingly, so that there won't have to be a template-folder for each combination.

@juliusmarminge
Copy link
Member Author

juliusmarminge commented Jun 18, 2022

My bad, the limitation is that Prisma has to be selected in order for NextAuth to be installed. Selecting NextAuth but not Prisma will cause the base template to be pulled. The easy fix is to create a template template-next-auth and pull that, but that approach will be tedious for adding more packages in the future (e.g. Zustand).

@nexxeln
Copy link
Member

nexxeln commented Jun 18, 2022

Thank you for migrating all the console.logs to the logger, that was long overdue.

Yes for next-auth, prisma is required, I think the existing select prompt was fine. But if more people like this multi select prompt, we can have an option for prisma and next-auth + prisma, which will work with the current templates.

What do you think?

@juliusmarminge
Copy link
Member Author

Sure, that would work. However, there would still be the issue with expansion when/if adding more packages from the init.tips stack (I guess there is really only Zustand left right now...)

Theo mentioned an enhancements with passing a whole configuration and installing each package separately (on stream) which would require each package to be individually selected and that was my plan to tackle next if that's something you'd like (it's your project after all)

@nexxeln
Copy link
Member

nexxeln commented Jun 19, 2022

Yeah I would love that. What do you have in mind for making that work?

@juliusmarminge
Copy link
Member Author

juliusmarminge commented Jun 19, 2022 via email

@nexxeln
Copy link
Member

nexxeln commented Jun 19, 2022

Yeah I was looking into this too, we could use something like jscodeshift, BlitzJS uses this for their recipes, but I'm not sure how that will work here.

@juliusmarminge
Copy link
Member Author

juliusmarminge commented Jun 19, 2022 via email

@nexxeln
Copy link
Member

nexxeln commented Jun 19, 2022

Yeah I'd like that, after that I'll merge it. After that we can talk about how to use jscodeshift on discord maybe, and work together on it.

@nexxeln
Copy link
Member

nexxeln commented Jun 20, 2022

This looks good thank you so much!

@nexxeln nexxeln merged commit 4976a4d into t3-oss:main Jun 20, 2022
@nexxeln nexxeln mentioned this pull request Jun 22, 2022
devvianto605 pushed a commit to devvianto605/create-devviantex-nextjs-app-deprecated that referenced this pull request Jun 9, 2024
implemented better type safety for adding future prompts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants