-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add a TypeScript step to create-astro
#4179
Conversation
🦋 Changeset detectedLatest commit: b5a1f04 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this!
packages/create-astro/src/index.ts
Outdated
choices: [ | ||
{ | ||
title: 'Relaxed', | ||
description: "Not a big fan of TypeScript? No issues, we'll keep this kind", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: "Not a big fan of TypeScript? No issues, we'll keep this kind", | |
description: "Not a big fan of TypeScript? No worries, we'll keep things casual", |
I LOVE this option! This is such user empathy! 😄
I would suggest adjusting the message a little bit, though. When I read it, I read "kind" expecting "kind of..." So, I thought it was going to say, "We'll keep this kind of...." and then it stopped.
Often designing messages for the widest audience possible, we would try to avoid slang etc. So, you can't go wrong with a very factual description here of what will/won't happen. But, I think if you want to convey this friendliness, there are still some choices that could work. Maybe like....
First part: I think "No worries" is much more common across an international audience than "No issues" (issues might make people think of bugs? or is there an "issue" with this process?) I'd consider "worries" instead.
Second part: this is a little harder, but here are some possibilities that might be a bit more accessible while still being fun, maybe?
- we'll keep things casual
- we'll take it easy on you
- we won't make you use it / you don't have to use it
- we'll turn off the red squigglies
- we'll try to help, but won't insist
... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree! I used No issues
because No worries
is used earlier in the steps and my brain immediately went in "Find synonyms" mode 😄
For the second part, we can't say that the user won't have to use it or that it'll disable anything because it effectively doesn't. TypeScript is always enabled, just with friendlier settings. we'll keep things casual
seems good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here were my suggestions, lmk what you think! #4179 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought on formatting: because this is the last question, what if the "don't love typescript" message came after "setup complete!" That way it wouldn't break up the series of prompts mid-way through.
With @Princesseuh's blessing I just took a pass on the prompts, here's where I landed. Feedback welcome! BeforeAfter |
I feel like giving the option "I don't want to use TS" and the text after are selling something that doesn't exist to users. It's not just that Astro support TypeScript, it's TypeScript, even on the most relaxed settings, there will be TypeScript errors, even without a tsconfig.json etc |
So I was trying to call that out here, basically saying "we understand that you prefer not to, but Astro needs to, so trust us and don't worry about it". Maybe this could be rewritten to be more clear? Let me reword this to be more of a warning, since it sounds like the "Astro needs to" part of it was lost. Is this any better? |
ca731f0
to
b5a1f04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Merging to get this out in the next release but I'm happy to keep workshopping the wording in a future PR.
Changes
This PR adds a step to
create-astro
to allow users to configure how strict they want their TypeScript install to beI've set the "Strict" preset as the recommended one
in hope of making everyone's code betteras it's the one TypeScript itself recommend for new projects (same goes for all our other recommended settings)The "Stricter" settings were mostly sourced from
create-t3-app
, it has very cool settings for TypeScriptTesting
Tested manually
Docs
Will PR docs if needed