-
Notifications
You must be signed in to change notification settings - Fork 1k
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]: Prompt user to create project as JS or TS in create-redwood-app #6275
Comments
I have felt this pain twice lately. Accidentally doing JS when I meant for TS. I'd be happy to take a go at a rough draft of a PR but I have never done CLI work before. I think it should be pretty easy to do though. |
Arguably the "standard" is already to create a TS project. Then if the user wants a JS project (which is the default option right now) we additionally run ts-to-js at the end. So I think we should make the ts-to-js step optional, and only run it if --js is specified, or if the user chooses JS at the prompt. And of course TS should be the preselected option users get if they just press Enter. If they want to run the extra ts-to-js step they should have to consciously opt in to that 😉 |
Taking this approach makes sense to me. But, after looking back through @cannikin's suggestion, the spirit is to build more interactivity into the processing by prompting for a choice. That also aligns with this goal:
Considering that, I like the prompt approach. |
I am going to be slower than I'd like working on this - I am keen to take a go at things but until my kids start going to bed earlier with the fall weather my dev work time has been a bit minimal. I will see where I can get to but if this is a priority or needs to be complete in under a month then please go ahead on your own as the core team. [EDIT]: Okay - so I wrote this comment and then got focused and cracked out a rough POC/WIP for initial review in about 2 hours. See the PR. |
@Tobbe wrote:
(prompt emphasis (but not text) added by me, now) 100% agree we should have a prompt. Always have 😃 Don't know where you guys got the idea I tried to steer us away from that 🙂 @cannikin wrote:
Of course I am 😁 But only as far as making it the default ENTER option |
This would be my fault for missing your mention of a prompt. 😞 Apologies to all. @ehowey glad you dug in! I run the same schedule as my kids, as well. 😄 |
Oh yeah sorry, I missed the prompt part of that as well! @Tobbe probably edited the comment and added that in after our comments. 😉 |
I mention this in the PR - but I have put in some POC prompts for project name, project path and git init. Once you figure out the workflow for one prompt, adding others is pretty straight forward. Maybe that is too much scope creep but it felt natural to also ask the user these questions as well in the install process. |
Hey everyone, just confirming this has been implemented and that this issue could be closed? |
Closed by #6360 |
Summary
Rather than force a TS install, with a
--ts
flag, or a JS install with a--js
flag, let's just prompt the user and ask which they want from the start when they runyarn create redwood-app
.Of course the default option if you just hit ENTER at that prompt should be JS. 😏
Motivation
This puts and end to the debate of whether we should create a JS project or a TS project by default.
Detailed proposal
In the simplest implementation we just include the
prompt
package increate-redwood-app
and if the user chooses JS, do nothing, and if they choose TS we set the--ts
flag for them.Are you interested in working on this?
The text was updated successfully, but these errors were encountered: