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]: Prompt user to create project as JS or TS in create-redwood-app #6275

Closed
1 task
Tracked by #3989
cannikin opened this issue Aug 23, 2022 · 12 comments
Closed
1 task
Tracked by #3989
Labels
release:feature This PR introduces a new feature topic/crwa create-redwood-app

Comments

@cannikin
Copy link
Member

cannikin commented Aug 23, 2022

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 run yarn 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 in create-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?

  • I'm interested in working on this
@cannikin cannikin added topic/crwa create-redwood-app release:feature This PR introduces a new feature labels Aug 23, 2022
@cannikin cannikin changed the title [RFC]: Prompt user to create JS vs TS during create-redwood-app [RFC]: Prompt user to create project as JS or TS in create-redwood-app Aug 23, 2022
@redwoodjs-bot redwoodjs-bot bot moved this to Triage in Main Aug 24, 2022
@redwoodjs-bot redwoodjs-bot bot added this to Main Aug 24, 2022
@ehowey
Copy link
Contributor

ehowey commented Aug 25, 2022

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.

@Tobbe
Copy link
Member

Tobbe commented Aug 27, 2022

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 😉

@Tobbe
Copy link
Member

Tobbe commented Aug 27, 2022

@ehowey If you wanted to have a go at this that would be awesome! Please do also take a look at #3989 to better understand the overall picture of where we want to take this 🙂

@pantheredeye
Copy link
Collaborator

pantheredeye commented Sep 1, 2022

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 wink

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:

Improve overall experience and branding

  • prompt for configuration: TS or JS, Install packages, Git Init (and commit message)

Considering that, I like the prompt approach.

@cannikin
Copy link
Member Author

cannikin commented Sep 2, 2022

We discussed in a core team meeting and said we’d prompt! You were there @Tobbe, I see you trying to push your TS agenda. 😉

BTW I’m fine with making TS the default if you just hit ENTER, my JS-default solution was mostly just to give @Tobbe nightmares. Muwhahaha

@ehowey
Copy link
Contributor

ehowey commented Sep 2, 2022

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
Copy link
Member

Tobbe commented Sep 2, 2022

@Tobbe wrote:

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.

(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:

We discussed in a core team meeting and said we’d prompt! You were there @Tobbe, I see you trying to push your TS agenda. 😉

Of course I am 😁 But only as far as making it the default ENTER option

@pantheredeye
Copy link
Collaborator

Don't know where you guys got the idea I tried to steer us away from that

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. 😄

@cannikin
Copy link
Member Author

cannikin commented Sep 2, 2022

Oh yeah sorry, I missed the prompt part of that as well! @Tobbe probably edited the comment and added that in after our comments. 😉

@ehowey
Copy link
Contributor

ehowey commented Sep 3, 2022

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.

@Josh-Walker-GM
Copy link
Collaborator

Hey everyone, just confirming this has been implemented and that this issue could be closed?

@Tobbe
Copy link
Member

Tobbe commented Oct 4, 2022

Closed by #6360

@Tobbe Tobbe closed this as completed Oct 4, 2022
Repository owner moved this from Triage to Done in Main Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature topic/crwa create-redwood-app
Projects
Status: Done
Development

No branches or pull requests

5 participants